[FlyDSL] Keep FP4 prefill modules alive across async dispatches - #5126
Open
AMD-yanfeiwang wants to merge 2 commits into
Open
[FlyDSL] Keep FP4 prefill modules alive across async dispatches#5126AMD-yanfeiwang wants to merge 2 commits into
AMD-yanfeiwang wants to merge 2 commits into
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
5 tasks
AMD-yanfeiwang
force-pushed
the
fix/flydsl-prefill-module-lifetime
branch
from
September 1, 2026 02:56
90f1b05 to
cc1b717
Compare
5 tasks
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.
Summary
Root cause
The paged FP4 prefill compiler specializes on
max_blocks_per_seqand used a 32-entry LRU. A 128K chunked-prefill workload creates 125 guarded page-table widths. Eviction drops the FlyDSL launcher; FlyDSL 0.3.1 then runsGpuJitModule.__del__, which callsmgpuModuleUnload/hipModuleUnloadwithout first synchronizing outstanding launch streams.In SGLang PR #36581, this produced an eight-GPU memory fault followed by
HSA_STATUS_ERROR_ILLEGAL_INSTRUCTION. ROCm Debug Agent captured 2048 stopped waves and an AQL packet withgrid=131072,workgroup=256, and akernel_objectabsent from the live kernel map. That geometry exactly matches this kernel's 512-CTA x 256-thread prefill launch. Disabling scheduler overlap did not change the signature.An unbounded cache is intentionally used instead of raising the limit: any finite bound can reintroduce unsafe module unload as compile dimensions vary. For the current 128K/page-size-256 integration, width specialization is practically bounded to about 128 entries. Long term, FlyDSL can make module retirement stream-aware.
Validation
1 passedtest_flydsl_pa_mqa_logits_fp4_prefill.py: PASS; 4 prefill and 5 varqlen cases, all exact-reference cosine 1.0126720 + 1024 + 256fault boundary; zero HSA/illegal-instruction fault markers; all scheduler workers remained healthypy_compile, andgit diff --checkpassRelated: sgl-project/sglang#36581