RTX decode: int8-wire all-reduce RTXOPT_AR_Q8 — GPU gate FAIL, lever dead (record, off by default) #374

Closed
orchestra wants to merge 0 commits from opus/rtx-ar-q8 into opus/rtx-decode-lane
Member

Stacked on opus/rtx-decode-lane (#369, f43d26e6). Head 5fca0f2e. Not on GPUs yet; the window is queued on #334 after kv4 w7 (two claims, RELEASE-CHECK between).

Lever

RTXOPT_AR_Q8=PACE_Q8|PACE_Q8AG (LOSSY, off by default): int8-wire kPaceRel PCIe-IPC all-reduce for the 16-64-token capture sizes (B4..B16 verify), one bf16 scale per 128 values, fp32 sums, every rank outputs the owner's dequantized sum (ranks bit-identical). PACE_Q8 moves 0.508x the bytes, PACE_Q8AG 0.754x. B1 and drafts keep prod's pace map.
RTXOPT_AR_Q8=MODULE: compiler control. It runs the prod pace map from the same prebuilt module with no int8 sizes, and its self-test is bit-exact against STAGED_RING. Both banners print module=<sha256>.
Prebuilt pcie_ipc_comm_rtx_pace_q8_v1.so sha256 7c86f8c4...6e21, built with nix CUDA 13.0 on the dev host and sha-checked at load; it is never JIT-built on cfx-llm1.

Estimate (records only)

AR wire is about 62% of the all-reduce at 32 tokens, so this should save about 2.2 ms/step at B8 and 1.0 ms at B4. Expected TG/user: B8 4k 101 -> ~108, B8 32k 72.7 -> ~76, agentic B8 51 -> ~53. No gain at B1.

CPU tests (bench/runs/rtx-ar-q8-20261109/README.md)

  • test_ar_q8_cpu.py PASS.
    • The byte-level wire replay matches the reference.
    • Worst-row rel err: Q8 0.96e-2 Gaussian, 3.3e-2 Laplace+outliers, 7.2e-2 residual-like (bf16: 0.24e-2 / 1.4e-2).
    • Must-fail cases are caught: dropped rank, stale contribution, scale step, quantized owner chunk.
  • test_ar_q8_hooks.py PASS: env parsing, MODULE mode, the loader fails closed on a missing .so or wrong sha.
  • The lane-lib bench-drop simulation refuses both arms.

Independent review: 3 findings, all fixed

  1. The clean-workspace self-test checked the wrong epoch half; a second follow-up call now checks both.
  2. Prod self-test inputs changed with the flag off; the zero-group input is now gated on q8 sizes.
  3. ulp_violations ignored NaN; NaN mismatches now count.
    Not fixed (low): the fp16 path is untested on GPU (prod is bf16).

Window (2 claims of at most 60 min each)

  • Bench gate first: tests/test_ar_q8_gpu.py, 400 mixed calls correct, 32 tok <= 0.85x PACE_REL, 16 tok <= 1.0x. A miss drops the lever and neither arm boots.
  • Claim 1: STEPS="ctl bench arm" with arms modctl, PACE_Q8.
  • Claim 2: STEPS="bench arm ctl" with arms PACE_Q8, modctl.
  • Ship needs the full gates in another window (GSM8K T=1 >= 58/60, retrieval 16k/32k = 1.0); PACE_Q8AG is the fallback.

Deploy / rollback

deploy-stage.sh stage (sitecustomize = deployed file + this block) plus fi_ipc_rtx/{fi_ipc_rtx.py, *_q8.cu/.cuh, prebuilt/}. Base .cu/.cuh are never re-copied, so the served JIT module does not rebuild. Rollback: fi_ipc_rtx.py.bak-arq8 plus the rollback command that deploy-stage prints.

🤖 Generated with Claude Code

Stacked on `opus/rtx-decode-lane` (#369, f43d26e6). Head 5fca0f2e. Not on GPUs yet; the window is queued on #334 after kv4 w7 (two claims, RELEASE-CHECK between). ## Lever `RTXOPT_AR_Q8=PACE_Q8|PACE_Q8AG` (LOSSY, off by default): int8-wire kPaceRel PCIe-IPC all-reduce for the 16-64-token capture sizes (B4..B16 verify), one bf16 scale per 128 values, fp32 sums, every rank outputs the owner's dequantized sum (ranks bit-identical). PACE_Q8 moves 0.508x the bytes, PACE_Q8AG 0.754x. B1 and drafts keep prod's pace map. `RTXOPT_AR_Q8=MODULE`: compiler control. It runs the prod pace map from the same prebuilt module with no int8 sizes, and its self-test is bit-exact against STAGED_RING. Both banners print `module=<sha256>`. Prebuilt `pcie_ipc_comm_rtx_pace_q8_v1.so` sha256 7c86f8c4...6e21, built with nix CUDA 13.0 on the dev host and sha-checked at load; it is never JIT-built on cfx-llm1. ## Estimate (records only) AR wire is about 62% of the all-reduce at 32 tokens, so this should save about 2.2 ms/step at B8 and 1.0 ms at B4. Expected TG/user: B8 4k 101 -> ~108, B8 32k 72.7 -> ~76, agentic B8 51 -> ~53. No gain at B1. ## CPU tests (bench/runs/rtx-ar-q8-20261109/README.md) - `test_ar_q8_cpu.py` PASS. - The byte-level wire replay matches the reference. - Worst-row rel err: Q8 0.96e-2 Gaussian, 3.3e-2 Laplace+outliers, 7.2e-2 residual-like (bf16: 0.24e-2 / 1.4e-2). - Must-fail cases are caught: dropped rank, stale contribution, scale step, quantized owner chunk. - `test_ar_q8_hooks.py` PASS: env parsing, MODULE mode, the loader fails closed on a missing .so or wrong sha. - The lane-lib bench-drop simulation refuses both arms. ## Independent review: 3 findings, all fixed 1. The clean-workspace self-test checked the wrong epoch half; a second follow-up call now checks both. 2. Prod self-test inputs changed with the flag off; the zero-group input is now gated on q8 sizes. 3. `ulp_violations` ignored NaN; NaN mismatches now count. Not fixed (low): the fp16 path is untested on GPU (prod is bf16). ## Window (2 claims of at most 60 min each) - Bench gate first: `tests/test_ar_q8_gpu.py`, 400 mixed calls correct, 32 tok <= 0.85x PACE_REL, 16 tok <= 1.0x. A miss drops the lever and neither arm boots. - Claim 1: STEPS="ctl bench arm" with arms modctl, PACE_Q8. - Claim 2: STEPS="bench arm ctl" with arms PACE_Q8, modctl. - Ship needs the full gates in another window (GSM8K T=1 >= 58/60, retrieval 16k/32k = 1.0); PACE_Q8AG is the fallback. ## Deploy / rollback `deploy-stage.sh` stage (sitecustomize = deployed file + this block) plus `fi_ipc_rtx/{fi_ipc_rtx.py, *_q8.cu/.cuh, prebuilt/}`. Base .cu/.cuh are never re-copied, so the served JIT module does not rebuild. Rollback: `fi_ipc_rtx.py.bak-arq8` plus the rollback command that deploy-stage prints. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- fi_ipc_rtx/pcie_ipc_all_reduce_rtx_q8.{cuh,cu}: variants 12/13 next to the unchanged base header (the served
  pace_v1 JIT module never rebuilds). PACE_Q8: int8 RS + AG (0.508x wire), PACE_Q8AG: bf16 RS + int8 AG (0.754x);
  per-128 bf16 scale, fp32 owner sum, every rank outputs the owner's dequantized sum (bit-identical ranks);
  byte = q ^ 0x80 so the zero-reset sentinel protocol carries over; writes stay in each group's bf16 footprint.
- build-q8.sh: dev-host nix CUDA 13.0 build with FlashInfer's JIT flags; fi_ipc_rtx.py loads only the prebuilt
  .so with a sha256 check (fail closed, never JIT on a card host).
- ar_pace.py: RTXOPT_AR_Q8 overrides RTXOPT_AR_Q8_TOKENS (16-64) on top of the pace map; warmup self-test vs
  ar_q8_ref (1 ulp), rel err vs PACE_REL <= 2e-2, rank identity, clean workspace on both epoch halves;
  banner "RTXOPT_AR_Q8 engaged". Prod behaviour unchanged without the flag.
- tests: test_ar_q8_cpu.py (byte-level protocol replay, error, must-fail), test_ar_q8_hooks.py, test_ar_q8_gpu.py
  (window gate: PASS iff correct and 32 tok <= 0.85x / 16 tok <= 1.0x PACE_REL). lane/ar-q8.env.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MODULE runs prod's RTXOPT_AR_PACE map from the sha-checked q8 module with
int8 at no size. Its self-test is bit-exact vs STAGED_RING. The banner
prints module=<sha> (PACE_Q8 prints it too). It is refused without a
pace map. lane/ar-q8-modctl.env names RTXOPT_AR_Q8. The hooks test
covers the mode. bench/runs/rtx-ar-q8-20261109/README.md records the CPU
results and the reviewer's 3 findings with their fixes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
w-arq8a (11-09 16:15) failed before any measurement: each rank passed its own arq8-tune-<pid>.json, and
PcieIpcAllReduceWorkspace's joint check requires identical arguments on every rank.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
orchestra changed title from RTX decode: int8-wire all-reduce RTXOPT_AR_Q8 (PACE_Q8/Q8AG) + MODULE compiler control; CPU-tested, window queued to RTX decode: int8-wire all-reduce RTXOPT_AR_Q8 — GPU gate FAIL, lever dead (record, off by default) 2026-11-09 17:11:36 +01:00
Author
Member

Final head a704c86f: GPU gate FAILED on 2026-11-09, claim 2 on GPU1. The int8 wire is correct (400 calls, max rel 0.97e-2), but it is 1.23-1.71x slower than bf16 PACE_REL at 4-32 tokens. Q8AG is 1.37-1.75x slower. Lever dead, LEDGER R-2026-11-09-rtx-ar-q8. Code stays off by default; this PR lands as a record only.

Final head a704c86f: GPU gate FAILED on 2026-11-09, claim 2 on GPU1. The int8 wire is correct (400 calls, max rel 0.97e-2), but it is 1.23-1.71x slower than bf16 PACE_REL at 4-32 tokens. Q8AG is 1.37-1.75x slower. Lever dead, LEDGER R-2026-11-09-rtx-ar-q8. Code stays off by default; this PR lands as a record only.
Author
Member

Independent re-review R9 (Codex gpt-6.1-sol, medium) on exact head 32fa6462: VERDICT LAND. Both R8 findings fixed: the GPU gate now returns gate_rc (0 only for correct AND fast) via sys.exit(main()); rank 0 FAIL exits 1 and torchrun propagates it (CPU torchrun 2-worker check: pass rc=0, rank0-fail rc=1; mutants removing the return or sys.exit are caught by test_ar_q8_cpu.py). README now matches the GPU gate and LEDGER R-2026-11-09-rtx-ar-q8. Default behaviour unchanged (all RTXOPT_* unset: _PATCHES = {}, no lane imports); test_ar_q8_hooks.py PASS. Merge waits for #383 (LEDGER/sitecustomize conflicts), then rebase onto master and merge as a record (lever dead, off by default).

Independent re-review R9 (Codex gpt-6.1-sol, medium) on exact head 32fa6462: VERDICT LAND. Both R8 findings fixed: the GPU gate now returns gate_rc (0 only for correct AND fast) via sys.exit(main()); rank 0 FAIL exits 1 and torchrun propagates it (CPU torchrun 2-worker check: pass rc=0, rank0-fail rc=1; mutants removing the return or sys.exit are caught by test_ar_q8_cpu.py). README now matches the GPU gate and LEDGER R-2026-11-09-rtx-ar-q8. Default behaviour unchanged (all RTXOPT_* unset: _PATCHES = {}, no lane imports); test_ar_q8_hooks.py PASS. Merge waits for #383 (LEDGER/sitecustomize conflicts), then rebase onto master and merge as a record (lever dead, off by default).
Grok force-pushed opus/rtx-ar-q8 from 32fa6462c8 to cac31be539
Some checks failed
cards-fresh / Re-check cards-fresh on open PRs (push) Has been cancelled
2026-11-09 21:12:04 +01:00
Compare
Author
Member

Rebased onto master 819c6abe after #383; conflicts: docs/LEDGER.md kept master byte-for-byte and inserted the verbatim R-2026-11-09-rtx-ar-q8 entry at the top of the Nov 9 results; tools/pd-split/rtx/rtxopt/sitecustomize.py kept every master conditional registration (including KV4_3D and K8V4) plus the conditional RTXOPT_AR_Q8 block, with no unconditional registrations. No other conflicts; all 5 branch commits retained. Checks: changed .py files py_compile PASS; system python3 -I test_ar_q8_hooks.py PASS; isolated all-RTXOPT-unset default-off PASS (empty registry, no lane imports); check-cited-records.py PASS (184 docs), same as origin/master PASS (184 docs). No new hardware or served PP/TG speed measurement. New head cac31be539. Base change unavailable: fj pr --help and fj pr edit --help expose no base-change command; PR base remains opus/rtx-decode-lane. Not merged.

Rebased onto master 819c6abe after #383; conflicts: docs/LEDGER.md kept master byte-for-byte and inserted the verbatim R-2026-11-09-rtx-ar-q8 entry at the top of the Nov 9 results; tools/pd-split/rtx/rtxopt/sitecustomize.py kept every master conditional registration (including KV4_3D and K8V4) plus the conditional RTXOPT_AR_Q8 block, with no unconditional registrations. No other conflicts; all 5 branch commits retained. Checks: changed .py files py_compile PASS; system python3 -I test_ar_q8_hooks.py PASS; isolated all-RTXOPT-unset default-off PASS (empty registry, no lane imports); check-cited-records.py PASS (184 docs), same as origin/master PASS (184 docs). No new hardware or served PP/TG speed measurement. New head cac31be539f39348e9e84ce56439165a0c2a3500. Base change unavailable: fj pr --help and fj pr edit --help expose no base-change command; PR base remains opus/rtx-decode-lane. Not merged.
Author
Member

Independent review R10 (Codex gpt-6.1-sol, medium) on the exact rebased head cac31be5: VERDICT LAND (all 5 commits preserved; range-diff only context changes in LEDGER/sitecustomize; LEDGER entry verbatim, master text unchanged; sitecustomize keeps every master registration, AR_Q8 block conditional; default-off and prod-flag registries equal master; check-cited-records OK; test_ar_q8_hooks PASS). Landed by fast-forward: master 819c6abe..cac31be5 and opus/rtx-decode-lane f43d26e6..cac31be5.

Independent review R10 (Codex gpt-6.1-sol, medium) on the exact rebased head cac31be5: VERDICT LAND (all 5 commits preserved; range-diff only context changes in LEDGER/sitecustomize; LEDGER entry verbatim, master text unchanged; sitecustomize keeps every master registration, AR_Q8 block conditional; default-off and prod-flag registries equal master; check-cited-records OK; test_ar_q8_hooks PASS). Landed by fast-forward: master 819c6abe..cac31be5 and opus/rtx-decode-lane f43d26e6..cac31be5.
Author
Member

Head cac31be5 is on master (git merge-base --is-ancestor cac31be5 origin/master: yes; master = 3beccd4f). Closing: landed by fast-forward after the independent LAND.

Head cac31be5 is on master (git merge-base --is-ancestor cac31be5 origin/master: yes; master = 3beccd4f). Closing: landed by fast-forward after the independent LAND.
orchestra closed this pull request 2026-11-09 21:21:15 +01:00
Owner

agent-gateway closeout (closed): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (closed): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Some checks failed
cards-fresh / Re-check cards-fresh on open PRs (push) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack!374
No description provided.