Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8b3ac49
test(rccl): add host microtests for misc/rocmwrap.cc
aduforest Oct 13, 2026
17147e8
test(rccl): mark kernel_config.cc generated for in-tree configure, ad…
aduforest Oct 14, 2026
8559f6a
test(rccl): add host microtests for misc/roctx.cc and misc/nvmlwrap_s…
aduforest Oct 13, 2026
c15b079
test(rccl): cover roctx.cc's ROCTX_ENABLE arm in the roctx microtests
aduforest Oct 13, 2026
c9c918a
test(rccl): build roctx.cc's ROCTX_ENABLE arm standalone, split push/…
aduforest Oct 13, 2026
090feb0
docs(rccl): note the in-tree ROCTX_ENABLE inheritance in the RoctxNvm…
aduforest Oct 13, 2026
5083ca2
test(rccl): pin cuMem off in the DMABUF_ENABLE=0 test, check the expo…
aduforest Oct 14, 2026
0033707
test(rccl): add host microtests for misc/amdsmi_wrap.cc
aduforest Oct 14, 2026
143d2ea
test(rccl): tighten amdsmi_wrap microtests per review
aduforest Oct 14, 2026
05c89f6
test(rccl): pin the XGMI-only gates in amdsmi_wrap link info
aduforest Oct 14, 2026
cd11a89
test(rccl): trim microtest docs and comments to match the other host …
aduforest Oct 14, 2026
f09b20b
test(rccl): trim microtest docs and comments to match the other host …
aduforest Oct 14, 2026
6da3065
test(rccl): trim microtest docs and comments to match the other host …
aduforest Oct 14, 2026
521c4ce
test(rccl): follow the microtest naming and registration rules
aduforest Oct 14, 2026
74e100d
test(rccl): pin amdsmi_wrap's link-info type check and fabric bounds
aduforest Oct 15, 2026
986c9cd
Merge commit 'f09b20b1fe' into users/aduforest/aicomrccl-2822-roctx-n…
aduforest Oct 15, 2026
4905548
Merge commit '74e100d3ed' into users/aduforest/aicomrccl-2822-roctx-n…
aduforest Oct 15, 2026
086d1c2
Merge remote-tracking branch 'origin/develop' into users/aduforest/ai…
aduforest Oct 16, 2026
48a7554
test(rccl): name the roctx/rocmwrap/amdsmi pins KnownBug_
aduforest Oct 16, 2026
a87f794
Merge remote-tracking branch 'origin/develop' into agent/2822-pr
aduforest Oct 19, 2026
e5ec934
Merge remote-tracking branch 'origin/develop' into agent/2822-pr
aduforest Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 71 additions & 2 deletions projects/rccl/test/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,32 @@ function(rccl_define_micro_source_lists)
../common/main_altrsmi.cpp
PARENT_SCOPE)

# rccl-UnitTestsMicroRoctxNvml -- src/misc/roctx.cc + src/misc/nvmlwrap_stub.cc. Own binary:
# fakes/comm_fakes.cc stubs the roctx_scoped_range_in this target compiles for real.
set(TEST_MICRO_ROCTX_NVML_SOURCE_FILES
roctx-nvml-stub-test.cc
../common/main_altrsmi.cpp
PARENT_SCOPE)

# rccl-UnitTestsMicroAmdsmiWrap -- src/misc/amdsmi_wrap.cc. Own binary: fakes/amdsmi_fakes.cc
# defines the amd_smi_* wrappers this target compiles for real.
set(TEST_MICRO_AMDSMI_WRAP_SOURCE_FILES
amdsmi-wrap-test.cc
fakes/hip_fakes.cc
${RCCL_HOST_HIPIFY_DIR}/src/misc/utils.cc # real busIdToInt64
../common/main_altrsmi.cpp
PARENT_SCOPE)

# rccl-UnitTestsMicroRocmwrap -- src/misc/rocmwrap.cc. Own binary: fakes/rocmwrap_fakes.cc
# and fakes/nccl_fakes.cc define rocmLibraryInit, ncclCuMemEnable and ncclCuMemHandleType.
set(TEST_MICRO_ROCMWRAP_SOURCE_FILES
rocmwrap-test.cc
fakes/hip_fakes.cc
${RCCL_HOST_HIPIFY_DIR}/src/misc/archinfo.cc # real GetGcnArchName/IsArchMatch
${RCCL_HOST_HIPIFY_DIR}/src/misc/kernel_config.cc # real option matching
../common/main_altrsmi.cpp
PARENT_SCOPE)

# src/diagnostics/p2p.cc; fakes transport/p2p.cc, which rccl-UnitTestsMicro compiles.
set(TEST_MICRO_DIAGNOSTICS_SOURCE_FILES
diag-p2p-test.cc
Expand Down Expand Up @@ -814,6 +840,8 @@ function(rccl_standalone_setup)
# binary; run_host_tests.sh (the only in-repo workflow that runs these) uses
# this standalone path, so build the shipping arm explicitly too.
set(_ENQ_BUILD_DEVLINKER TRUE PARENT_SCOPE)
# Likewise roctx.cc's ROCTX_ENABLE arm (-roctx).
set(_MICRO_BUILD_ROCTX_VARIANT TRUE PARENT_SCOPE)
# No GENERATE_SYM_KERNELS variable exists in this standalone project(); check
# for the generated host TU on disk instead.
if(EXISTS "${RCCL_HIPIFY_DIR}/gensrc/symmetric/sym_kernels_host.cc")
Expand Down Expand Up @@ -850,6 +878,7 @@ if(BUILD_TESTS)
set(_MICRO_MODE_DEFS "")
set(_MICRO_AMDSMI_DEF "")
set(_ENQ_BUILD_DEVLINKER FALSE)
set(_MICRO_BUILD_ROCTX_VARIANT FALSE)
set(_MICRO_BUILD_SYM_KERNELS ${GENERATE_SYM_KERNELS})
else()
# --- hipcc is mandatory (must be resolved before project() at top level) ---
Expand Down Expand Up @@ -931,7 +960,7 @@ endif()
# Mark every hipified misc/ oracle TU any target below compiles as GENERATED.
# The property is directory-scoped and idempotent, so one call up front covers
# all targets -- no need to repeat it per binary.
rccl_mark_oracle_tus_generated(${RCCL_HOST_HIPIFY_DIR} argcheck archinfo utils)
rccl_mark_oracle_tus_generated(${RCCL_HOST_HIPIFY_DIR} argcheck archinfo utils kernel_config)

# ---------------------------------------------------------------------------
# rccl-UnitTestsMicro
Expand Down Expand Up @@ -1193,7 +1222,7 @@ endif()
# in rccl_define_micro_source_lists() for the rationale.
# ---------------------------------------------------------------------------
# task_prep/ and config/ oracle TUs live outside src/misc/, so mark them GENERATED
# here (rccl_mark_oracle_tus_generated only covers the misc/ argcheck/archinfo/utils set).
# here (rccl_mark_oracle_tus_generated only covers the misc/ argcheck/archinfo/utils/kernel_config set).
set_source_files_properties(
${RCCL_HOST_HIPIFY_DIR}/src/config/algorithm_parser.cc
${RCCL_HOST_HIPIFY_DIR}/src/config/algorithm_registry.cc
Expand Down Expand Up @@ -1233,6 +1262,46 @@ rccl_add_micro_binary(rccl-UnitTestsMicroRomeModels
ROME_MODELS_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/graph/rome_models.cc"
CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/../test_categories_micro_rome_models.yaml")

# ---------------------------------------------------------------------------
# rccl-UnitTestsMicroRoctxNvml
# ---------------------------------------------------------------------------
set(_roctx_nvml_common_args
SOURCES ${TEST_MICRO_ROCTX_NVML_SOURCE_FILES}
EXTRA_DEFS
${_MICRO_MODE_DEFS}
ROCTX_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/misc/roctx.cc"
NVMLWRAP_STUB_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/misc/nvmlwrap_stub.cc"
CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/../test_categories_micro_roctx_nvml.yaml")

rccl_add_micro_binary(rccl-UnitTestsMicroRoctxNvml ${_roctx_nvml_common_args})
# -roctx builds roctx.cc's ROCTX_ENABLE arm against the stand-in fakes/roctx_include.
if(_MICRO_BUILD_ROCTX_VARIANT)
rccl_add_micro_binary(rccl-UnitTestsMicroRoctxNvml-roctx ${_roctx_nvml_common_args})
target_compile_definitions(rccl-UnitTestsMicroRoctxNvml-roctx PRIVATE ROCTX_ENABLE)
target_include_directories(rccl-UnitTestsMicroRoctxNvml-roctx BEFORE PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fakes/roctx_include)
endif()

# ---------------------------------------------------------------------------
# rccl-UnitTestsMicroRocmwrap
# ---------------------------------------------------------------------------
rccl_add_micro_binary(rccl-UnitTestsMicroRocmwrap
SOURCES ${TEST_MICRO_ROCMWRAP_SOURCE_FILES}
EXTRA_DEFS
${_MICRO_MODE_DEFS}
ROCMWRAP_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/misc/rocmwrap.cc"
CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/../test_categories_micro_rocmwrap.yaml")

# ---------------------------------------------------------------------------
# rccl-UnitTestsMicroAmdsmiWrap
# ---------------------------------------------------------------------------
rccl_add_micro_binary(rccl-UnitTestsMicroAmdsmiWrap
SOURCES ${TEST_MICRO_AMDSMI_WRAP_SOURCE_FILES}
EXTRA_DEFS
${_MICRO_MODE_DEFS}
AMDSMI_WRAP_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/misc/amdsmi_wrap.cc"
CATEGORIES_YAML "${CMAKE_CURRENT_SOURCE_DIR}/../test_categories_micro_amdsmi_wrap.yaml")

# ---------------------------------------------------------------------------
# rccl-UnitTestsMicroGraph is its own binary because the others link fakes for the graph symbols these TUs define.
# ---------------------------------------------------------------------------
Expand Down
36 changes: 25 additions & 11 deletions projects/rccl/test/host/MICROTEST_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,21 @@ export colliding non-`static` symbols; otherwise a unit needs its own binary:
memory stack. The suite drives the public lifecycle --
`ncclRmaProxyCreateContext` / `ncclRmaProxyDestroyContext` -- so production
owns the context and its cleanup. See `test_categories_micro_rma_proxy.yaml`.
- **`rccl-UnitTestsMicroRoctxNvml`** (+ **`-roctx`**) — `src/misc/roctx.cc` and
`src/misc/nvmlwrap_stub.cc` (via `ROCTX_CC_PATH` / `NVMLWRAP_STUB_CC_PATH`,
from `roctx-nvml-stub-test.cc`); suites `RoctxNvml*`. Its own binary because
`fakes/comm_fakes.cc` stubs the `roctx_scoped_range_in` this file defines. See
`test_categories_micro_roctx_nvml.yaml`.
- **`rccl-UnitTestsMicroRocmwrap`** — `src/misc/rocmwrap.cc` (via
`ROCMWRAP_CC_PATH`, from `rocmwrap-test.cc`); suite `RocmwrapMicrotest.*`. Its
own binary because `fakes/rocmwrap_fakes.cc` and `fakes/nccl_fakes.cc` define
`rocmLibraryInit`, `ncclCuMemEnable` and `ncclCuMemHandleType`. See
`test_categories_micro_rocmwrap.yaml`.
- **`rccl-UnitTestsMicroAmdsmiWrap`** — `src/misc/amdsmi_wrap.cc` (via
`AMDSMI_WRAP_CC_PATH`, from `amdsmi-wrap-test.cc`); suite
`AmdsmiWrapMicrotest.*`. Its own binary because `fakes/amdsmi_fakes.cc`
defines the `amd_smi_*` wrappers this file compiles. See
`test_categories_micro_amdsmi_wrap.yaml`.

- **`rccl-UnitTestsMicroDiagnostics`**: `src/diagnostics/p2p.cc` (via
`DIAG_P2P_CC_PATH`, suite `DiagP2pMicrotest.*`) and `src/diagnostics/ib_write_bw.cc`
Expand Down Expand Up @@ -869,25 +884,20 @@ make -j $(nproc) rccl-UnitTestsMicro

`test/host/CMakeLists.txt` is dual-mode. Alongside the in-RCCL-build target
above (`./install.sh -t`, wired via `add_subdirectory(host)`), the same file
can be configured **directly** to build every host binary — `rccl-HostUnitTests`,
`rccl-UnitTestsMicro`, `rccl-UnitTestsMicroWarpSpeed`,
`rccl-UnitTestsMicroInit[-uncached|-faultinj]`, `rccl-UnitTestsMicroEnqueue[-devlinker]`,
`rccl-UnitTestsMicroGinHost`, `rccl-UnitTestsMicroDdaIpc`, `rccl-UnitTestsMicroCe`, `rccl-UnitTestsMicroDiagnostics`,
`rccl-UnitTestsMicroGraph`, `rccl-UnitTestsMicroDiagnostics`,
`rccl-UnitTestsMicroSymKernels`, `rccl-UnitTestsMicroTaskPrep` and
`rccl-UnitTestsMicroRmaProxy` — **without configuring/building all of
can be configured **directly** to build every host binary in the run block below
— **without configuring/building all of
librccl**. It compiles just the tests + fakes + the hipified unit-under-test
sources.

Three of those names are preprocessor variants, not duplicates. `init.cc` gates
Four of those names are preprocessor variants, not duplicates. `init.cc` gates
part of its allocation path on `HIP_*_UNCACHED_MEMORY` and its fault-mask blocks
on `ENABLE_FAULT_INJECTION`, and `enqueue.cc` gates `rcclShmemDynamicSize` on
`RCCL_DEVICE_LINKER`, all at the **preprocessor**, so one compile can only ever
reach one arm. The in-RCCL-build path inherits `RCCL_DEVICE_LINKER` from the
`RCCL_DEVICE_LINKER`, and `roctx.cc` gates roctracer on `ROCTX_ENABLE`, all at
the **preprocessor**, so one compile can only ever reach one arm. The in-RCCL-build path inherits `RCCL_DEVICE_LINKER` from the
`rccl` target's compile definitions (`ENABLE_DEVICE_LINKER` defaults ON, so the
device-linker arm is the one that ships); this standalone project has no `rccl`
target to inherit from, which is why it builds the `-devlinker` variant
explicitly. `ENABLE_FAULT_INJECTION` was the same inheritance in reverse -
explicitly, and likewise `-roctx`. `ENABLE_FAULT_INJECTION` was the same inheritance in reverse -
defined in-tree, absent standalone, so the two paths tested different code - and
is now stripped from the inherited list and set per variant in both paths, so the
`-faultinj` binary is the only one that has it either way.
Expand Down Expand Up @@ -922,6 +932,10 @@ cmake --build build -j"$(nproc)"
./build/rccl-UnitTestsMicroCe # src/ce_coll.cc tests
./build/rccl-UnitTestsMicroRmaProxy # src/rma/rma_proxy.cc tests
./build/rccl-HostUnitTests
./build/rccl-UnitTestsMicroRoctxNvml # misc/roctx.cc + misc/nvmlwrap_stub.cc tests
./build/rccl-UnitTestsMicroRoctxNvml-roctx # same, ROCTX_ENABLE arm
./build/rccl-UnitTestsMicroRocmwrap # src/misc/rocmwrap.cc cuMem + DMA-BUF init
./build/rccl-UnitTestsMicroAmdsmiWrap # src/misc/amdsmi_wrap.cc
```

Disable coverage instrumentation for the standalone host-only test binaries
Expand Down
Loading
Loading