Repository navigation
[Bugfix] Keep the HiSparse FlashInfer all-reduce backend on lazy workspace creation - #65522
Merged
MatthewBonanni merged 5 commits intoNov 4, 2026
Merged
MatthewBonanni merged 5 commits into
MatthewBonanni merged 5 commits into
Conversation
…space creation FlashInferAllReduce resolves its backend in __init__, while the vLLM config is current, but re-resolved it when it lazily created the shared workspace on the first all-reduce. With the V2 model runner that first all-reduce runs during CUDA graph memory profiling, outside the config context, so the HiSparse override from vllm-project#65201 was skipped and the workspace came up as mnnvl. The fused all-reduce + RMSNorm ops then reused it and hit the MNNVL race (vllm-project#64327), causing "unspecified launch failure" under HiSparse load. Pass the backend resolved at init into get_fi_ar_workspace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
MatthewBonanni
marked this pull request as ready for review
November 4, 2026 18:08
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #99988 for commit |
yewentao256
reviewed
Nov 4, 2026
yewentao256
left a comment
Member
There was a problem hiding this comment.
Thanks for the work!
Please do the following:
- full reproduce command line, error log in main and the same command line works in current PR
When doing reproduce / e2e test, please attach with raw output log in case some agents fake the data. DO NOT use AI generated Table here
For example:
pytest tests/v1/kv_connector/extract_hidden_states_integration/test_extraction.py::test_extract_hidden_states_tp2
# main
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 1070, in __init__
| (EngineCore pid=1580) super().__init__(
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core.py", line 160, in __init__
| (EngineCore pid=1580) self.scheduler: SchedulerInterface = Scheduler(
| (EngineCore pid=1580) ^^^^^^^^^^
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/core/sched/async_scheduler.py", line 14, in __init__
| (EngineCore pid=1580) super().__init__(*args, **kwargs)
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/core/sched/scheduler.py", line 277, in __init__
| (EngineCore pid=1580) self.kv_cache_manager = KVCacheManager(
| (EngineCore pid=1580) ^^^^^^^^^^^^^^^
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/core/kv_cache_manager.py", line 151, in __init__
| (EngineCore pid=1580) self.coordinator = get_kv_cache_coordinator(
| (EngineCore pid=1580) ^^^^^^^^^^^^^^^^^^^^^^^^^
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/core/kv_cache_coordinator.py", line 891, in get_kv_cache_coordinator
| (EngineCore pid=1580) return HybridKVCacheCoordinator(
| (EngineCore pid=1580) ^^^^^^^^^^^^^^^^^^^^^^^^^
| (EngineCore pid=1580) File "/usr/local/lib/python3.12/dist-packages/vllm/v1/core/kv_cache_coordinator.py", line 563, in __init__
| (EngineCore pid=1580) assert all(
| (EngineCore pid=1580) ^^^^
| (EngineCore pid=1580) AssertionError: Each KV cache group's real block_size must be divisible by hash_block_size. block_sizes=[544, 544, 544, 544, 181], hash_block_size=98464
| FAILED
| v1/kv_connector/extract_hidden_states_integration/test_extraction.py::test_extract_hidden_states_tp2
# Now
================= 1 passed, 23 warnings in 174.57s (0:02:54) ==================Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #99998 for commit ℹ️ This PR is 1 commit behind upstream |
yewentao256
approved these changes
Nov 4, 2026
yewentao256
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
#65201 forces the
trtllmFlashInfer all-reduce backend under HiSparse to avoid the MNNVL fused AR+RMSNorm race (#64327). The override was skipped when the shared workspace was created lazily outside the vLLM config context. HiSparse servers then still came up onmnnvland crashed withCUDA error: unspecified launch failure. Related: #56699.Claims
trtllmall-reduce workspace without needingVLLM_FLASHINFER_ALLREDUCE_BACKEND.CUDA error: unspecified launch failure(driver 719) under HiSparse multi-turn agentic load. It surfaces at the next event sync, e.g._finish_mirror_phaseorasync_utils.get_output.Validation
Hardware: 4×B200, TP4. Main = 70eaf45. PR = 70eaf45 + this diff (since merged with current main; the touched file is unchanged there). Both arms ran an identical environment shim on
PYTHONPATH: the kernel fix from #61463 (merged since), anos.memfd_createpolyfill for the container's Python build, and logging probes. Nothing else differs.Server:
Client (evalscope 1.14.1,
swe_smithmulti-turn dataset JSON):main: crash
evalscope exited after ~3 min (killed when the engine died). The same crash reproduced on every unpatched main run.
This PR: 832/832 turns, no errors (2 runs)
Run 1:
Run 2:
Details
FlashInferAllReduce.__init__resolves its backend while the config is current, which yieldstrtllmunder HiSparse. It then called_resolve_fi_ar_backendagain when it created the global workspace on the first all-reduce. With the V2 runner, that first all-reduce happens in_profile_cudagraph_memory→capture_model(profile_only=True), which runs outsideset_current_vllm_config.get_current_vllm_config_or_none()returnsNonethere, so the HiSparse guard is skipped andmnnvlis auto-selected. The workspace is a process-wide singleton, so the fused AR+RMSNorm ops reuse themnnvlworkspace. Instrumentation confirmedconfig is Noneat workspace creation, with that stack.The fix passes the backend resolved at init into
get_fi_ar_workspace. The fusion pass already resolves within the config context and is unchanged.The HiSparse guard can be dropped once FlashInfer ships flashinfer-ai/flashinfer#7782; this fix goes with it.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
🤖 Generated with Claude Code