Skip to content

gpu-gates: link_probe, the protocol probe of dgx-spark.md 8.9 step 2 (N nodes from the command line, one stage) - #44

Merged
midagedev merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-p5-probe
Oct 12, 2026
Merged

midagedev merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-p5-probe

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Part of #13. This adds link_probe, the protocol probe that section 8.9 of docs/contrib/dgx-spark.md asks a
contributor to run first: it carries the host tier's word protocol between nodes over RDMA, times one round trip a
generation and counts the lines that are stale after their flag. On two DGX Sparks with one direct cable the round
trip p50 is 29.76..30.27 µs with no stale line, so 8.9's rule keeps option (a), and a stream wait on a host page that
the NIC writes works on GB10 (the 8.10 question); it adds no engine code and changes none.

How the probe works

link_probe --nodes N --rank 0 --dev <ibdev> --gid <index> --listen <ip:port>
link_probe --nodes N --rank R --dev <ibdev> --gid <index> --stage <ip:port>
  [--iters 100000] [--warmup 1000] [--flag write|imm] [--deadline-ms 10000]

One process a node; rank 0 is the stage, ranks 1.. are peers. Each node registers one cuMemHostAlloc page
(PORTABLE | DEVICEMAP) with ibv_reg_mr for local and remote write, without relaxed ordering. The page holds the
16 KB image (256 lines of 64 bytes), 64 KB of rows (1024 lines) for each peer, a flag line after each region, and a
last line for the node's sent word.

