Skip to content

docs: close v0.6.13 doc-check gaps + fix(moe) misleading topk_indices ICHECK message - #3546

Merged
aleozlx merged 3 commits into
flashinfer-ai:mainfrom
kangbintNV:kangbint/doc-fix-0.6.13
Jun 10, 2026
Merged

aleozlx merged 3 commits into
flashinfer-ai:mainfrom
kangbintNV:kangbint/doc-fix-0.6.13

Conversation

@kangbintNV

@kangbintNV kangbintNV commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two small, low-risk changes surfaced by the v0.6.13 doc-check pass. Touches docs/docstrings only, plus a one-line C++ assertion-message fix (no runtime behavior change).

docs: close v0.6.13-only doc-check gaps (MISSING / STALE / docstring) issues/3538

Resolves the doc-check findings that are new in v0.6.13 vs v0.6.12, using docs + docstrings only (no new @flashinfer_api decorators).

  • MISSING (API exported but not listed in .rst):
    • docs/api/fused_moe.rst: add a "Multi-LoRA MoE (BGMV)" section listing bgmv_moe / bgmv_moe_shrink / bgmv_moe_expand.
    • docs/api/quantization.rst: list nvfp4_quantize_per_token_cute_dsl under its canonical flashinfer.quantization.kernels.nvfp4_quantize currentmodule (the package-level re-export is guarded by is_cute_dsl_available() and is not importable at docs-build time without nvidia-cutlass-dsl).
  • Docstring completeness:
    • nvfp4_quantize_per_token_cute_dsl: expand the one-line summary into a full NumPy-style docstring with Parameters/Returns, mirroring the sibling nvfp4_quantize_cute_dsl and documenting the per-token scale output.

fix(moe): correct misleading topk_indices dtype ICHECK message

In csrc/fused_moe/noAuxTcKernels.cu, the dtype check for topk_indices requires int32 (encode_dlpack_dtype(...) == int32_code), but the assertion message was copy-pasted from the topk_values check and wrongly read "must have the same dtype as scores" (scores are fp32/bf16, not int32), which misleads debugging. Message changed to "topk_indices must be int32 dtype", matching the nearby routing_replay_out int16 check style. Message-only change; the runtime condition is unchanged.

Test plan

  • Docs build (docs/build_docs.sh) succeeds; new autosummary entries render and removed STALE entries no longer produce dangling references.
  • flashinfer_document_check shows 0 MISSING and the two v0.6.13 STALE items (is_cute_dsl_available, trtllm_mnnvl_fused_allreduce_add_rmsnorm_quant) gone; Docstring Completeness has 0 findings.
  • No code-path change for the MoE ICHECK; existing MoE routing tests remain green.

AI-assisted.

Summary by CodeRabbit

  • New Features

    • Added documentation for Multi-LoRA MoE (BGMV) operators: bgmv_moe, bgmv_moe_shrink, and bgmv_moe_expand.
  • Documentation

    • Enhanced quantization kernel documentation with detailed per-token scaling specifications and layout guidance.
    • Cleaned up API documentation by removing outdated entries and sections.

