Skip to content

CollectiveX: run b300 EP16 over EFA with a faster aws-ofi-nccl / CollectiveX:在 EFA 上运行 b300 EP16 并使用更快的 aws-ofi-nccl - #3872

Merged
Oseltamivir merged 4 commits into
mainfrom
cx-b300-ep16
Oct 14, 2026
Merged

Oseltamivir merged 4 commits into
mainfrom
cx-b300-ep16

Conversation

@Oseltamivir

@Oseltamivir Oseltamivir commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

b300 (AWS p6-b300, EFA) EP16 was blocked: first by missing gdrcopy, then (once gdrcopy was installed) by NCCL choosing the wrong GIN backend. This PR enables EP16 for nccl-ep and deepep-v2 on b300 and moves the pool onto a faster aws-ofi-nccl.

1. Make EP16 run (2439a6055)

  • GIN backend: with gdrcopy present, the aws-ofi-nccl GIN plugin loads, but NCCL 2.30 still prefers its built-in GDAKI on the nodes' two ConnectX-7 IB ports, which are not the GPU fabric. Most ranks then fail window registration (error 6) and the rest hang. The EFA profile now pins NCCL_GIN_TYPE=2, so GIN uses the plugin's proxy.
  • deepep-v2 SM sizing: get_theoretical_num_sms raised ZeroDivisionError on EFA. DeepEP reads the scale-out rate from ibstat, which cannot see EFA devices and returns 0. A new network.rdma_gbs registry field (b300: 100 GB/s per GPU, i.e. 16 × 400 Gb/s per node across 8 GPUs) is passed through as rdma_gbs=.
  • Registry: b300 nccl-ep and deepep-v2 go from [8] to [8, 16].

2. Faster proxy (1dcd5df2e)

  • Why: the hosts mount aws-ofi-nccl 1.20. Its proxy thread applies every GIN signal with an inline gdrcopy read-modify-write of device memory, which 1.21 moves to a worker thread (aws-ofi-nccl a698b6e, dea6e05).
  • What: multi-node EFA shards build 1.21.1 into the shared backend cache, from the hash-pinned release tarball, against the host libfabric. The EFA profile then loads it (net and tuner) in place of the host copy. The build runs once per cache, about a minute.
  • Download: each fetch attempt is bounded (30 s to connect, 300 s in total) so --retry can recover from a stalled transfer instead of hanging backend preparation.

Results

Two-node b300 runs through the real launcher; every row below passed the oracle. Values are period p50.

bf16 EP16 host 1.20 built 1.21.1
deepep-v2 decode, T=1 / T=512 1825 / 3048 µs 1011 / 2335 µs
nccl-ep decode, T=1 / T=512 387 / 5146 µs 298 / 1576 µs
deepep-v2 prefill, T=8192 27.6 ms 24.4 ms
nccl-ep prefill, T=8192 72 ms 15.9 ms

Knobs that had no effect: OFI_NCCL_GIN_STRONG_SIGNAL=0, OFI_NCCL_GIN_CQ_PROCESS_MAX_ITER, NCCL_GIN_PROXY_NTHREADS (NCCL 2.30.4 does not read it) and NCCL_GIN_NCONNECTIONS=4.

Caveat: these rows are still far behind IB pools

  • The network is not the cause. An 8-byte NCCL round trip over EFA is 66 µs.
  • The CPU proxy is. Every GPU-issued put and signal crosses it, which sets a latency floor at small T and an operation-rate cap at large T. deepep-v2 prefill reaches about 7 GB/s per GPU against roughly 100 GB/s of line rate.
  • The fix needs a host upgrade. GPU-initiated GIN on EFA requires EFA installer 1.50.0 on the hosts (efa.ko 3.3.0 completion counters, libfabric 2.6), plus NCCL ≥ 2.31 with NCCL_GIN_TYPE=5. The hosts run efa.ko 3.1.0g, and a container cannot supply the kernel module. Published third-party numbers for that stack on p6-b300 show DeepEP V2 decode at 118/168 µs (whn09/ep-benchmarks-efa).
  • Other observations:
    • One deepep-v2 prefill run hit an EFA Internal queue pair error (local) on one rank and timed out; the rerun was clean.
    • The nccl-ep decode case on host 1.20 took about 28 minutes, which fits inside the 5400 s per-case guard.

Please decide whether b300 EP16 rows should publish now or wait for the host upgrade.

Validation

Hand-driven launch_single-slurm.sh on b300 covered:

  • The full nccl-ep and deepep-v2 bf16 decode and prefill cases at EP16 (with NCCL_GIN_TYPE and rdma_gbs).
  • Trimmed decode and prefill shards for each variant above.
  • A cold-cache run of this branch: the first node built the plugin, the second reused it under the lock, and the numbers matched the hand-built plugin.
AI model disclosure
  • Claude Opus 5.5 (claude-opus-5-5, run through Claude Code): the rebase onto main, the download-timeout fix and this description (2026-10-14).
  • The earlier commits were prepared with Claude in Claude Code in previous sessions; their exact model id could not be verified.
中文

摘要

b300(AWS p6-b300,EFA)的 EP16 此前被阻塞:先是缺少 gdrcopy,安装 gdrcopy 之后又因为 NCCL 选错了 GIN 后端。本 PR 为 b300 上的 nccl-ep 和 deepep-v2 启用 EP16,并让该资源池使用更快的 aws-ofi-nccl。

1. 让 EP16 跑起来(2439a6055)

  • GIN 后端: 有了 gdrcopy 之后,aws-ofi-nccl 的 GIN 插件可以加载,但 NCCL 2.30 仍优先选择其内置的 GDAKI,并使用节点上两个并非 GPU 网络的 ConnectX-7 IB 端口;多数 rank 在窗口注册时失败(error 6),其余 rank 挂起。EFA 配置现在固定 NCCL_GIN_TYPE=2,让 GIN 使用插件的代理。
  • deepep-v2 的 SM 数量: get_theoretical_num_sms 在 EFA 上抛出 ZeroDivisionError,因为 DeepEP 从 ibstat 读取 scale-out 速率,而 ibstat 看不到 EFA 设备、返回 0。新增注册表字段 network.rdma_gbs(b300:每 GPU 100 GB/s,即每节点 16 × 400 Gb/s 分给 8 个 GPU),以 rdma_gbs= 传入。
  • 注册表: b300 的 nccl-ep 和 deepep-v2 从 [8] 改为 [8, 16]。

2. 更快的代理(1dcd5df2e)

  • 原因: 主机挂载的是 aws-ofi-nccl 1.20,其代理线程对每个 GIN signal 都以内联方式通过 gdrcopy 对设备内存做读-改-写;1.21 把它移到了工作线程(aws-ofi-nccl a698b6e、dea6e05)。
  • 做法: 多节点 EFA shard 从哈希固定的发布 tarball、针对主机 libfabric,把 1.21.1 构建进共享后端缓存,EFA 配置随后加载它(net 和 tuner)取代主机版本。每个缓存只构建一次,约一分钟。
  • 下载: 每次下载尝试都有上限(连接 30 秒,总计 300 秒),卡住的传输会触发 --retry 重试,而不会让后端准备挂起。

结果

在 b300 上通过真实启动器的两节点运行,下表每行都通过了 oracle 检查,数值为 period p50。

bf16 EP16 主机 1.20 自建 1.21.1
deepep-v2 decode,T=1 / T=512 1825 / 3048 µs 1011 / 2335 µs
nccl-ep decode,T=1 / T=512 387 / 5146 µs 298 / 1576 µs
deepep-v2 prefill,T=8192 27.6 ms 24.4 ms
nccl-ep prefill,T=8192 72 ms 15.9 ms

无效的参数:OFI_NCCL_GIN_STRONG_SIGNAL=0、OFI_NCCL_GIN_CQ_PROCESS_MAX_ITER、NCCL_GIN_PROXY_NTHREADS(NCCL 2.30.4 不读取)和 NCCL_GIN_NCONNECTIONS=4。

注意:这些结果仍远落后于 IB 资源池

  • 原因不在网络: EFA 上 8 字节的 NCCL 往返为 66 µs。
  • 原因在 CPU 代理: GPU 发出的每个 put 和 signal 都要经过它,这在小 T 时形成延迟下限,在大 T 时形成操作速率上限。deepep-v2 prefill 每 GPU 约 7 GB/s,而线速约为 100 GB/s。
  • 修复需要升级主机: EFA 上由 GPU 发起的 GIN 需要主机安装 EFA installer 1.50.0(efa.ko 3.3.0 完成计数器、libfabric 2.6),以及 NCCL ≥ 2.31 并设置 NCCL_GIN_TYPE=5。主机运行的是 efa.ko 3.1.0g,容器无法提供内核模块。第三方公布的 p6-b300 上该软件栈的数据显示 DeepEP V2 decode 为 118/168 µs(whn09/ep-benchmarks-efa)。
  • 其他观察: 一次 deepep-v2 prefill 运行中有一个 rank 出现 EFA Internal queue pair error (local) 并超时,重跑正常;主机 1.20 上的 nccl-ep decode 用例耗时约 28 分钟,在每个用例 5400 秒的保护时限之内。

请决定 b300 的 EP16 结果是现在发布,还是等待主机升级。

验证

在 b300 上手动驱动 launch_single-slurm.sh,覆盖:EP16 下完整的 nccl-ep 和 deepep-v2 bf16 decode 与 prefill 用例(使用 NCCL_GIN_TYPE 和 rdma_gbs);上述每种变体的精简 decode 和 prefill shard;本分支的冷缓存运行(第一个节点构建插件,第二个节点在锁保护下复用,数值与手工构建的插件一致)。

Comment thread collectivex/runtime/prepare_backend.sh Resolved
With gdrcopy installed the aws-ofi-nccl GIN plugin loads, but NCCL still
prefers its built-in GDAKI on the two ConnectX-7 IB ports, which are not the
GPU fabric, so window registration fails on most ranks and the rest hang.
The EFA profile now pins NCCL_GIN_TYPE=2 so GIN rides the Libfabric plugin.

DeepEP sizes its SMs from an ibstat probe that cannot see EFA devices; it
returns 0 and the model divides by it. A network.rdma_gbs registry field
(b300: 100 GB/s per GPU) is passed through instead.

Hand runs on two b300 nodes: nccl-ep and deepep-v2 EP16 bf16 decode and
prefill all pass the oracle.

现在 b300 节点已装 gdrcopy,CollectiveX 在 EFA 上运行 b300 EP16。装上 gdrcopy
后 aws-ofi-nccl 的 GIN 插件可以加载,但 NCCL 仍优先在两个并非 GPU 网络的
ConnectX-7 IB 端口上使用内置 GDAKI,导致多数 rank 窗口注册失败、其余 rank
挂起。EFA 配置现固定 NCCL_GIN_TYPE=2,使 GIN 走 Libfabric 插件。DeepEP 通过
ibstat 探测 RDMA 速率来确定 SM 数,但 ibstat 看不到 EFA 设备,返回 0 导致除零;
现由注册表字段 network.rdma_gbs(b300 每 GPU 100 GB/s)传入。两节点手动运行:
nccl-ep 与 deepep-v2 EP16 bf16 decode/prefill 均通过校验。
GIN on EFA runs through the aws-ofi-nccl CPU proxy. The hosts mount 1.20,
whose proxy thread applies every GIN signal with an inline gdrcopy
read-modify-write of device memory; 1.21 hands signals to a worker thread
and drops the read. Multi-node EFA shards now build 1.21.1 from a
hash-pinned release tarball into the shared backend cache, against the host
libfabric, and the EFA profile loads it (net and tuner) in place of the
host's. On b300 EP16 bf16: deepep-v2 decode T=1 1825 -> 1011 us, nccl-ep
decode T=512 5145 -> 1576 us, nccl-ep prefill T=8192 72 -> 15.9 ms.

GPU-initiated GIN on EFA is still out of reach: it needs EFA installer
1.50.0 on the hosts (efa.ko 3.3.0 completion counters, libfabric 2.6) and
NCCL 2.31. The README now says so.

CollectiveX:为多节点 EFA 分片构建 aws-ofi-nccl 1.21.1。EFA 上的 GIN 经由
aws-ofi-nccl 的 CPU 代理。主机挂载的 1.20 版代理线程对每个 GIN 信号都内联执行
一次 gdrcopy 设备内存读-改-写;1.21 将信号交给工作线程并去掉读取。多节点 EFA
分片现从哈希固定的发布包针对主机 libfabric 构建 1.21.1 到共享后端缓存,EFA
配置用它(net 与 tuner)替代主机版本。b300 EP16 bf16:deepep-v2 decode T=1
1825 -> 1011 us,nccl-ep decode T=512 5145 -> 1576 us,nccl-ep prefill T=8192
72 -> 15.9 ms。EFA 上 GPU 发起的 GIN 仍不可用:需主机安装 EFA installer 1.50.0
(efa.ko 3.3.0 完成计数器、libfabric 2.6)及 NCCL 2.31,README 已注明。
curl's --retry only fires once an attempt fails, and without a timeout a
stalled transfer never fails: backend preparation, and every peer node
waiting on the shared cache, would hang. Each attempt now gives up after
30 s to connect or 300 s in total, so --retry gets its chance.

CollectiveX:为 aws-ofi-nccl 下载设置超时,使卡住的下载能够重试

curl 的 --retry 只在一次尝试失败后才会触发,而没有超时设置时,卡住的传输
永远不会失败:后端准备步骤以及所有等待共享缓存的节点都会挂起。现在每次
尝试在连接超过 30 秒或总时长超过 300 秒后放弃,--retry 因此能够生效。
@Oseltamivir
Oseltamivir merged commit 4657e50 into main Oct 14, 2026
4 checks passed
@Oseltamivir
Oseltamivir deleted the cx-b300-ep16 branch October 14, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant