Skip to content

[DeepSeek-V4.1] Bump FlashMLA to the fork's rebase head (v4.1 kernels) - #39171

Merged
Fridge003 merged 6 commits into
mainfrom
flashmla-bump
Sep 13, 2026
Merged

Fridge003 merged 6 commits into
mainfrom
flashmla-bump

Conversation

@Fridge003

@Fridge003 Fridge003 commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Motivation

It's just #38942 rebased on main branch

Modifications

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ✅ Run #34738064047
Latest PR Test (Extra): ✅ Run #34738063907
Latest PR Test (AMD ROCm 10): ❌ Run #34738064037

Moves the pinned FlashMLA from c1dee56 to sgl-project/FlashMLA@3e18517, which
merges DeepSeek's v4.1 kernel drop into the SGLang fork.

Upstream restructured csrc/: kernels moved under csrc/kernels/, and the api/*.h
headers became api/*.cpp translation units whose pybind registration is compiled
out by FLASH_MLA_LIBTORCH_ONLY. This updates the source list, include dirs and
defines accordingly, and forward-declares the two attention entry points that
flashmla_extension.cc calls directly.

Also drops the csrc/utils.h SM103 patch: that file is gone and kerutils now
gates SM103A on __CUDA_ARCH__ itself. The cutlass config.h patch stays, since
the FlashMLA cutlass submodule pin is unchanged.

New in this pin: sm90/sm100 sparse decode for the V3.2-no-RoPE, V4.1 and
V4.1-fp4 KV cache formats alongside the existing V3.2 and V4 ones.
B300 is sm_103. sgl-kernel built FlashMLA for sm_100f only; that is
family-compatible so the binary runs, but ptxas generates better SASS when it
targets the architecture natively. FlashMLA's own setup.py picks sm_100a +
sm_103a over sm_100f with exactly that justification in its comment.

Worth ~3-8% decode throughput on B300 with the 3e18517 kernels: without it the
pin bump regresses ~4% at bs=1 and ~9% at bs=32 against the previous pin.

This also makes the existing cutlass/arch/config.h SM103 patch load-bearing.
Until now no TU compiled at __CUDA_ARCH__ == 1030, so those defines were dead.
@Fridge003 Fridge003 changed the title [DeepSeek-V4.1] Bump FlashMLA to the fork's rebase head (v4.1 kernels)- #38942 [DeepSeek-V4.1] Bump FlashMLA to the fork's rebase head (v4.1 kernels) Sep 12, 2026
Fridge003 and others added 3 commits September 11, 2026 22:00
test_ascii_ratio sent a bare instruction to the model and asserted the
continuation is >85% printable ASCII. On a base checkpoint that prompt has
no pinned answer: DeepSeek-V4-Flash-0731 continues it with a JSON record
whose language varies, so the probe measures which continuation the model
lands on rather than whether the output is healthy.

Measured on chunan-b300-81 (TP4, DSPARK, 24 runs per pin = 8 prompt
perturbations x {64,128,256} new tokens): with FlashMLA at the *current*
pin c1dee56 — the one main is green on — dropping the prompt's trailing
period alone yields ratio 0.80/0.84, i.e. the same sub-threshold Chinese
translation blob CI reported on #39171. The Q/A framing used by the three
probes above it yields ratio 1.000 at all three lengths on both the old and
the new FlashMLA pin.

The bump itself is not the cause: A/B of the two flashmla_ops builds under
an identical server gives GSM8K 0.985 (c1dee56) vs 0.990-0.995 (3e18517),
and all six decode probes pass on both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Fridge003

Copy link
Copy Markdown
Collaborator Author

@Fridge003

Copy link
Copy Markdown
Collaborator Author

@Fridge003
Fridge003 merged commit 5ebb160 into main Sep 13, 2026
230 of 274 checks passed
@Fridge003
Fridge003 deleted the flashmla-bump branch September 13, 2026 22:43
mqhc2020 pushed a commit to mqhc2020/sglang that referenced this pull request Sep 15, 2026
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.

2 participants