In generation g the stage's kernel writes the image as g; its stream raises the image flag to g behind a system-scope
barrier and waits (CU_STREAM_MEM_OP_WAIT_VALUE_32, GEQ, through cuStreamBatchMemOp_v2) for every rows flag to reach
g. A pump thread on each node posts the RDMA writes, since the card cannot. A peer's stream waits for its image flag,
runs one kernel that counts the image lines not reading g and writes its rows as g, and raises its rows flag the same
way; its pump writes the rows back, and the stage's next kernel counts the stale rows lines. The pump raises the sent
word to g once it has reaped every write completion of generation g, and the batch that raises a node's own flag to g
ends with a wait for the sent word to reach g, so the next kernel writes the region only after the NIC is done with
it. --flag write (default) sends a region and its flag line in one write, flag last; --flag imm sends the region
as a write with immediate, and the receiving pump raises the flag from the completion. Each node sends its --flag
mode with its endpoint (the record's four spare bytes), and both ends refuse a mismatch by name before the first
generation.

The round trip of generation g runs from the end of the stage kernel that wrote image g to the start of the kernel the
rows wait released, read from %globaltimer. The stage prints one link line (percentiles, min, max and mean over
--iters after --warmup, both stale counts over every generation, each side's kernel p50) and fails on a stale line.

The card thread keeps at most 32 generations queued. With no progress for --deadline-ms it prints every flag word
and the sent word as the host reads them, which tells a wait that never passes from a write that never landed. Any
failure, the card thread's (a panic in its run included) or the pump's error, ends the same way: the pump stops, every word the stream waits on is raised
to the generation after the last one enqueued (the wait is cyclic, so u32::MAX would hold it, as
crates/gpu/src/host/lane.rs's release_waits documents), and the stream drains within one more deadline; if it is
not seen to drain, the process exits without teardown, since the device buffers' drops would wait on it. --iters plus --warmup
above 2^31 - 2 is refused, where that release would stop comparing as later than every wait.

libibverbs is loaded at run time (dlopen through libc, already a dependency of the gpu feature), so the
workspace takes no new crate and the build needs no rdma-core. crates/gpu-gates/src/bin/shared/verbs.rs mirrors the
structs the probe touches, with const asserts on each size and on the offset of every field the probe sets or reads,
which I checked against rdma-core 50.0's installed headers with a C program printing sizeof and offsetof.
ibv_post_send, ibv_post_recv and ibv_poll_cq are inline in the header, so the probe takes them from the
context's ops table as the header does. Queue pairs are RC over RoCE v2 at the GID index given. The device is opened
by name: a negative count from ibv_get_device_list and a name that is not listed are named errors (the second lists
the devices there are), and the first device with the name is the one opened. A write's kind carries its immediate
(WriteKind::{Plain, Imm(u32)}), so no write with immediate goes out without one.

tools/unsafe-ratchet.txt raises the gpu-gates pin from 61 to 120 blocks and from 5 to 26 fns with its PIN line
and a second one that derives the count on main's 61 5 1: 46 blocks for the verbs, 9 for CUDA calls and 4 for kernel
accesses; 19 unsafe extern "C" fn pointer types and two unsafe fns, the symbol lookup and the memory registration. tools/spawn-allow.txt names the probe's one thread. tools/recipes.py leaves link_probe out of
the kernel carriers by name (CARRIER_SKIP, next to SCAN_PACKAGE): its kernel is its own and no gate links it, so
scan-set does not list it and just narrow does not build it.

Code shape

  • No second copy. The probe's Page (link_probe.rs:958) does what MappedHost (crates/gpu/src/graph.rs:419)
    does, and its op_zero, op_wait_geq, op_write, op_barrier_sys and mem_batch (link_probe.rs:1022-1083) are
    graph.rs:555-632 with the probe's error type: a second copy under R14. Opening them is the gpu crate owner's
    call (both are pub(crate), and MappedHost's Sync argument covers the host tier's access pattern, not a page
    the NIC writes and a pump polls), so I left the engine crate alone here; the common entry follows in its own
    pull request (question 2).
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone.
  • No silent failure. Every verbs and driver call on the run path checks its result and names it, and so does
    every completion. Every wait is bounded, and a stall fails with the flag words. Teardown cannot return an error:
    Page's drop records a failed free on its context, and a failed verbs teardown call prints one line on stderr.
  • Comments state what is true now.
  • No relaxed gate. The unsafe pin rises for new code only, with its PIN(2026-10-11): line. The narrow
    self-test keeps main's cases. The scan-set self-test gains two checks: every kernel bin of gpu-gates that no
    gate links is named in CARRIER_SKIP, and every name there is such a bin, with a reason.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line): found and copied, not removed: crates/gpu/src/graph.rs:419 (MappedHost)
and crates/gpu/src/graph.rs:555-632 (the batch memop builders and mem_batch), as above.

Questions

  1. The libibverbs dependency (8.9, maintainers' item 5). Answered in review: verbs.rs stays in gpu-gates
    behind dlopen until a second user appears.
  2. The copies of MappedHost and the memop builders (R14). Answered in review: a common entry in bloomery_gpu,
    in its own pull request right after this one lands.
  3. Where the probe lives, and the narrow scan. Answered in review: link_probe stays in gpu-gates and is left
    out of the narrow carriers by a named line in recipes.py (above).
  4. A flag-mode mismatch. Answered in review: setup refuses it by name (above, and The final commit below).

What I ran

The commit is 54660338 on upstream main e8e32a38. The Mac checks below ran on it. The tables are from this pull
request's first posted build, c062a2f8 on aa6df234, with one local build setting (Hardware), the same sha256 on
both nodes. The review changes since then were checked on 54660338 with shorter runs on the same pair (The final
commit, below).

On a Mac:

just mac-static upstream/main
mac-static: fmt-check rc 0 in 3 s
mac-static: lint rc 0 in 1 s
mac-static: combos rc 0 in 2 s
mac-static: check-arch rc 0 in 7 s
mac-static: check-comments rc 0 in 6 s
mac-static: check-defaults rc 0 in 0 s
mac-static: check-levers rc 0 in 4 s
mac-static: check-loads rc 0 in 55 s
mac-static: check-ptx-names rc 0 in 0 s
mac-static: check-recipes rc 0 in 499 s
mac-static: check-rustflags rc 0 in 0 s
mac-static: check-unsafe rc 0 in 1 s
mac-static: check-waits rc 0 in 0 s
mac-static: ok
just affected upstream/main --no-box
affected: e8e32a38e..(working tree)
recipes:
BLOOMERY_CHECK_TARGET=aarch64-unknown-linux-gnu tools/mac-check.sh check
mac-check: check rc 0
python3 tools/recipes.py --self-test
self-test: ok (147 gate recipes, 0 failures)

Each mac-static line is cut after its time; lint and combos reused the ledger of an earlier run on the same tree.
The lint step counts 41 warnings, the ratchet's 41. just affected
selects 0 of 147 gate recipes and 0 of 7 weekly recipes for the 6 changed files and lists the two new files as read by
bin link_probe, which no gate builds. scan-set lists three bins (bloomery-serve-ds41, gate_kquant,
gate_swap), as on main. With the CARRIER_SKIP entry taken out, the self-test fails with scan-set: bin link_probe has kernels and no gate links it, and CARRIER_SKIP does not name it; naming gate_swap there, or a bin that does
not exist, fails it as well.

On two DGX Sparks (hardware below). Before the timed runs I wrote prediction cards in tools/ref/card.py format
(card.py check: ok, kind profile): λ_probe p50 in 29.5..32.5 µs and 0 stale lines. The λ band is the previous build's
p50 on this pair (29.82..29.98 µs) plus 0..2 µs for the sent-word wait, one satisfied memop a node [derived]; 8.9's
own band is 18..40 µs.

Step 1, fabric. One RoCE device a node, one direct cable, GID index 3 (RoCE v2), MTU 4096, both directions, with
ib_write_bw -d <dev> -x 3 -F -s 65536 -n 500000 -q 1 --report_gbits and ib_write_lat -d <dev> -x 3 -F -s <size> -n 100000:

A to B B to A 8.9 band
ib_write_bw 64 KB, Gb/s (3 runs) 109.24, 109.15, 109.21 109.30, 109.22, 109.26 92..109
ib_write_lat 16 KB, t_typical µs (2 runs) 4.85, 4.80 4.82, 4.82 4..10
ib_write_lat 64 KB, t_typical µs (2 runs) 8.99, 9.12 9.04, 8.98 8..14

ib_write_bw ran with PCIe relax order: ON, its default here, and ib_write_lat with OFF, so the bandwidth row is
not protocol-mode bandwidth (8.6, item 4). The 99th percentiles were 4.96..5.01 µs at 16 KB and 9.42..9.76 µs at 64 KB.
all_gather_perf ran on the same pair per the playbook: nccl-tests 2.19.7 built with MPI, NCCL 2.30.7 built from
source, OpenMPI 4.1.6 in a user prefix, NCCL pinned to the cabled device on each node with GID index 3, -b 8 -e 8G -f 2 -g 1 three times and -b 16G -e 16G -f 2 -g 1 once. At 8 GiB the busbw was 13.78..13.82 GB/s out of place and
13.91..13.92 GB/s in place, and 13.88 GB/s at 16 GiB, with no wrong results. NCCL reported NET/IB over RoCE with relaxed
ordering and GDR 0, so the transfer is staged through host memory. 13.8 GB/s is 110.5 Gb/s, within 1 % of this cable's
ib_write_bw above and about 0.1 GB/s over 8.9's 11.6..13.7 GB/s, whose top is 109.28 Gb/s divided by 8.

Step 2, the probe. Run on each host with LC_ALL=C, --gid 3, 100000 timed generations after 1000 warmup, each
role assignment and both flag modes; the first run of each series adds --deadline-ms 300000 for the module's first
load. Two series of six runs, back to back:

series stage on flag p50 µs p90 p99 p99.9 min max mean stage kernel p50 peer kernel p50 stale
1 A write 30.27 41.15 66.37 95.36 27.71 298.62 32.71 4.70 2.40 0
1 B write 29.95 31.74 45.41 78.82 24.90 436.86 30.69 4.96 2.40 0
1 A write 29.89 33.86 54.66 82.66 27.81 300.45 31.37 5.09 2.40 0
1 B write 29.95 30.30 33.18 66.85 27.87 435.46 30.12 4.90 2.43 0
1 A imm 29.82 30.14 32.32 58.30 27.74 238.69 29.95 5.06 2.40 0
1 B imm 29.89 30.21 32.29 65.41 27.74 248.99 30.03 4.96 2.46 0
2 A write 29.98 30.37 32.64 66.14 27.42 237.57 30.15 4.83 2.43 0
2 B write 29.92 30.24 32.29 45.89 26.75 91.49 29.96 4.96 2.43 0
2 A write 29.76 30.11 32.22 60.70 27.84 292.54 29.89 5.09 2.43 0
2 B write 29.92 30.24 32.32 46.56 27.30 94.11 29.93 4.99 2.50 0
2 A imm 29.89 30.24 32.29 58.82 27.65 287.07 30.07 4.90 2.34 0
2 B imm 29.92 30.24 32.83 61.66 27.62 447.36 30.09 4.93 2.46 0

One line, as the stage prints it:

link nodes=2 flag=write iters=100000 rtt_us_p50=29.76 rtt_us_p90=30.11 rtt_us_p99=32.22 rtt_us_p999=60.70 rtt_us_min=27.84 rtt_us_max=292.54 rtt_us_mean=29.89 stale_image=0 stale_rows=0 stage_kernel_us_p50=5.09 peer_kernel_us_p50=2.43 timer_gcd_ns=32
PASS: link_probe stale lines after the flag 0

Stale lines count every generation, warmup included: per run 25.9 M image lines and 103.4 M rows lines. Three write
runs of series 1 had a heavier tail (p99 45..66 µs), against 32.2..32.8 µs everywhere else. They overlapped the hourly update check of the DGX Dashboard, which runs mstflint -d 0000:01:00.0 q (a read-only
ConnectX firmware query) every 1 to 3 s for about 40 s on each Spark. Repeating that query by hand during a run raised
p99 from 32.1..32.6 µs to 42.4..42.9 µs, from either node, with p50 unchanged and no stale line; a container start
right before a series and the check's CPU-bound apt steps left the tail at 32.2..32.5 µs.
The build before the sent word, six runs with the same flags on the same pair, had p50 29.82..29.98 µs and p99
32.1..40.2 µs, so the sent wait moves p50 by under 0.3 µs.
Before and after every run on both nodes: no Xid in the kernel log, no container and no GPU compute process; the SM
clock read 208 MHz idle and 2411..2502 MHz after runs (maximum 3003).

Against 8.9's rule: λ_probe p50 is 29.76..30.27 µs, at most 40 µs, so (a) holds as predicted, and by 8.9's arithmetic
the engine's λ is 37..60 µs [derived]. Stale lines are 0, so write mode stands; the imm runs only exercise that code
path. On 8.10's question, the stream wait on a cuMemHostAlloc page that the NIC writes works on GB10,
issued as CU_STREAM_MEM_OP_WAIT_VALUE_32 through cuStreamBatchMemOp_v2, the batch form of cuStreamWaitValue32.

The stale check has a floor: a receiving kernel starts only after its wait passed and its launch ran, so a data line
landing later than the flag by less than that gap reads as current. To see that it counts at all, I ran it once
against a local change, not committed, that skips line 0 of what the kernel writes at generation 500 on both nodes,
with the expectation written down first (one stale line each way, the stage failing):

link nodes=2 flag=write iters=10000 rtt_us_p50=29.89 rtt_us_p90=30.24 rtt_us_p99=33.89 rtt_us_p999=57.44 rtt_us_min=28.13 rtt_us_max=103.78 rtt_us_mean=30.05 stale_image=1 stale_rows=1 stage_kernel_us_p50=4.93 peer_kernel_us_p50=2.50 timer_gcd_ns=32
link peer rank=1 stale_image=1
FAIL: link_probe stale lines after the flag 2
link_probe: stale lines after the flag

The stage exited with rc 1 and the peer with rc 0.

The stall path. Two nodes with different --iters give a stall without any other fault: the side with more
generations waits for one the other side never sends. --flag write --deadline-ms 5000, on the final commit:

--- stage --iters 1000, peer --iters 2000; the peer:
link_probe: pump: no progress for 5s: posted 2000 of 3000, 0 writes unacknowledged, received 0 of 0, own flag 2000; card: rank 1: no progress for 5s at generation 2001: flag[0]=2000 flag[1]=2000 sent=2000 (host reads; the stream waits on flag[0] and sent); stream drained after release: true
--- and the stage, waiting for the peer's report:
link_probe: rank 1's report: failed to fill whole buffer
--- stage --iters 2000, peer --iters 1000; the stage:
link_probe: card: rank 0: no progress for 5s at generation 2001: flag[0]=2001 flag[1]=2000 sent=2001 (host reads; the stream waits on every rows flag and sent); stream drained after release: true

The stalled side exits with rc 1 within a second after its deadline (the peer 5.6 s after its start; the stage 7.9 s,
having started 2 s earlier). In the first case the stage then fails on the closed connection with rc 1; in the second
the peer finishes its 2000 generations and exits with rc 0. No probe process is left. A pump failing first did not
come up on hardware.

The final commit. 54660338 built as in Hardware, the same sha256 on both nodes, stage on A, 20000 timed
generations after 1000 warmup. These are behavior checks, not measurements (no card):

link nodes=2 flag=write iters=20000 rtt_us_p50=29.86 rtt_us_p90=30.21 rtt_us_p99=32.16 rtt_us_p999=54.62 rtt_us_min=28.03 rtt_us_max=103.94 rtt_us_mean=29.92 stale_image=0 stale_rows=0 stage_kernel_us_p50=5.02 peer_kernel_us_p50=2.40 timer_gcd_ns=32
PASS: link_probe stale lines after the flag 0
link nodes=2 flag=imm iters=20000 rtt_us_p50=29.92 rtt_us_p90=30.27 rtt_us_p99=32.38 rtt_us_p999=55.01 rtt_us_min=27.84 rtt_us_max=106.40 rtt_us_mean=30.07 stale_image=0 stale_rows=0 stage_kernel_us_p50=4.93 peer_kernel_us_p50=2.40 timer_gcd_ns=32
PASS: link_probe stale lines after the flag 0

A flag-mode mismatch is refused at setup on both ends, either way round, with rc 1, before any setup line (the peer
in 0.5 s, the stage 2.7 s after its earlier start):

link_probe: flag mode differs: rank 0 write, rank 1 imm
link_probe: flag mode differs: rank 0 imm, rank 1 write

The mode travels as 1 (write) or 2 (imm) in the endpoint record's last four bytes; any other word, 0 included, is
rank N sent flag mode M. With three or more nodes, the stage stops at the first peer whose mode differs, so a peer
whose mode matches ends on the closed connection instead. --dev nosuchdev fails at setup with
link_probe: no RDMA device nosuchdev; devices: rocep1s0f0, rocep1s0f1, roceP2p1s0f0, roceP2p1s0f1.

Scope: the final build ran on one pair, the twelve runs above plus the stall and stale checks. Over the 34 completed
timed runs of five builds on that pair, and 4 runs of an earlier build on a second pair, no wait stalled and no line
was stale. With two nodes each stream waits twice a generation, once on the other side's flag and once on its sent word.
N > 2 ran only as a code path check: three or four nodes cannot reach one stage port on a switchless ring, since
the probe opens one device a node and each port cables to one neighbour. With the stage on one node and two or three
peer processes on the other, over the same cable, --nodes 3 and 4 passed in both flag modes with no stale line;
their round trip (p50 192 and 277 µs) is the peers sharing one GPU, not λ_fanout. 8.9's next step, the single-node
sustained BW term, is not run here. I could not run the gates; just affected selects none, and the gate batch is yours.

What I ran into

  1. The consumer kernel set λ. With each thread reading and writing whole lines, the peer kernel took 11.9..13.8 µs
    and λ_probe p50 43.5..44.7 µs. Word by word across the block both ways gave 9.3..9.5 µs and a p50 of 40.8..41.5 µs
    on this pair (33.2..33.6 µs in three runs and 41.5 µs in one on a second pair). The committed kernel reads whole
    lines a thread (16 independent loads) and writes word by word: 2.3..2.5 µs. For the engine's copy nodes on GB10 this
    suggests that reads of a mapped host page are latency bound unless a thread keeps several loads in flight
    [derived from these runs; not measured on its own].
  2. Receives posted before the queue pair leaves RESET. In imm mode ibv_post_recv failed with EINVAL (rc 22)
    when the receives went in right after the queue pairs were created. They are now posted once the queue pair reaches
    RTS, before the start signal.
  3. Doc lines this answers. I left the doc alone; 8.10's [unverified] on a stream wait on a NIC-written page and
    its "a latency for a direct link" now have a reading here.

Hardware (if the change is for a machine)

Two DGX Sparks, one direct cable between one ConnectX-7 port on each, one rail. On both: nvidia-smi --query-gpu=name,driver_version prints NVIDIA GB10, 595.84; CPU 20 cores (10 Cortex-X925 and 10 Cortex-A725);
MemTotal 127535276 kB and 127535272 kB; Ubuntu 24.04.5 LTS, kernel 6.17.0-1032-nvidia; ConnectX-7 firmware
28.45.4028; Ubuntu's rdma-core and libibverbs 50.0-2ubuntu0.2 and perftest 24.01.0+0.38-1build2. RoCE v2, MTU 4096.
The probe was built in the project's dev container (CUDA 13.3.1) with cargo oxide build --arch sm_86 -- -p bloomery-gpu-gates --features gpu --release --bin link_probe (the PTX JIT compiles on GB10) and run on the host. For the
tables' build (c062a2f8, before main's per-triple table) the tree's .cargo/cuda-oxide.toml had target-cpu=native
in place of znver3, which crashes rustc on aarch64; that was its only local change. 54660338 was built with no
local change, with cargo-oxide installed from the pinned rev 87bc9518, which takes the aarch64-unknown-linux-gnu
table (target-cpu=native), and CUDA_OXIDE_BACKEND pointing at a backend built from the same pin.

@midagedev

Copy link
Copy Markdown
Owner

Thanks — the 29.76..30.27 µs p50 with no stale line answers 8.9 and 8.10 nicely. This is a bigger review (two new files, the unsafe ratchet), so it comes after the 0.3.0 tag tonight; I will post the review here.

@midagedev

Copy link
Copy Markdown
Owner

Review done. This can land after a few changes.

The CI red is ours, not yours: the lease self-test failure was fixed on main in df872d5. A rebase onto main should clear it.

Asks:

  1. Rebase onto main (23ee210 or later).
  2. tools/unsafe-ratchet.txt: add one derivation line for the new count (verbs entries + CUDA calls + kernel accesses).
  3. shared/verbs.rs open_by_name: usize::try_from(n).unwrap_or(0) turns a negative device count into "no devices". Please return a named error (no silent failure).
  4. open_by_name: a second device with the same name overwrites ctx and leaks the first one. Stop after the first open.
  5. shared/verbs.rs (~746): imm.unwrap_or(0) posts a zero immediate when the mode has none. Make the mode carry the immediate, or error on the mismatch.
  6. link_probe.rs module doc: say that its numbers are contributor evidence (CONTRIBUTING.md list) and not table numbers, since no lease runner runs it.
  7. link_probe.rs (~508): process::exit(1) skips teardown. Please confirm that only the stuck-stream path reaches it.

Keeping verbs.rs in gpu-gates behind dlopen is fine for now. It can move to its own crate when a second user appears.

@juliankang4

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. All seven are in c5ae528a, and the body's "What I ran" now has the final commit's checks.

  1. Rebased onto e8e32a38, no conflicts. Main's gpu-gates count is still 61 5 1, so the pin stays 120 26 1.

  2. The ratchet has the derivation as its own line: # PIN(2026-10-11): on main's 61 5 1: 61 + 46 verbs (...) + 9 CUDA (...) + 4 kernel accesses = 120 blocks, 5 + 19 fn pointer types + 2 unsafe fns = 26 fns. Of the 46 verbs blocks, 45 are in verbs.rs and one is the probe's call of the registration in link_probe.rs.

  3. A negative count from ibv_get_device_list is now ibv_get_device_list returned a device count of {n}, returned after the list is freed (verbs.rs:582).

  4. The lookup returns at the first device with the name: its context, or ibv_open_device {name} failed: <errno>. A name that is not listed fails with no RDMA device {name}; devices: ..., which I checked with --dev nosuchdev on the pair.

  5. post_write takes WriteKind::{Plain, Imm(u32)}, so the immediate comes with the kind and imm mode cannot post a write without one. The pump picks Imm(g) in imm mode (link_probe.rs:879).

  6. The module doc now ends with "No lease runner runs this probe, so its numbers are contributor evidence (the list in CONTRIBUTING.md), never numbers for our tables."

  7. Not only the stuck stream. exit(1) (link_probe.rs:501) runs when the card thread failed and its release cannot show that the stream drained:

    • the release's end event cannot be created, recorded or queried (:806, :808, :819). Apart from a fault of its own, this is where a sticky context error from an earlier fault would show up;
    • the event does not complete within one more deadline (:818), which is the stuck stream;
    • the card thread panics outside its guarded run (:442), which leaves only the release itself.

    A panic inside the run is caught (catch_unwind, :679) and goes through the release like any other failure. A pump error, once the release has seen the stream drain, returns an error and tears down normally. That last message is now written with writeln! and its result ignored, since eprintln! panics when stderr fails and the unwind would drop the buffers the exit is there to leave alone.

On the questions: 1 is answered by your note on verbs.rs. 2 to 4 are still open.

@midagedev

Copy link
Copy Markdown
Owner

Thanks, all seven are fine. On your questions:

  1. Common entry, yes: open MappedHost and the memop builders in bloomery_gpu and drop the probe's copies. Please do it as a follow-up PR right after this one lands, so this one stays free of engine code. Until then the copy is a named exception.
  2. Leave link_probe out of the narrow carriers, with a named exclusion line in recipes.py (the probe's kernel is its own and no gate links it). Every just narrow should not build it. No gate recipe for now.
  3. Yes, please refuse a flag-mode mismatch at setup by name. It is small, so it can go in this PR.

When CI is green after that, I will run the gates on our box and merge.

…(N nodes from the command line, one stage)

The stage's kernel writes a 16 KB image of generation-stamped 64-byte lines into a cuMemHostAlloc page registered with
ibv_reg_mr without relaxed ordering, its stream raises the flag behind a system-scope barrier, and a pump thread posts
one RDMA write a peer. Each peer's stream waits on its own page (WAIT_VALUE_32 GEQ), runs one kernel that counts the
stale image lines and writes 64 KB of rows, and its pump writes them back; the stage's stream wait passes. A node writes
its send region again only after its pump reaped that generation's write completions: the pump raises a sent word on the
page, and the batch that raises the node's flag ends with a wait on it. The stage reads the round trip from %globaltimer
and prints p50, p90, p99, p99.9, min, max and the stale lines of both directions, and fails on a stale line. --flag imm
sends write-with-immediate and lets the receiving pump raise the flag. Every node sends its --flag mode with its
endpoint, and setup refuses a mismatch on both ends by name. Every wait is bounded by --deadline-ms: a stall prints each
flag and the sent word as the host reads them. Any failure, the card thread's (a panic included) or the pump's error,
stops the pump, raises every word the stream waits on past the last generation enqueued and drains the stream within one
more deadline, or ends the process without teardown when the stream is not seen to drain. No lease runner runs the
probe, so its numbers are contributor evidence, not table numbers.

libibverbs is loaded at run time (dlopen through libc, already a gpu dependency), so the workspace takes no new crate
and builds without rdma-core; shared/verbs.rs mirrors the ABI structs it touches, with each size and the offset of every
field it sets or reads pinned by a const assert, and reads the inline post_send, post_recv and poll_cq entries from the
context's ops table. The unsafe pin of gpu-gates rises with its PIN line and the count's derivation (verbs, CUDA calls,
kernel accesses), tools/spawn-allow.txt names the probe's one thread, and tools/recipes.py leaves link_probe out of the
kernel carriers by name (CARRIER_SKIP: the probe's kernel is its own and no gate links it), so no scan set builds it;
its self-test fails on a kernel bin no gate links that the table does not name, and on an entry that names a linked bin
or none.
@juliankang4

Copy link
Copy Markdown
Collaborator Author

Both are in 54660338, on the same base, e8e32a38. The body's "What I ran" has this commit's checks.

  1. Done. link_probe is left out of the kernel carriers by name: CARRIER_SKIP in tools/recipes.py, next to SCAN_PACKAGE, with your reason. scan-set no longer lists it and just narrow never builds it, and the narrow self-test is back to main's text. The scan-set self-test now also fails on a kernel bin that no gate links and the table does not name, and on an entry that names a linked bin or no bin.
  2. Done. Each node sends its --flag mode in the endpoint record's four spare bytes, as 1 for write and 2 for imm, so a zero or any other word is refused as rank N sent flag mode M. Both ends refuse a mismatch before the first generation with link_probe: flag mode differs: rank 0 write, rank 1 imm (rc 1). On the pair, in both directions, the peer exited in about half a second and the stage right after. This pair used to run until the deadline and end as a stall.

The body's stall example used that mismatch, so it now uses different --iters on the two nodes, which stalls whichever side has more generations. While doing that I named the stage's read of a peer's report: a peer that exits first used to leave the stage with a bare failed to fill whole buffer, which now reads rank 1's report: failed to fill whole buffer.

The body also closes three open points from the first round. The heavier tail in series 1 lines up with the DGX Dashboard's hourly firmware query, and repeating that query by hand reproduces it. N > 2 was only checked as a code path, since this ring has no switch. And the all_gather line now gives the real reason it did not run.

Q2: I will open the common-entry pull request once this one lands.

@midagedev

Copy link
Copy Markdown
Owner

Thanks, both look right. I will run the box gates after our two landings that are in flight, then merge. If CI goes red in check-recipes again, it is our own self-test flake. The fix is in the second landing.

@midagedev
midagedev merged commit de57867 into midagedev:main Oct 12, 2026
1 check passed
@midagedev

Copy link
Copy Markdown
Owner

Merged as de57867. Thanks. Its diff is the same patch as your branch (patch-id checked on top of our train).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu The card engine: crates/gpu*, crates/app tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants