feat(hipblaslt): move fused GEMM + all-to-all into the experimental API tier #17289
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #17289"
general
weight: 0.35
yzhang93
JIRA ID : AIHPBLAS-6031
Motivation
hipBLASLt can fuse an all-to-all, the collective in which every rank (one GPU of a group) sends a different block of data to every other rank, into a matrix multiplication (GEMM). The fusion works in both directions: GEMM+A2A sends parts of the output D to the other ranks as the GEMM stores it, and A2A+GEMM gathers this rank's share of the input B from its peers before the GEMM's main loop.
Its whole API sat in
hipblaslt.hbehind#if HIPBLASLT_HAS_GEMM_A2A_FUSION, which the off-by-default CMake optionHIPBLASLT_ENABLE_GEMM_A2A_FUSIONset. No ROCm build declared it, and whether a program could compile against it depended on how hipBLASLt was built. RFC0016 names this feature as the first to move into the experimental API tier that #16403 added: an opt-in header, a revision number that consumers check, and a deadline by which the feature graduates or is removed.Technical Details
hipblaslt/hipblaslt-experimental-gemm-a2a.has featureGEMM_A2A, revision 1, and stays a C API. As RFC0016 requires, functions and types take thehipblasLtExperimentalprefix (for examplehipblasLtExperimentalFusionCreate,hipblasLtExperimentalSetDeviceCommandhipblasLtExperimentalSdmaQueue_t) and constants take theHIPBLASLT_EXPERIMENTAL_prefix. A program sees the API only after it opts in, as the next section shows.HIPBLASLT_EXPERIMENTAL_MATMUL_DESC_FUSED_EPILOGUEand A2A+GEMM throughHIPBLASLT_EXPERIMENTAL_MATMUL_DESC_FUSED_PROLOGUE. Both share the descriptor type, the device communicator and the copy-engine queue attributes, so they form one feature with one revision.hipblasLtMatmulDescAttributes_t,0x40000003and0x40000004. The other A2A enumerators are renumbered 5 through 14, so no two A2A values coincide, andHIPBLASLT_EXPERIMENTAL_ENUM_HIGH_WATERrises from 2 to 14. In C++, converting a value outside an enum's range to the enum is undefined behavior, and the range ofhipblasLtMatmulDescAttributes_tended at 127. The stable enum therefore gainsHIPBLASLT_MATMUL_DESC_EXPERIMENTAL_RESERVED(0x40000000), which extends its range over the experimental values. It is not an attribute, andhipblasLtMatmulDescSetAttributerejects it. The enum's size and underlying type are unchanged.hipblaslt-opt-in-features.hand itsHIPBLASLT_HAS_GEMM_A2A_FUSIONmacro are removed, and TensileCreateLibrary no longer drops logic files whoseProblemTypesetsFusedA2A. Every build now compiles the API in, and every gfx950 device library gains the two fused logic files, which hold 7 solutions. The library links nothing new.library/experimental/features.cmakeregistersGEMM_A2Awith owner @yzhang93 and tracking ticket AIHPBLAS-6031. It is introduced in ROCm 10.4 and may ship through 11.1, becauserelease/therock-10.3was cut on 2026-11-30.fused_a2a_gtest.cppthat check behavior the header documents move toclients/tests/src/experimental/contract_gemm_a2a_gtest.cpp, with shared fixtures incontract_gemm_a2a_helpers.hpp. A new contract test attaches both stages through attribute values loaded from a variable. With Clang, that file is built with the enum sanitizer in trap mode, so a load outside the enum's range stops the test, and it declares the attributesconstexpr, which fails to compile in that case. The 24 tests that check implementation details (rocRoller, grouped GEMM, the extension API and the current kernels' limits) stay infused_a2a_gtest.cpp. Two new tests there fail on gfx950 if the device library lacks the GEMM+A2A or the A2A+GEMM kernel. They skip on other GPUs, and when the build filters the logic files or uses a custom logic path. Math CI's single-GPU gfx950 lane builds the full library, so it runs them. Neither file creates a real copy-engine queue.hipblaslt-bench-a2a, the multi-process tests andclients/samples/30_hipblaslt_a2a_sdmacreate copy-engine (SDMA) queues through hsakmt, the user-space library for the GPU kernel driver, which needs libnuma. They build with the new client optionHIPBLASLT_ENABLE_A2A_SDMA_CLIENTS(Linux only, off by default;invoke build --a2a-sdma-clients), asTENSILELITE_ENABLE_SDMAalready does for the TensileLite client.invoke build --gemm-a2a-fusionremains as a deprecated alias for it, so existing build scripts and Math CI's multi-GPU lane keep building these clients.hipblasLtSetDeviceComm. If it lands after this change, the experimental API checker will require it to add a renamed_v2function and bump the revision to 2.Using the feature
Link
roc::hipblaslt_experimentalin CMake, or defineROCM_ENABLE_EXPERIMENTAL_APIS=1before the include. Check the revision at run time, because the loaded library may be a different build:Then register the ranks with
hipblasLtExperimentalSetDeviceComm, build a descriptor withhipblasLtExperimentalFusionCreateandhipblasLtExperimentalFusionAddEpilogue(GEMM+A2A) orhipblasLtExperimentalFusionAddPrologue(A2A+GEMM), set its attributes, and attach it throughHIPBLASLT_EXPERIMENTAL_MATMUL_DESC_FUSED_EPILOGUEorHIPBLASLT_EXPERIMENTAL_MATMUL_DESC_FUSED_PROLOGUE.clients/samples/30_hipblaslt_a2a_sdmais a complete program.Test Plan
On a node with MI350X GPUs (gfx950) and ROCm 7.2.1:
python3 tools/scripts/check_experimental_api.py --base upstream/develop, andpytest tools/scripts/tests.invoke build -a gfx950 -c -f 'gfx950_Cijk_Alik_Bljk_BBS_BH_UserArgs' --a2a-sdma-clients, which builds the library, the clients, and a device library holding both plain and fused BF16 kernels. The build includeshipblaslt-c-headers-check, which compiles the public C headers as C11 with-Wall -Wextra -Werror.hipblaslt-test --gtest_filter='gemm_a2a_contract:ExperimentalApiSmoke.:FusedA2A:arguments_a2a:partitioned_gemm_contract:-World/'on one GPU.hipblaslt-test --gtest_filter='World/FusedA2AMultiProcess_multi_gpu.'on 8 GPUs.-DHIPBLASLT_ENABLE_A2A_SDMA_CLIENTS=OFF, followed by the single-GPU filter.hipblaslt-test --gtest_filter='gemm_a2a_contract:ExperimentalApiSmoke.:FusedA2A:-World/*'on one GPU, built once withHIPBLASLT_TEST_FULL_DEVICE_LIBRARYforced on (this filtered library holds both fused kernels) and once as configured.hipblaslt.h, one includinghipblaslt-experimental.hwithout the switch, one with the switch, and afind_package(hipblaslt)project linkingroc::hipblaslt_experimental.Test Result
pytest tools/scripts/tests: 93 passed.hipblaslt-testdoes not link hsakmt, andhipblaslt-bench-a2ais not built. 91 passed, 1 skipped (the grouped MXFP8 test).hipblaslt.h, and the experimental header declares nothing without the switch. With the switch, the API runs, reports revision 1, and rejects the former attribute value 106 withHIPBLAS_STATUS_INVALID_VALUE. Thefind_packageproject builds and runs.-fsanitize=enum -fsanitize-trap=enum. With the requirement forced on: 104 passed and 1 skipped (the grouped MXFP8 test, which has no kernel in the filtered library), including both gfx950 kernel tests, the new contract test and the rejection of the reserved value. As configured, the two gfx950 kernel tests skip.test_arch_steppings.pycould not start, because their subprocess could not importrocisa.codefrom the local Python environment.Submission Checklist
Risk level
Medium (3/5). Plain GEMMs keep their kernel selection: a fused solution matches only a problem with a fused stage attached, and the tests that detach the stage get the plain algorithm back. The build changes more: every build now compiles the A2A code, Windows included, and every gfx950 device library carries the fused kernels. The A2A API itself changes names and values, but no ROCm release build declared it.