Resolve the doc-check findings new in v0.6.13rc1 vs v0.6.12, touching
only docstrings and docs/api/*.rst (no new @flashinfer_api decorators).

MISSING (API exported but not listed in .rst):
- fused_moe.rst: add a "Multi-LoRA MoE (BGMV)" section listing
  bgmv_moe / bgmv_moe_shrink / bgmv_moe_expand.
- quantization.rst: list nvfp4_quantize_per_token_cute_dsl under its
  canonical flashinfer.quantization.kernels.nvfp4_quantize currentmodule
  (the package-level re-export is guarded by is_cute_dsl_available() and
  is not importable at docs-build time without nvidia-cutlass-dsl).

STALE (.rst listed a symbol with no corresponding @flashinfer_api fn):
Since adding decorators is out of scope, clear these by rst cleanup.
- cute_dsl.rst: drop the "Availability" autosummary for
  is_cute_dsl_available (a bool capability probe, not a runtime API);
  it is still referenced in prose.
- comm.rst: drop trtllm_mnnvl_fused_allreduce_add_rmsnorm_quant from the
  trtllm_mnnvl_ar autosummary (its non-quant sibling is also undecorated
  and stays as-is to keep the change minimal).

Docstring completeness:
- nvfp4_quantize_per_token_cute_dsl: expand the one-line summary into a
  full NumPy-style docstring with Parameters/Returns, mirroring the
  sibling nvfp4_quantize_cute_dsl and documenting the per-token scale
  output. (mla_rope_quantize_fp8 was already backfilled by flashinfer-ai#3456.)

AI-assisted.
The dtype check for topk_indices in NoAuxTc requires int32
(encode_dlpack_dtype(...) == int32_code), but the assertion message was
copy-pasted from the topk_values check and wrongly read "must have the
same dtype as scores", which misleads debugging (scores are fp32/bf16,
not int32). Change the message to "topk_indices must be int32 dtype",
matching the nearby routing_replay_out int16 check style. Message-only
change; the runtime condition is unchanged.

AI-assisted.
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates API documentation across multiple modules (comm, cute_dsl, fused_moe, quantization) and corrects a kernel validation error message. The changes include removing stale documentation entries, documenting new BGMV MoE operators, expanding NVFP4 quantization kernel documentation, and fixing a topk_indices dtype validation message in the NoAuxTc kernel.

Changes

Kernel and API Documentation Updates

Layer / File(s) Summary
Kernel dtype validation message fix
csrc/fused_moe/noAuxTcKernels.cu
NoAuxTc kernel's topk_indices dtype validation error message corrected to report "must be int32 dtype" instead of prior mismatched message.
API documentation cleanup
docs/api/comm.rst, docs/api/cute_dsl.rst
Removes stale API documentation entries: trtllm_mnnvl_fused_allreduce_add_rmsnorm_quant from comm function list and is_cute_dsl_available Availability section from cute_dsl.
API documentation additions and docstring enhancements
docs/api/fused_moe.rst, docs/api/quantization.rst, flashinfer/quantization/kernels/nvfp4_quantize.py
Adds new Multi-LoRA MoE (BGMV) section documenting bgmv_moe, bgmv_moe_shrink, and bgmv_moe_expand operators; adds nvfp4_quantize_per_token_cute_dsl to quantization autosummary; expands function docstring with per-token scaling semantics, dtype/layout support, parameter handling, and return tensor specifications.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels

run-ci, op: moe, op: comm

Suggested reviewers

  • yzh119
  • jimmyzho
  • bkryu
  • nv-yunzheq
  • cyx-6
  • samuellees
  • aleozlx
  • sricketts
  • yongwww

Poem

🐰 A kernel's truth now plainly told,
Int32 reigns, the message bold,
Old docs retired to history's shelf,
New operators documented well,
BGMV and NVFP4 shine so bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: doc-check gap closures (v0.6.13 documentation updates) and a misleading ICHECK message fix in MoE code.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description comprehensively addresses all required sections with clear details about changes, rationale, and test plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates error messaging in the fused MoE CUDA kernels, expands documentation for Multi-LoRA MoE (BGMV) and per-token NVFP4 quantization, and cleans up unused API references in the documentation. Specifically, a detailed docstring was added for nvfp4_quantize_per_token_cute_dsl. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/flashinfer-ai/flashinfer/issues/comments/4655403100","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/flashinfer-ai/flashinfer/pull/3546?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: defaults\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `64bf75c4-1a3c-44af-9caf-fe88ebe79c64`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between b43f37ae15955a2932fb4774e6627b4b0220e489 and 611509d85411376fb87117c11f184af8c074d7e5.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (6)</summary>\n> \n> * `csrc/fused_moe/noAuxTcKernels.cu`\n> * `docs/api/comm.rst`\n> * `docs/api/cute_dsl.rst`\n> * `docs/api/fused_moe.rst`\n> * `docs/api/quantization.rst`\n> * `flashinfer/quantization/kernels/nvfp4_quantize.py`\n> \n> </details>\n> \n> ```ascii\n>  _______________________________________\n> < Execute order 66...to purge the bugs. >\n>  ---------------------------------------\n>   \\\n>    \\   (\\__/)\n>        (•ㅅ•)\n>        /   づ\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=flashinfer-ai/flashinfer&utm_content=3546)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n<!-- usage_tips_start -->\n\n> [!TIP]\n> <details>\n> <summary>You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.</summary>\n> \n> Change the `reviews.profile` setting to `assertive` to make CodeRabbit's nitpick more issues in your PRs.\n> \n> </details>\n\n<!-- usage_tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

@kangbintNV
kangbintNV marked this pull request as draft June 9, 2026 02:33
Re-add two autosummary entries that the earlier docs commit removed,
because both are genuinely user-facing and should stay discoverable in
the rendered docs:

- docs/api/comm.rst: trtllm_mnnvl_fused_allreduce_add_rmsnorm_quant, a
  real tensor-in/tensor-out MNNVL API with a full docstring.
- docs/api/cute_dsl.rst: is_cute_dsl_available (Availability section), a
  public helper in flashinfer.cute_dsl.__all__ that users call to guard
  CuTe-DSL code paths.

Keeping them listed means doc-check still reports both as STALE (neither
carries @flashinfer_api), which is the accepted trade-off under the
"no new decorators" constraint: prefer documenting the API over
silencing the checker. Their undecorated siblings are treated the same.

AI-assisted.
@kangbintNV
kangbintNV marked this pull request as ready for review June 9, 2026 03:03

@aleozlx aleozlx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aleozlx aleozlx added the run-ci label Jun 10, 2026
@aleozlx
aleozlx enabled auto-merge (squash) June 10, 2026 02:29
@aleozlx
aleozlx merged commit 41e5708 into flashinfer-ai:main Jun 10, 2026
58 of 85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants