Repository navigation
docs: fix API indexes and RMSNorm RST rendering - #8464
Conversation
AI-assisted documentation fix for the 2026-11-02 documentation check report.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
This should be closed - #8374 supercedes it. |
AI-assisted documentation fix for the 2026-11-03 document check report. Preserve the prepared communicator API as the public interface.
Prevent |dx| from becoming an undefined substitution and problematic HTML link in the RMSNorm guide and shared module/function documentation. AI-assisted fix.
Fix the reported wording without changing API behavior or RST references. AI-assisted documentation edit.
Remove the 14-line addition to attn_scores.rst; preserve all other documentation fixes.
@netanel-haber Thanks for pointing this out. I've removed the single-head MQA documentation addition. The remaining changes cover the mHC and Ulysses documentation gaps, the RMSNorm RST rendering issue, and minor grammar fixes, none of which are covered by #8374. I'd like to keep this PR open for those fixes. |
|
/bot run |
Naming the test files that exercise your change is the cheapest option. Scoped PR runs also get an H100 lane that full runs do not. Paths can be directories or single files under Cost data from 2026-10-09. GitLab MR !2661 has been created, and the CI pipeline #79201273 is currently running. I'll report back once the pipeline job completes. |
kahyunnam
left a comment
There was a problem hiding this comment.
Approving pending CI: the mHC and Ulysses index additions, the |dx| literal fix and the wording edits are text-only and match the code they document, and dropping the single-head section settles the overlap with #8374.
The internal CI run on this head needs to finish before merge; one small ask is inline.
|
[FAILED] Pipeline #79201273 — 10/38 executed test jobs passed Compared with nightly #78850725 (different CI configuration). Unit Tests
✅ Pass · 🟡 Old failure · ❌ New failure · ⏱ Test timeout · Multi-GPU and Multi-Node Tests — 8/12 passed
Failure detailsNew relative to nightly (attribution uncertain)
Pre-existing failures
Timeouts, infrastructure, or incomplete jobs
|
Repeat the existing class parameter contract on the decorated constructor so generated API documentation and docstring checks cover all five arguments. AI-assisted documentation fix.
flashinfer-bot
left a comment
There was a problem hiding this comment.
CODEOWNERS gap attestation (not a code review).
A code owner of a changed path has approved this PR:
- @kahyunnam -> flashinfer/quantization/kernels/nvfp4_kv_materialize.py
The following files match only the catch-all rule; this approval covers that technical gap under the one-approval policy. GitHub still requires each owned path's own owner.
- docs/api/comm.rst
- docs/api/gemm.rst
- docs/api/mhc.rst
- docs/api/norm.rst
- flashinfer/cake_rmsnorm_det_train_backend/cake_jit.py
- flashinfer/cake_rmsnorm_train_backend/cake_jit.py
- flashinfer/cake_rmsnorm_train_backend/cake_windows.py
- flashinfer/cake_rmsnorm_train_backend/init.py
- flashinfer/cake_rmsnorm_train.py
Head: 6aef2fb
|
I checked internal pipeline #79201273:
No new failure attributable to this documentation PR was found. The pipeline is still red; this does not establish a passing run on the current head. — Posted by Codex on behalf of @kangbintNV. |
Re-vendor both Cake RMSNorm packages from flashinfer-ai/flashinfer c51a7540f042d7607f23bc29417147ca7a921828 (main, the merge of #8848). Since the previous commit, eb3eb68d, these changes touched them: - flashinfer-ai/flashinfer#8810: on SM103a the non-deterministic backward of H = 2048 ([T, H] rows, BF16 and FP32 weight) runs the deterministic package's program from T 58497 to 61952. FlashInfer measured the pair it ran there before above the weight-gradient budget (every element within atol 1e-4 + rtol 1e-4 of an FP64 sum) at T 58560. - flashinfer-ai/flashinfer#8827: new non-deterministic backward routes on SM100a and SM107a. With the FP32 weight the op passes, the backward runs one kernel where FlashInfer measured the pair it ran before with a larger weight-gradient error than the eager FP32 reduction of the same inputs: at H = 2048 on SM100a from T 337 to 4096 and on SM107a from T 1025 to 16384, at H = 4096 on SM100a from T 1793 to 3584, at H = 5120 on SM100a from T 65 to 6144 and on SM107a from T 4097 to 19968. On SM100a, H = 5120 runs one kernel above T 56256, where FlashInfer measured the programs it replaces above the budget, and H = 2048 one kernel from T 45057 to 58880; above T 65536, H = 2048 (SM100a) and H = 4096 (SM100a and SM107a) run compensated programs. On SM107a, H = 2048 from T 65 to 127 and H = 4096 from T 65 to 256 run another single kernel than before. Other widths get such routes too. - flashinfer-ai/flashinfer#8813: the deterministic backward of the smallest token counts on SM103a and SM107a (at H = 2048: T 3 to 171 on SM103a, up to 256 on SM107a) runs a new column-task kernel whose weight-gradient column sums use FP32 compensated arithmetic in a fixed row order. On SM103a it replaces the FP64 fold of the previous column-task kernel; on SM107a it replaces a main kernel and its reduce, so det's dw there no longer depends on the SM count. det's bits change at those token counts and stay reproducible run to run. On SM107a the deterministic backward of H = 256 also runs, from T 1 to 70656, the TwoSum main kernel and dw reduce it ran above T 70656 (the form SM100a runs), so det's H = 256 bits on SM107a change there too. On SM107a the FP32-weight forward of H = 5120 above 49152 rows also takes a new grid. - flashinfer-ai/flashinfer#8464: docstring formatting. - flashinfer-ai/flashinfer#8849: on SM103a the non-deterministic FP32-weight backward of H = 4096 above T 262144 and of H = 5120 above T 196608 runs a single kernel with TwoSum per-thread weight-gradient sums, in place of the kernel FlashInfer measured above the budget there (1.038 times it at T 393216 for H = 4096, 1.004 times at T 262144 for H = 5120). The BF16-weight routes, which the op does not use, switch at T 262144 and 393216. - flashinfer-ai/flashinfer#8848: on SM100a the non-deterministic backward runs a single kernel with blocked FP32 weight-gradient sums up to T 131072, from T 65537 at H = 2048, 4096 and 6144 (also with the residual), from T 56257 at H = 5120 and, at H = 1536, from T 75777 (FP32 weight) or 78785 (BF16 weight). Above T 131072 the TwoSum programs #8827 put in these windows still run. FlashInfer measured the new backward 1.029 to 1.266 times as fast as those programs on B200, with no measured dw element above the budget. At H = 5120 it runs the kernels SM107a runs above T 49152, whose sources gain a branch for SM100a only; their SM107a SASS does not change. FlashInfer's open pull request #8835 on the deterministic package is not included, nor #8899, which merged into main after c51a7540 and changes only SM103a's non-deterministic backward at H = 1536, 2048 and 6144 up to T 131072 (speed). The packages' entry points do not change, so the op code does not. cake_rmsnorm_det_train_backend goes from 582 to 634 files, cake_rmsnorm_train_backend from 581 to 653. Prebuilding all seven widths builds 146 libraries on SM100a (was 142), 160 on SM103a (was 154) and 138 on SM107a (was 133). The programs above the 232448 B shared-memory opt-in are unchanged: only det's backward reduce at 4096 on SM107a and its copy in the non-deterministic package (271360 B, CUDA 13.4's oversized mode), so the op's CUDA-runtime check covers the same programs; every binding above the opt-in sets that mode. The op's docstring names the column-task backward of det's smallest token counts on every architecture. Tests: - test_dw_accuracy_gpu.py (GPU): FlashInfer's gates at the token counts these changes moved. At H = 2048, on every architecture, T 128, 337, 1025, 4096, 16384, 58497, 58560, 61952 and 65536 with det and fast (fast also 98304); fast at one token count per window #8827, #8848 and #8849 changed, on that window's architectures, at H = 2048 (T 131073), H = 4096 (T 256, 3584, 65537, 131073, 262145) and H = 5120 (T 1792, 6144, 19968, 56257, 131073, 196609). An FP32 and a BF16 weight parameter, two inputs each: rstd within relative L2 1e-5 of FP64; y and dx within FlashInfer's tolerance; every dw element within atol 1e-4 + rtol 1e-4 of the FP64 sum at the forward's rstd and dw within relative L2 1e-4 (a BF16 gradient widened by its rounding); where fast's backward runs one kernel, the FP32 dw's relative L2 error at most the eager FP32 reduction's (or 2^-23 if larger); det bit for bit twice; over the FP32-parameter cases, the median ratio of the dw error to the eager FP32 reduction's at most 1, over det and over each backward form of fast. det stops at T 65536, where FlashInfer's deterministic suite checks the same element bound. These checks hold the installed build to the budget; test_fixed_windows.py is what fails on a build without these routes. - test_fixed_windows.py (no GPU): the windows above in the packages' registry: on SM103a fast runs det's programs from T 58497 to 61952 (H = 2048); fast runs one kernel in the #8827 windows; above a cut another single kernel than at the cut, the same one up to the next cut: on SM100a above T 65536 (H = 2048 and 4096) and T 131072 (H = 2048, 4096 and 5120), on SM107a above T 65536 (H = 4096), on SM103a above T 262144 (H = 4096) and T 196608 (H = 5120); on SM107a fast's T 65 to 127 at H = 2048 and T 65 to 256 at H = 4096 run another single kernel than the one they ran before; det's smallest token counts run a column-task kernel on every architecture and every width but 256. - test_rmsnorm_gpu.py: det's repeatability at the smallest token counts also covers the second column-task window of SM103a at H = 2048. python tools/vendor_cake.py fi --checkout ../flashinfer --commit c51a7540f042d7607f23bc29417147ca7a921828 \ --op rmsnorm --package flashinfer/cake_rmsnorm_det_train_backend \ --package flashinfer/cake_rmsnorm_train_backend Co-Authored-By: Claude <noreply@anthropic.com>
📌 Description
Add missing autosummary entries for ten legacy deterministic mHC training aliases and nineteen internal low-precision Ulysses primitives. Add the five constructor parameter descriptions to
NVFP4KVMaterializer.__init__, using the existing class documentation. These cover the 30 actionable findings in the 2026-11-05 documentation report (internal network).Render the RMSNorm gradient bound as an RST inline literal so
|dx|no longer generates an undefined substitution and problematic HTML links. Retain the minimal weight-dtype and prepared LoRA grammar fixes.The single-head MQA documentation is left to #8374. The report's two path findings are checker false positives:
refs/heads/mainis a Git ref, andflashinfer/experimental/KERNEL_SOURCES_EXCLUDED.txtis generated inside release wheels. STALE warnings remain untouched.Complete the Ulysses section title underline and three KDA section title underlines so they match their title lengths.
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reason:
Validation:
Targeted pre-commit (including mypy/Ruff) and
git diff --checkpassed for the constructor documentation change.All 29 reported MISSING entries are indexed. The constructor passes the nightly checker's docstring-completeness and five-argument consistency checks.
python3 scripts/check_pr_document.py --base origin/main --head HEAD --strictpassed on6aef2fb22: 0 new static documentation findings.RMSNorm: Docutils rendering previously reproduced the undefined substitution and problematic link at all six source occurrences; all six rendered correctly after the fix.
No runtime behavior changed; GPU tests were not run. Full Sphinx build is left to Build Docs CI.
KDA: Docutils confirms the three short-underline warnings are gone; targeted pre-commit passed.
Across all seven changed Python files, execution AST is unchanged after excluding docstrings and the three documentation-only Notes strings; the remaining edits are RST.
🔬 Experimental Track
flashinfer/experimental/and/or an@flashinfer_experimental_api. Tracking issue: #tests/experimental/and were validated on the intended hardware; a runnable example is included.flashinfer/aot.py, and no experimental backend is reachable frombackend="auto"withoutFLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1. (Calling an@flashinfer_experimental_apior naming a backend explicitly is itself the opt-in and needs no environment variable.)Reviewer Notes
The mHC entries document compatibility aliases of
flashinfer.cake_mhc_det_train, not the experimental selectable-mode implementation. The nineteen Ulysses helpers are decorated for API logging/tracing but live in an internal module and are not exported fromflashinfer.comm. The index documents their existing role in numerical tests and kernel tooling. Existing prose, API decorators, and STALE entries are preserved.Summary by CodeRabbit