Skip to content

[Fix] deepgemm: Restore warmup state after failures - #43712

Closed
adenzhou1350 wants to merge 1 commit into
sgl-project:mainfrom
adenzhou1350:codex/fix-deepgemm-warmup-failure-state
Closed

adenzhou1350 wants to merge 1 commit into
sgl-project:mainfrom
adenzhou1350:codex/fix-deepgemm-warmup-failure-state

Conversation

@adenzhou1350

@adenzhou1350 adenzhou1350 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

DeepGEMM warmup temporarily sets compile mode to 1, but only restores it on the normal path. If an executor raises, subsequent work can inherit compile-only mode. The warmup group is also marked initialized before locking/compiling, so a caught failure makes a later same-group call skip warmup.

Modifications

  • Restore the saved compile mode in finally, including interrupted warmup.
  • Remove only the failed group's initialization marker before re-raising. Keep the existing early reservation and successful-group caching.
  • Retain the guard for DeepGEMM versions without both compile-mode APIs and the existing symmetric-memory restoration.

Accuracy Tests

Added seven registered CPU tests covering success/cache reuse, execution failure and interruption, partial/absent legacy APIs, executor allocation failure, compile-mode entry failure, asynchronous synchronization failure, and lock failure without clearing other groups.

Native Linux CPython 3.12, using the actual source-package imports and CustomTestCase:

  • Unmodified source: six failing assertions/results (reported as 2 failures + 4 errors by the CI retry wrapper); normal and legacy controls pass.
  • Repaired source: all seven new tests pass; the existing warmup-memory test also passes.
  • GPU/executor boundaries are mocked; the existing memory test uses meta tensors. This is not a real DeepGEMM kernel run, model test or official CI result.

The identical function/test bodies also pass component checks on native Windows Python 3.12 and 3.14. File-scoped pre-commit formatting/static checks pass. Three hooks invoke the unavailable Windows python3 launcher; their exact scripts pass with native python. git diff --check passes.

Speed Tests and Profiling

No kernel implementation or successful warmup schedule changes; no speedup claim. Native GPU and the full supported-version matrix remain for CI.

AI-assisted implementation and validation.


CI States

Latest PR Test (Base): ❌ Run #38153460803
Latest PR Test (Extra): ❌ Run #38153460551
Latest PR Test (AMD ROCm 10): ❌ Run #38153460726

@adenzhou1350

Copy link
Copy Markdown
Contributor Author

The registered CPU regression tests pass locally. CI is stopping at the missing run-ci label before tests run. Could a maintainer enable CI for this PR?

detain pushed a commit to detain/sglang that referenced this pull request Oct 15, 2026
…lures [batch-apply-b 2026-10-14]

Cherry-pick -x of 80ff2dd (single commit), clean — compile_utils.py
byte-identical between PR base d62b9c2 and merge-4 HEAD, test dir new.
try/finally restores _bwd_warmup / warmup flags when DeepGEMM warmup
raises, preventing poisoned compile state on retry.
@adenzhou1350 adenzhou1350 changed the title [Bugfix] Restore DeepGEMM warmup state after failures [Fix] deepgemm: Restore warmup state after failures Oct 16, 2026
detain added a commit to detain/sglang that referenced this pull request Oct 20, 2026
…/deferred/avoid map

- 3A [24-35]: NVFP4 MoE boot sgl-project#39807/sgl-project#40173, block-FP8 TP refine sgl-project#42566, k-pool indexer split sgl-project#43619,
  SM120 skinny GEMM sgl-project#42865/sgl-project#42867, DeepGEMM warmup guards sgl-project#32686/sgl-project#43712, autotune sgl-project#43363/sgl-project#40420,
  mHC overlap sgl-project#42985, FP8-einsum precompile sgl-project#42821.
- 3B [36-43]: PCIe CustomAllreduce VMM sgl-project#44448, EP local expert ids sgl-project#44480, shm TP broadcast sgl-project#44202,
  PCIe-IPC all-gather sgl-project#42863 + multicast guard sgl-project#41888, TP-sampling consistency sgl-project#41916/sgl-project#38565,
  draft embed/lm_head VRAM sgl-project#37155.
- sgl-project#39807 toolchain commit verified safe against our CUDA_HOME=12.9 pin (cu13 fallback needs CUDA_HOME unset AND glibc>=2.41; we are 2.39).
- stack_want.txt: execution-status banner. Branch tip 5dd6ec7.
detain added a commit to detain/sglang that referenced this pull request Oct 20, 2026
…rt, DeepGEMM warmup recipe key, MoE disagg bag)

Individually-passing PRs collided when merged on deepseek-41-flash-1017-stack:

- sgl-project#44448: test_custom_all_reduce_v1_vmm.py imported register_comm_cleanup
  from sglang.kernels.ops.communication.mp (does not exist); the real home
  is sglang.srt.distributed.comm_cleanup. Fixing the import unblocked
  collection. Also added the repo-idiomatic module-level
  skipif(not torch.cuda.is_available()) so the torchrun-only GPU tests skip
  cleanly when pytest is invoked directly without GPUs.
- sgl-project#43712: _INITIALIZATION_DICT is keyed by the 5-tuple
  (kernel_type, n, k, num_groups, recipe) (compile_utils.py:163); the
  blockwise FP8 gemm_nt_f8f8bf16 path calls the hook without a recipe, so
  test_warmup_state now builds 5-tuple keys with recipe=None, matching the
  implementation exactly.
- sgl-project#39807: the flashinfer_cutlass fp4 fallback calls
  _cutlass_moe_tune_max_num_tokens -> get_disagg(); the sm120 nvfp4
  placement test called _run_flashinfer_cutlass outside any publish scope,
  so 'config namespace disagg not published'. Publish the bags with the
  file's existing idiom, get_context().override_server_args(model_path=
  "dummy"), the same way test_flashinfer_cutlass_swiglu_params.py exercises
  the disagg bag.

CPU verification (CUDA_VISIBLE_DEVICES=9): 13 passed, 9 skipped (GPU-only
VMM subtests), 0 failed.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks @adenzhou1350. Closing this because you have 19 PRs open and none updated in 7 days, over our soft cap of 5 for idle PRs.

Reopen the two or three you most want reviewed - a short active set moves faster than a long idle one.

Some directories moved recently, so an older branch may need retargeting:
sgl-kernel/ -> python/sglang/kernels/aot/, python/sglang/jit_kernel/
-> python/sglang/kernels/jit/, docs/ -> docs/docs/ (.mdx),
bench_serving.py -> benchmark/serving.py, test/srt/ -> test/registered/.

@github-actions github-actions Bot closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant