Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
36c9059
test(rccl): add host-only unit tests for gin.cc and wqe_lat_mon.{cc,h}
dhanavikram Oct 21, 2026
a3a908a
Merge PR #13973 review fixes into net_ib gin and wqe_lat_mon tests
dhanavikram Oct 21, 2026
e28a68b
Merge PR #13973 review fixes into net_ib gin and wqe_lat_mon tests
dhanavikram Oct 22, 2026
cd9cda2
test(rccl): tighten gin and wqe_lat_mon review guards
dhanavikram Oct 22, 2026
ae8344a
Merge PR #13973 review fixes into net_ib gin and wqe_lat_mon tests
dhanavikram Oct 22, 2026
cdec67f
test(rccl): drive gin tests through the shared verbs recorder
dhanavikram Oct 22, 2026
ea31a99
Merge PR #13973 review fixes into net_ib gin and wqe_lat_mon tests
dhanavikram Oct 22, 2026
ca06695
Merge net_ib resiliency tests (with develop) into net_ib gin and wqe_…
dhanavikram Oct 26, 2026
4ab354d
Merge net_ib resiliency tests (with develop) into net_ib gin and wqe_…
dhanavikram Oct 27, 2026
fb63ee8
Merge users/dhanavikram/net-ib-resiliency-host-tests: leave the Trans…
dhanavikram Oct 27, 2026
29e8fec
test(rccl): pin GIN handles, traffic class, context peers and flush QP
dhanavikram Oct 27, 2026
fb4fe75
test(rccl): count WQE reports, interleave four QPs and share the cloc…
dhanavikram Oct 27, 2026
d74a105
Merge users/dhanavikram/net-ib-resiliency-host-tests: check the RTR r…
dhanavikram Oct 27, 2026
1cb8461
Merge users/dhanavikram/net-ib-resiliency-host-tests: develop with #1…
dhanavikram Oct 28, 2026
d363e6f
test(rccl): pin GIN context/flush arms and keep one copy of the WQE l…
dhanavikram Oct 28, 2026
294ad78
Merge users/dhanavikram/net-ib-resiliency-host-tests: give port recov…
dhanavikram Oct 28, 2026
7ee4c0a
test(rccl): restore develop's WQE latency unit tests and runner entry
dhanavikram Oct 28, 2026
7d2e9cd
Merge updated resiliency tests into gin and wqe latency tests
cursoragent Oct 29, 2026
f925744
Merge updated resiliency tests after rma_socket landing
cursoragent Oct 30, 2026
e10b447
Merge updated p2p_resiliency host tests into gin and wqe_lat_mon test…
dhanavikram Oct 31, 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
5 changes: 5 additions & 0 deletions projects/rccl/test/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1007,12 +1007,14 @@ function(rccl_define_micro_source_lists)
transport/net_ib/common-test.cc
transport/net_ib/connect-test.cc
transport/net_ib/gdr-test.cc
transport/net_ib/gin-test.cc
transport/net_ib/init-test.cc
transport/net_ib/net-ib-gid-inspect-test.cc
transport/net_ib/p2p-test.cc
transport/net_ib/p2p-resiliency-test.cc
transport/net_ib/p2p-resiliency-recovery-test.cc
transport/net_ib/reg-test.cc
transport/net_ib/wqe-lat-mon-test.cc
transport/rma-socket-test.cc
transport/rma-socket-mem-test.cc
transport/rma-socket-progress-recver-test.cc
Expand All @@ -1025,6 +1027,7 @@ function(rccl_define_micro_source_lists)
fakes/hsa_fakes.cc
fakes/ibv_ops_fakes.cc
fakes/ibvwrap_fakes.cc
fakes/libc_fakes.cc
fakes/mlx5dvwrap_fakes.cc
fakes/nccl_fakes.cc
fakes/os_fakes.cc
Expand Down Expand Up @@ -2344,13 +2347,15 @@ rccl_add_micro_binary(rccl-UnitTestsMicroTransport
# graph/connect.cc and diagnostics/p2p.cc keep the original basenames.
NET_IB_CONNECT_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/connect_tmp.cc"
NET_IB_GDR_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/gdr.cc"
NET_IB_GIN_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/gin_tmp.cc"
# Hipify renames this to *_tmp.cc: src/init.cc keeps the basename.
NET_IB_INIT_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/init_tmp.cc"
NET_IB_GID_INSPECT_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/net_ib_gid_inspect.cc"
NET_IB_P2P_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/p2p_tmp.cc"
NET_IB_P2P_RESILIENCY_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/p2p_resiliency.cc"
NET_IB_P2P_RESILIENCY_RECOVERY_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/p2p_resiliency_recovery.cc"
NET_IB_REG_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/reg.cc"
NET_IB_WQE_LAT_MON_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/net_ib/wqe_lat_mon.cc"
RMA_SOCKET_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/rma_socket.cc"
RMA_SOCKET_MEM_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/rma_socket_mem.cc"
RMA_SOCKET_PROGRESS_RECVER_CC_PATH="${RCCL_HOST_HIPIFY_DIR}/src/transport/rma_socket_progress_recver.cc"
Expand Down
7 changes: 6 additions & 1 deletion projects/rccl/test/host/MICROTEST_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,13 @@ export colliding non-`static` symbols; otherwise a unit needs its own binary:
suites `NetIbInitMicrotest.*`.
- `net_ib/reg.cc` (`NET_IB_REG_CC_PATH`, from `net_ib/reg-test.cc`);
suites `NetIbRegMicrotest.*`.
- `net_ib/gin.cc` (`NET_IB_GIN_CC_PATH`, from `net_ib/gin-test.cc`);
suites `NetIbGinMicrotest.*`.
- `net_ib/gdr.cc` (`NET_IB_GDR_CC_PATH`, from `net_ib/gdr-test.cc`);
suites `NetIbGdrMicrotest.*`.
- `net_ib/wqe_lat_mon.cc` and `net_ib/wqe_lat_mon.h`
(`NET_IB_WQE_LAT_MON_CC_PATH`, from `net_ib/wqe-lat-mon-test.cc`);
suites `NetIbWqeLatMonMicrotest.*`.
- `net_ib/net_ib_gid_inspect.cc` (`NET_IB_GID_INSPECT_CC_PATH`, from
`net_ib/net-ib-gid-inspect-test.cc`); suites
`NetIbGidInspectMicrotest.*`.
Expand Down Expand Up @@ -790,7 +795,7 @@ symbol.
| `src/transport/p2p.cc` shareable-buffer entry points (`rccl-UnitTestsMicroDiagnostics`) | `fakes/transport_p2p_fakes.cc` |
| selected entry points from `src/{transport,proxy}.cc`, `src/transport/{generic,coll_net,net,nvls}.cc`, `src/{graph/paths,tuning/tuning,plugin/net}.cc` (targets that do not compile the real files) | `fakes/transport_stubs.cc` |
| libc (`gethostname`, `dladdr`), process-wide for units linking libc directly | `fakes/libc_interposers.cc` |
| libc macro-renamed in one unit via `fakes/libc_seam.h` (sockets/stdio/exit for `ras/client.cc` and `ras/client_support.cc`; `gethostname`/`access` for `diagnostics/ib_write_bw.cc`; heap for `graph/rccl_graph_gen.cc`) | `fakes/libc_fakes.cc` |
| libc macro-renamed in one unit via `fakes/libc_seam.h` (sockets/stdio/exit for `ras/client.cc` and `ras/client_support.cc`; `gethostname`/`access` for `diagnostics/ib_write_bw.cc`; heap for `graph/rccl_graph_gen.cc`; `clock_gettime` for `transport/net_ib/wqe_lat_mon.cc` and `transport/net_ib_cast/scheduler.cc`) | `fakes/libc_fakes.cc` |
| reusable RAS poll-entry, message, and diagnostics-context seams | `fakes/ras_fakes.cc` |
| core/lifecycle floor + data symbols | `fakes/nccl_stubs.cc` |
| reusable `nccl*` seams | `fakes/nccl_fakes.cc` |
Expand Down
5 changes: 5 additions & 0 deletions projects/rccl/test/host/fakes/libc_fakes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ static int DefaultGethostname(char* name, size_t len) { return ::gethostname(nam

static int DefaultAccess(const char* path, int mode) { return ::access(path, mode); }

static int DefaultClockGettime(clockid_t clock, struct timespec* ts) { return ::clock_gettime(clock, ts); }
Comment thread
dhanavikram marked this conversation as resolved.
Resolved

static void* DefaultMalloc(size_t size) { return std::malloc(size); }

static void* DefaultCalloc(size_t nmemb, size_t size) { return std::calloc(nmemb, size); }
Expand Down Expand Up @@ -310,6 +312,7 @@ std::function<void(const char*)> g_perror = DefaultPerror;
std::function<void(int)> g_exit = DefaultExit;
std::function<int(char*, size_t)> g_gethostname = DefaultGethostname;
std::function<int(const char*, int)> g_access = DefaultAccess;
std::function<int(clockid_t, struct timespec*)> g_clockGettime = DefaultClockGettime;
std::function<void*(size_t)> g_malloc = DefaultMalloc;
std::function<void*(size_t, size_t)> g_calloc = DefaultCalloc;
std::function<void(void*)> g_free = DefaultFree;
Expand Down Expand Up @@ -361,6 +364,7 @@ void ResetLibcFakes() {
g_exit = DefaultExit;
g_gethostname = DefaultGethostname;
g_access = DefaultAccess;
g_clockGettime = DefaultClockGettime;
g_malloc = DefaultMalloc;
g_calloc = DefaultCalloc;
g_free = DefaultFree;
Expand Down Expand Up @@ -456,6 +460,7 @@ int micro_fflush(FILE* stream) { return g_fflush(stream); }
void micro_perror(const char* prefix) { g_perror(prefix); }
int micro_gethostname(char* name, size_t len) { return g_gethostname(name, len); }
int micro_access(const char* path, int mode) { return g_access(path, mode); }
int micro_clock_gettime(clockid_t clock, struct timespec* ts) { return g_clockGettime(clock, ts); }
void* micro_malloc(size_t size) { return g_malloc(size); }
void* micro_calloc(size_t nmemb, size_t size) { return g_calloc(nmemb, size); }
void micro_free(void* ptr) { g_free(ptr); }
Expand Down
2 changes: 2 additions & 0 deletions projects/rccl/test/host/fakes/libc_fakes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>

#include <cstddef>
#include <cstdio>
Expand Down Expand Up @@ -106,6 +107,7 @@ extern std::function<void(const char*)> g_perror;
extern std::function<void(int)> g_exit;
extern std::function<int(char*, size_t)> g_gethostname;
extern std::function<int(const char*, int)> g_access;
extern std::function<int(clockid_t, struct timespec*)> g_clockGettime;

// Fail an allocation for one case with a hook returning nullptr; g_freedPointers
// then shows whether the unit released what it had already taken on the way out.
Expand Down
5 changes: 5 additions & 0 deletions projects/rccl/test/host/fakes/libc_seam.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// it changes nothing. free() is seamed too so a test can assert the failing
// path released what it had already taken.
//
// clock_gettime is seamed so a unit's elapsed-time arithmetic sees exact values; its default reads the real clock.
//
// fprintf is seamed but not swappable per test: it always forwards to the real vfprintf so stderr output still
// happens, and only records the call count and the FILE* argument, never the formatted text.

Expand All @@ -40,6 +42,7 @@
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>

#include <cstdio>
Expand Down Expand Up @@ -72,6 +75,7 @@ void micro_free(void*);
int micro_fprintf(FILE*, const char*, ...) __attribute__((format(printf, 2, 3)));
int micro_gethostname(char*, size_t);
int micro_access(const char*, int);
int micro_clock_gettime(clockid_t, struct timespec*);
} // extern "C"

#define write micro_write
Expand Down Expand Up @@ -100,3 +104,4 @@ int micro_access(const char*, int);
#define fprintf micro_fprintf
#define gethostname micro_gethostname
#define access micro_access
#define clock_gettime micro_clock_gettime
1 change: 1 addition & 0 deletions projects/rccl/test/host/fakes/libc_seam_undef.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// real libc again; a test that wants a seamed call can name micro_* directly.
// No include guard on purpose: the push/pop pair is positional.

#undef clock_gettime
#undef access
#undef gethostname
#undef free
Expand Down
10 changes: 2 additions & 8 deletions projects/rccl/test/host/net-ib-cast-scheduler-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,9 @@

#include "fakes/param_redirect.h"

// The RTT bookkeeping reads CLOCK_MONOTONIC; route it through a hook so a sample's age is exact.
static std::function<int(clockid_t, struct timespec*)> g_schedClockGettime = ::clock_gettime;

#include "fakes/libc_seam.h"
#undef send // ncclIbRequest::send, not the socket call
#undef clock_gettime // this TU's hook wins over any libc_seam.h mapping
#define clock_gettime(clk, ts) g_schedClockGettime((clk), (ts))
#include NET_IB_CAST_SCHEDULER_CC_PATH
#undef clock_gettime
#include "fakes/libc_seam_undef.h"

extern struct ncclIbvSymbols ibvSymbols;
Expand Down Expand Up @@ -494,7 +488,7 @@ class NetIbCastSchedulerTxStatsMicrotest : public NetIbCastSchedulerTxMicrotest
remap_.tx.startTimeNs = 1000;
}
void SampleAt(uint64_t nowNs) {
ScopedHook clock(g_schedClockGettime, [nowNs](clockid_t clk, timespec* ts) {
ScopedHook clock(g_clockGettime, [nowNs](clockid_t clk, timespec* ts) {
EXPECT_EQ(clk, CLOCK_MONOTONIC);
ts->tv_sec = nowNs / NSEC_PER_SEC;
ts->tv_nsec = nowNs % NSEC_PER_SEC;
Expand Down Expand Up @@ -537,7 +531,7 @@ TEST_F(NetIbCastSchedulerTxStatsMicrotest, UpdateTxStats_UntimedSampleOrClockFai
EXPECT_EQ(stats().numMeasurements, 0u);

remap_.tx.startTimeNs = 1000;
ScopedHook clock(g_schedClockGettime, [](clockid_t, timespec*) { return -1; });
ScopedHook clock(g_clockGettime, [](clockid_t, timespec*) { return -1; });
IbCastQpSchedUpdateTxStats(&remap_, &base());
EXPECT_EQ(stats().numMeasurements, 0u);
}
Expand Down
Loading
Loading