Skip to content

[Chore] [NVIDIA] deps: Bump FlashInfer to 0.7.3 and migrate the NVLink one-sided all-to-all to flashinfer.moe_ep - #48468

Open
leejnau wants to merge 14 commits into
sgl-project:mainfrom
leejnau:flashinfer-0.7.3-moe-ep
Open

leejnau wants to merge 14 commits into
sgl-project:mainfrom
leejnau:flashinfer-0.7.3-moe-ep

Conversation

@leejnau

@leejnau leejnau commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

This PR bumps FlashInfer to 0.7.3. It also brings in @trevor-m's migration of the NVLink one-sided all-to-all to flashinfer.moe_ep from #46885, because neither change can land without the other:

#46926 (0.7.2.post1) stays open for now as a fallback.

Depends on

Modifications

0.7.3 requires nvidia-cutlass-dsl[cu13]>=4.8.0, and SGLang already pins 4.8.0.

Tests

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ⏳ Run #42122889789
Latest PR Test (Extra): ⏳ Run #42122889726
Latest PR Test (AMD ROCm 10): ⏳ Run #42122889643

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Nov 4, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions

This comment has been minimized.

…FromProb

FlashInfer 0.7.3 (flashinfer-ai/flashinfer#5352) added an int& last_valid_index
parameter to flashinfer::sampling::DeviceSamplingFromProb, so the JIT tree
speculative sampling kernel no longer compiled and EAGLE verify crashed the
scheduler. Keep the per-thread candidate across the scan, as FlashInfer's own
chain speculative sampling kernel now does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fridge003 Fridge003 added run-ci CI: run the baseline test suite on this PR run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci) bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) labels Nov 5, 2026
@github-actions

This comment has been minimized.

@bobboli

bobboli commented Nov 5, 2026

Copy link
Copy Markdown

Hi @leejnau , could you rename the backend name to flashinfer_nvlink_one_sided, as stated in #46885 (comment)?

@leejnau

leejnau commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @bobboli. I'd like to keep this PR to the FlashInfer 0.7.3 bump and the changes 0.7.3 requires, so that it stays easy to review and revert. As @trevor-m noted on #46885, renaming the backend everywhere touches 40+ files.

A smaller way to get the name you suggested: accept --moe-a2a-backend flashinfer_nvlink_one_sided as the documented name and keep flashinfer as a deprecated alias with a warning, normalized in one place in server args, with the docs updated. Internal identifiers can follow later. That doesn't depend on 0.7.3, so I'll open it as a separate PR right after this one. Does that work for you?

@leejnau leejnau changed the title [Deps] [NVIDIA] Bump FlashInfer to 0.7.3 and migrate the NVLink one-sided all-to-all to flashinfer.moe_ep [Chore] [NVIDIA] deps: Bump FlashInfer to 0.7.3 and migrate the NVLink one-sided all-to-all to flashinfer.moe_ep Nov 5, 2026
@bobboli

bobboli commented Nov 5, 2026

Copy link
Copy Markdown

accept --moe-a2a-backend flashinfer_nvlink_one_sided as the documented name and keep flashinfer as a deprecated alias with a warning

Yes, that's the best way. Feel free to do it in the follow up PR. Thanks!

@nvpohanh nvpohanh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[by Claude Code] This review is done by agents. Please feel free to disagree if they do not make sense.

# FlashInfer's host-side workspace metadata must stay on the CPU even
# when layers are built under a CUDA default-device context.
with torch.device("cpu"):
return create_communication(bootstrap, params, backend=a2a_config)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[by Claude Code] Severity: functional | Confidence: High

Issue

test/manual/ep/test_flashinfer_dispatcher.py still uses the removed MoeAlltoAll API, and this migration breaks it. Instances built here share one workspace when their geometry matches, and FlashInfer 0.7.3's check_round_owner rejects a dispatch while another instance on that workspace has not called combine. Each manual test calls dispatcher.dispatch() but never combine(). Its cleanup helpers import flashinfer.comm.trtllm_moe_alltoall, catch the ImportError, and do nothing.

Example

With torchrun --nproc_per_node=4 test_flashinfer_dispatcher.py, test_dispatch_basic leaves its round open, so test_dispatch_with_empty_tokens raises "another NVLinkOneSidedAlltoAll sharing this workspace has a dispatch awaiting its combine".

Fix

End each test with dispatcher.combine(...) or dispatcher.moe_a2a.destroy(), and port _zero_moe_a2a_dispatch_payloads and tearDownClass to the new API.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. This is right, and it's tracked in #48506 along with a second problem in the same test. Its global_num_tokens layout doesn't match the dispatcher's sizing rules for its plain TP4 setup.

This PR doesn't make the test worse than main. On main with 0.7.2, all 5 tests already error while the dispatcher is built (num_fused_shared_experts=None in the fallback MoeRunnerConfig, which #46885's commit here fixes). On this PR test_dispatch_basic passes and the other 4 fail as you describe.

It's a manual test that CI doesn't run, and fixing it means porting the cleanup helpers to moe_ep and adding combine() or destroy() to each test. So I'd rather keep it out of the FlashInfer bump and fix it in a follow-up under #48506.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it will be OK if we are not moving the affected test to CI test

leejnau and others added 2 commits November 5, 2026 05:56
…shInfer 0.7.3

FlashInfer 0.7.3 appends a fixed_uniform_q_len argument to the FA2 paged
prefill planner, so fast_prefill_plan's 20-argument call fails with
"Expected 21 but got 20 arguments" on the first EAGLE verify or draft-extend
CUDA graph replay. Also clear _eagle_verify_fp8kv_sm90_state, as 0.7.3's
plan() does on every call, so run() never launches the SM90 fp8-KV verify
kernel with state from an earlier plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lashInfer 0.7.3 does

flashinfer-ai/flashinfer#6996 (in 0.7.3) changed nvfp4_kv_quantize to guard the
rounded E4M3 scale instead of the block amax, so a block whose scale underflows
to zero now stores an all-zero payload instead of a saturated one. The fused
MiniMax-M3.1 KV store reproduces that quantizer bit for bit, so make the same
change; test_fused_store_matches_separate_stores failed on its _tiny case.
Dequantized values are unchanged: a zero scale reads back as zero either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leejnau and others added 3 commits November 5, 2026 11:17
…ic mode

FlashInfer 0.7.2.post1 and 0.7.3 added a small-batch MoE finalize kernel
that adds the top-k expert outputs in a different order from the
large-batch kernel (flashinfer-ai/flashinfer#8831). A token's output then
depends on its batch size, so prefill and decode logprobs no longer match.

Under --enable-deterministic-inference, the pre-routed NVFP4 path now asks
FlashInfer for the unsummed outputs and sums them with
moe_finalize_fuse_shared, which adds them in the same order at every batch
size. It writes into the usual output buffer through a new out= argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shed

Kernel tests such as test_minimax_m31_nvfp4_trtllm_moe.py call the trtllm
NVFP4 MoE runner without publishing the server's runtime config, so
get_exec() raised. Check that the exec namespace exists first, as
vision.py does, and treat a missing config as deterministic mode off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fridge003 Fridge003 added the highest-priority CI: all three control labels, plus never batch-cancelled or stale-closed label Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blackwell SM100/SM120 bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) dependencies Pull requests that update a dependency file highest-priority CI: all three control labels, plus never batch-cancelled or stale-closed jit-kernel run-ci CI: run the baseline test suite on this PR run-ci-nv-extra CI: NVIDIA/shared Extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants