Skip to content

Session Log: SIMT Package Reorganization for Multi-Architecture Support

Date: 2025-12-20 Focus: Reorganize SIMT package to support NVIDIA, AMD, and MasPar architectures

Reorganized the SIMT package from a single NVIDIA-focused implementation to a multi-architecture structure. Moved all NVIDIA code to simt/nv/, created placeholders for AMD RDNA/CDNA and MasPar architectures, and added a compatibility layer for backward-compatible imports.

The existing SIMT implementation was NVIDIA-specific (Streaming Multiprocessor with warp-based SIMT). To enable comparison with other parallel architectures:

  • AMD RDNA/CDNA: Workgroup Processor with wave-based SIMT (32 or 64 threads)
  • MasPar MP-1/MP-2: Classic SIMD array processor with 2D mesh of Processing Elements

The MasPar architecture is historically significant as its architects later designed NVIDIA’s GPU architecture.

Fixed warp distribution to use NVIDIA-style round-robin instead of sequential fill:

Before (sequential):

partition_id = i // warps_per_partition # Fills P0 completely before P1
# 18 warps: P0=8, P1=8, P2=2, P3=0

After (round-robin):

partition_id = i % num_partitions # Distributes evenly
# 18 warps: P0=5, P1=5, P2=4, P3=4

Files modified:

  • src/systars/simt/sm_controller.py: Fixed load_uniform_program() and activate_warps()
  • examples/simt/01_animated_simt.py: Fixed tiled GEMM warp distribution and global warp ID calculation

Created new directory structure:

src/systars/simt/
├── __init__.py # Compatibility layer (re-exports nv/*)
├── base.py # Common protocols (ProcessorSim, MemorySubsystem)
├── nv/ # NVIDIA SM with SM-level LSU (current)
│ ├── __init__.py # 63+ exports
│ ├── config.py
│ ├── sm_controller.py
│ ├── partition.py
│ ├── warp_scheduler.py
│ ├── register_file.py
│ ├── operand_collector.py
│ ├── execution_unit.py
│ ├── shared_memory.py
│ ├── global_memory.py
│ ├── load_store_unit.py
│ ├── memory_coalescer.py
│ ├── sm_lsu.py
│ ├── barrier.py
│ ├── energy_model.py
│ └── README.md
├── nv_v1/ # NVIDIA SM with per-partition LSU bug (legacy)
│ └── (same modules as nv/)
├── amd/ # AMD RDNA/CDNA placeholder
│ └── __init__.py # NotImplementedError stubs
└── maspar/ # MasPar MP-1/MP-2 placeholder
└── __init__.py # NotImplementedError stubs

The compatibility layer allows existing code to work unchanged:

# These still work (defaults to NVIDIA):
from systars.simt import SMSim, SIMTConfig
# Explicit architecture selection:
from systars.simt.nv import SMSim, SIMTConfig
from systars.simt.nv_v1 import SMSim # Legacy with LSU bug
from systars.simt.amd import WGPSim # NotImplementedError
from systars.simt.maspar import PEArraySim # NotImplementedError

Created base.py with protocols for architecture-agnostic interfaces:

class ProcessorSim(Protocol):
def step(self) -> dict: ...
def run_to_completion(self, max_cycles: int) -> int: ...
def done(self) -> bool: ...
def get_statistics(self) -> dict: ...
def get_energy_pj(self) -> float: ...
class MemorySubsystem(Protocol):
def read(self, address: int) -> int: ...
def write(self, address: int, value: int) -> None: ...
class SIMTConfigBase(ABC):
def execution_width(self) -> int: ... # 32/64/4096+
def local_memory_kb(self) -> int: ... # 48/64/16KB
def num_compute_units(self) -> int: ... # 4/2/1
Aspect NVIDIA SM AMD WGP MasPar MP-1/2
Model SIMT (warp) SIMT (wave) Pure SIMD
Width 32 threads 32/64 threads 4096+ PEs
Divergence Yes Yes No (lock-step)
Local Mem Shared 48KB LDS 64KB PE RAM 16KB
Connectivity Shuffle Permute 8-neighbor mesh + router
  • src/systars/simt/__init__.py - Replaced with compatibility layer
  • src/systars/simt/nv/__init__.py - Created with all exports
  • src/systars/simt/nv/*.py - Moved from simt/
  • src/systars/simt/nv_v1/*.py - Moved from simt_v1/
  • src/systars/simt/amd/__init__.py - Created placeholder
  • src/systars/simt/maspar/__init__.py - Created placeholder
  • src/systars/simt/base.py - Created common protocols
  • tests/unit/test_simt_components.py - Updated imports to nv/
  • examples/simt/01_animated_simt.py - Fixed round-robin distribution
  • examples/simt/02_energy_comparison.py - Updated imports
  • examples/simt/v1/01_animated_simt.py - Updated to use simt.nv_v1

All 57 SIMT tests pass with the new structure:

  • test_simt_components.py: 37 tests
  • test_simt_memory.py: 20 tests
  1. AMD Implementation: WGPSim with wave scheduler, LDS, 32/64-thread waves
  2. MasPar Implementation: ACU for instruction fetch, 2D PE array, 8-neighbor mesh + global router
  3. Energy Comparison: Compare all three architectures on GEMM workloads