FlyDSL icon indicating copy to clipboard operation
FlyDSL copied to clipboard

[gfx1250] Add cluster launch support with TDM multicast bandwidth tests

Open jli-melchior opened this issue 5 months ago • 0 comments

Motivation

gfx1250 (MI450) introduces cluster launch and TDM (Tensor Data Mover) hardware features for inter-workgroup async DMA and L2 multicast. The existing mgpuLaunchClusterKernel in FlyDSL runtime uses #ifdef hipLaunchAttributeClusterDimension for conditional compilation, but this is an enum value, not a preprocessor macro, making the guard unreliable. Additionally, there are no end-to-end tests or performance benchmarks for cluster launch and TDM multicast.

Technical Details

Runtime fix (lib/Runtime/ROCm/FlyRocmRuntimeWrappers.cpp):

  • Replace #ifdef hipLaunchAttributeClusterDimension with #if defined(HIP_VERSION) && (HIP_VERSION >= 70200000)
  • Simplify error handling: remove the cluster=(1,1,1) fallback logic — hipDrvLaunchKernelEx should work correctly on ROCm 7.2+
  • The #else branch for HIP < 7.2 retains the fallback to hipModuleLaunchKernel with no behavioral change

Cluster launch tests (tests/unit/test_cluster_launch_gfx1250.py):

  • vec_add smoke test: verifies hipDrvLaunchKernelEx + cluster dims end-to-end correctness
  • cluster_barrier test: verifies cluster_barrier() cross-WG synchronization

TDM multicast correctness tests (tests/unit/test_tdm_mcast_add_gfx1250.py):

  • TDM 2D async load + LDS add + buffer store, parametrized over cluster configs: (2,1), (1,2), (2,2)
  • Bandwidth comparison benchmark (@pytest.mark.benchmark)

TDM bandwidth benchmark (tests/perf/bench_tdm_bandwidth_gfx1250.py):

  • Three modes: read-only (pure TDM HBM read BW), unique (TDM load+add+store R/W BW), multicast (cluster multicast L2→LDS throughput)
  • L2 flush + CUDA event timing + IQR median, sweeping multiple grid and cluster configurations
  • Default --mode all runs all modes in sequence

Cluster multicast GEMM (tests/unit/test_cluster_mcast_gemm_gfx1250.py):

  • WMMA GEMM + TDM multicast prototype, currently @pytest.mark.skip (JIT compilation hangs with cluster params, deferred to a follow-up PR)

Test Plan

  • python -m pytest tests/unit/test_cluster_launch_gfx1250.py -v --tb=short — cluster launch smoke + barrier
  • python -m pytest tests/unit/test_tdm_mcast_add_gfx1250.py -v --tb=short — TDM multicast correctness
  • python tests/perf/bench_tdm_bandwidth_gfx1250.py — three-mode bandwidth benchmark
  • Verify mgpuLaunchClusterKernel does not affect existing kernel launches on non-gfx1250 architectures

Test Result

Tested on gfx1250 hardware:

  • Cluster launch: vec_add and barrier tests pass
  • TDM multicast: correctness verified for (2,1), (1,2), (2,2) cluster configs
  • Bandwidth benchmark: read-only mode reaches ~19.9 TB/s at 256x256 grid (90.3% of 22 TB/s peak); unique mode reaches ~16 TB/s (72.8%)

Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

jli-melchior avatar Jun 17 '26 03:06 jli-melchior