Commit 5178686
[cco] Bind the calling thread to its GPU's NUMA node
BindCallingThreadToGpuNumaOnce() has existed since the shmem NUMA-affinity work,
and src/shmem/init.cpp:746 was its ONLY caller -- described there as "the single
bind site for the shmem/EP path". A job that used CCO instead of shmem, which is
every EP v2 job, ran completely unbound. ccoCommCreateImpl now calls it, at the
top, before the bootstrap and Context and any worker thread, since new threads
inherit the affinity. The caller has already hipSetDevice()'d -- the same
contract step 2 relies on when it caches comm->hipDev.
This is the cause of the bistable slow regime in docs/EP_INTERNODE_V2_TAIL.md.
Unbound, the scheduler can place two of the eight per-node ranks on the two SMT
siblings of one physical core (2 sockets x 96 cores, sibling of c is c+192), and
both then run at about half speed. Measured as an exact 2x on the host loop of
the affected ranks -- hdis 16 -> 30us, hcom 27 -> 50us -- and no change on the
others. That ~36us matches the measured 35-40us phase offset, and reaches the
peer through the 1:1 host-delay-to-peer-wait transfer already documented: the
late ranks stall their node's intra-node barrier, and the peer node then waits at
the cross-node rendezvous.
Eight runs each at 4 tokens, MORI_IGNORE_CPU_AFFINITY=1 as the control:
unbound bound
median total 88.0us 84.8us
worst total 126.0us 97.4us
runs with a doubled rank 1/4 0/8
It also improves the aligned case (median hwal 74.5 -> 72.8), which is the
cross-socket cost going away.
Consequence to act on: every EP v2 measurement against v1/shmem so far was made
across this difference, because the v1 harness calls
shmem_torch_process_group_init and was bound while the v2 path was not. The
"v2 degrades ~3x further than #625" result needs re-running before it means
anything.
Eight clean runs do not prove a zero residual rate -- the bind confines four
ranks to one socket's 192 CPUs, so a collision is unlikely, not impossible.
Internode correctness 30/30, 0 of 16 ranks disagreeing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f60256c commit 5178686
2 files changed
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
336 | 387 | | |
337 | 388 | | |
338 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
425 | 446 | | |
426 | 447 | | |
427 | 448 | | |
| |||
0 commit comments