Repository navigation
AX300: self-developed host-staged all-gather with fp8 payloads for PCIe-only nodes - #739
liumorrisclaw wants to merge 4 commits into
Conversation
One POSIX shm segment mmap'd by every rank, cudaHostRegister(Mapped| Portable) so each GPU holds a device pointer to the same pages; the kernel publishes the rank's stripe, waits on the peers' flags, and copies every stripe into recv in rank order -- a pure copy, so the rank-order sum downstream stays bit-exact. Generation counter lives in a device tensor the kernel increments, so captured graphs replay; every spin is bounded by clock64(). Falls back to NCCL for messages above 1 MiB or dtypes outside fp32/bf16/int32. For 4-rank nodes whose driver refuses peer access, NCCL's SHM ring stages every small all-gather through 2(N-1) sequential host hops (236 us median for a 64 KiB payload on 4x CMP 170HX, PCIe Gen2 x4); the one-shot publish + single barrier lands at ~58 us with a bf16 payload. Same-machine A/B on GLM-5.3-Flash (4x CMP 170HX, MiaAI protocol, median of 3): structured 102.8 -> 124.9 tok/s (+21.5%), coding +21.4%, prose +22.3%; drafted replies stayed SHA256-identical to serial ones in every run. Bit-exactness covered by a 4-GPU test (fp32/bf16/int32, eager + graph replay x3).
Same contract as d40edd3 (one-shot all-gather over one host-registered shm segment, TF_SHM_AG=1, NCCL above FALLBACK_BYTES), with the CUDA source written from scratch: generation-tagged arrival words published by thread 0 through a cuda::atomic_ref release store after a system fence, per-peer parallel acquire polling, 64-bit sticky failure words, and this file's own staging layout. No line lineage with the Morrowmake vLLM fork; the same source-overlap check is welcome to run again.
Follow-up: full results and contextThis PR is part of a larger project — AX300 (Axis 300, our mainline engine targeting 300 tok/s on CMP 170HX). Here's the complete picture: Production results (self-developed code, 4× CMP 170HX, 2026-10-13)Decode (stable across all context lengths — sparse attention architecture):
Cold prefill (unique prompts, prefix cache defeated):
512K context support on 64GB cards (55.37/56.58 GiB peak). Full project repositoryAll code, benchmarks, design docs, and the overlap checker are open: Our reply on PR #466We also left a follow-up on the original PR (#466) with the full story — where the work has landed since the review, and our interest in helping bring TensorFold to CMP-series cards if a CUDA backend materializes: We'd be glad to see this merged into python-0.6 if there's still interest, or to help with a native port reference otherwise. Either way, happy to keep pushing CMP-series adoption forward. |
|
Hello @liumorrisclaw, Thank you for the host-staged all-gather and its arrival protocol. Four ranks share one POSIX shm segment, fence, and publish with one release store. Peers copy in rank order. The file covers f32, bf16, and int32, on with TF_SHM_AG=1. A timeout leaves that rank's output untouched. On four CMP 170HX cards you report drafted matching serial. We have not re-run those numbers. This file is the copy path. The arrival protocol is what we keep. The fp8 format sits in the larger stack. This cannot merge. The Python engine is frozen, and no Python pull request merges any more. A native copy sits next to zig/src/cuda/nccl.zig, opt-in, off by default, and bit-identical to ncclAllGather for those three dtypes. Your cards are sm_80. Shipped builds are sm_86, sm_120, and sm_121, so this chip needs a scope call. You are welcome back once that is settled. Thank you again. |
Summary
A complete rewrite of the host-staged all-gather for PCIe-only multi-GPU nodes (CMP 170HX, sm_80), developed fresh for this project. The kernel family includes:
Provenance
All code in this PR is written from scratch for this project. The module docstring credits the host-shm collective concept where due. Every kernel is our own implementation.
Performance receipts (4× CMP 170HX, PCIe Gen2 x4, no P2P)
Exactness contract (drafted == serial) maintained across all configurations (SHA lineage verified).
Related PRs
Testing