Adding HBM read bandwidth preset - #250
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new hbm preset intended to sweep kernel/config options and report maximum attainable HBM read bandwidth, including multi-rank aggregation of best-per-GPU results.
Changes:
- Added new
hbmpreset implementation with a dedicated read-bandwidth kernel and sweep/aggregation logic. - Updated the preset function signature across all presets to also receive whether the byte-count argument was explicitly provided.
- Added utility helpers for rank-uniformity checking and simple allocation/deallocation forwarders; updated changelog.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/header/TransferBench.hpp | Minor C++ cleanup (NULL→nullptr) and removed an unused variable. |
| src/client/Utilities.hpp | Adds IsUniform helper + IS_UNIFORM macro and allocation/deallocation forwarders. |
| src/client/Presets/Presets.hpp | Wires in new hbm preset and extends preset function signature with bytesSpecified. |
| src/client/Presets/HbmBandwidth.hpp | New preset: kernel table + sweep execution + timing + cross-rank reporting. |
| src/client/Presets/AllToAll.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/AllToAllN.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/AllToAllSweep.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/HealthCheck.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/NicRings.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/NicPeerToPeer.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/OneToAll.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/PeerToPeer.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/PodAllToAll.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/PodPeerToPeer.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/Scaling.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/Schmoo.hpp | Updated preset function signature to include bytesSpecified. |
| src/client/Presets/Sweep.hpp | Updated preset function signature to include bytesSpecified. |
| CHANGELOG.md | Documents the new hbm preset addition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (int iteration = 0; iteration < numIterations; iteration++) { | ||
| *minStartCycle = std::numeric_limits<long long int>::max(); | ||
| *maxStopCycle = 0; |
There was a problem hiding this comment.
When USE_WALLCLOCK is disabled, minStartCycle/maxStopCycle remain nullptr but are still unconditionally dereferenced and reset each iteration. This will segfault/crash in event-timing mode. Guard the *minStartCycle/*maxStopCycle writes (and any kernel arguments that rely on them) behind useWallClock, or allocate/init these buffers unconditionally (and update the kernel to handle nullptrs safely).
- Initial pod communication support (#235) - cuda + MNNVL update & pod presets (#241) - Increase CQ size for high qps (#244) - fix hang when NVML is present but fabricmanager isnt (#246) - Adding nica2a preset (#248) - Adding HBM read bandwidth preset (#250) - Pod Ring preset (#251) - gfxsweep preset (#254) (#256) - Adding Batched DMA support (hipMemcpyBatchAsync), and bmasweep preset (#255) - Adding a wallclock consistency detection preset (#258) - Adding smoketest preset for simple correctness tests (#266) - Help / envvars / presets presets (#267) - Modernize CMake build (#268) - Replace version-based pod/amd-smi detection with compile-time API probes (#269) - Fix collective mismatch hangs in multi-rank error paths (#270) - Fix SHOW_ITERATIONS table truncation with multiple transfers per executor (#271) - Reformat a2asweep output to match gfxsweep style (#272) - Gfx sweep update (#274) - Increasing flush frequency in smoketest (#275) - Adding new experimental copy-only GFX kernel, gfxsweep update (#277) - Fixes for cuMem compilation and invalid device ordinal (#278) - Simplifying socket connect, allow for using host address (#279) - Updating podring to run on single node without need to force single pod (#280) - Adding SHOW_PERCENTILES to show extra per-iteration statistics (#281) --------- Co-authored-by: AtlantaPepsi <timhu102@gmail.com> Co-authored-by: Pak Nin Lui <pak.lui@amd.com> Co-authored-by: pierreantoineH <PierreAntoine.Harraud@amd.com> Co-authored-by: Nilesh M Negi <Nilesh.Negi@amd.com> Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Initial pod communication support (#235) - cuda + MNNVL update & pod presets (#241) - Increase CQ size for high qps (#244) - fix hang when NVML is present but fabricmanager isnt (#246) - Adding nica2a preset (#248) - Adding HBM read bandwidth preset (#250) - Pod Ring preset (#251) - gfxsweep preset (#254) (#256) - Adding Batched DMA support (hipMemcpyBatchAsync), and bmasweep preset (#255) - Adding a wallclock consistency detection preset (#258) - Adding smoketest preset for simple correctness tests (#266) - Help / envvars / presets presets (#267) - Modernize CMake build (#268) - Replace version-based pod/amd-smi detection with compile-time API probes (#269) - Fix collective mismatch hangs in multi-rank error paths (#270) - Fix SHOW_ITERATIONS table truncation with multiple transfers per executor (#271) - Reformat a2asweep output to match gfxsweep style (#272) - Gfx sweep update (#274) - Increasing flush frequency in smoketest (#275) - Adding new experimental copy-only GFX kernel, gfxsweep update (#277) - Fixes for cuMem compilation and invalid device ordinal (#278) - Simplifying socket connect, allow for using host address (#279) - Updating podring to run on single node without need to force single pod (#280) - Adding SHOW_PERCENTILES to show extra per-iteration statistics (#281) --------- Co-authored-by: Tim <43156029+AtlantaPepsi@users.noreply.github.com> Co-authored-by: Pak Nin Lui <pak.lui@amd.com> Co-authored-by: pierreantoineH <PierreAntoine.Harraud@amd.com> Co-authored-by: Nilesh M Negi <Nilesh.Negi@amd.com> Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Motivation
This PR adds a new HBM bandwidth preset
hbm, which sweeps over various GFX options to find the maximum attainable read bandwidth. Sweep options include which GPUs to targetGPU_INDICES, number of subexecutors (CUs/WGPs) to useNUM_SUB_EXECS, unrolling factorsUNROLLS, and element bytes sizesELEM_BYTES.Usage:
./TransferBench hbm <numBytesAtLeast=1GB>Technical Details
This preset contains its own specialized / simplified HIP kernel which is optimized for HBM reads, separate from the main TransferBench MIMO Transfer kernel. GPU wallclock timestamps are used by default to measure time (skips kernel launch latency)
USE_WALLCLOCK, with HIP event timing being the alternative method of time measurement (includes kernel launch latency). Each threadblock is assigned an identical amount of data to read, such that unroll and threadblock size are accounted for, so that the total amount of data read across all threadblocks is greater than or equal to the optional numBytesAtLeast argument. A time-based pre-warm is executed firstPREWARM_MSEC, before some number of iterations are executedNUM_ITERATIONS. In total there areNUM_BUFFERinput buffers allocated (according toMEM_TYPE) and initialized with pseudo random data. Each iteration cycles through these different input buffers.To get more information about runs, users can set
SHOW_EXTRAto see which options resulted in the best bandwidth based on the criteria set byCRITERIA(max/avg/min bandwidth). SettingSHOW_DETAILSto 1 will show per config results, and setting to 2 will show per iteration results.This preset supports multi-rank is supported - results will be collected then reported across all GPUs / all ranks.
This preset should also run on NVIDIA hardware, although some memory types aren't supported.
Test Plan
Collected some sample results on machines. Repeats appear to be quite consistent between runs, as well as between (max/avg/min).
MI300X: