Skip to content

[CI] flash-mla: Add the sgl-flash-mla release workflow - #45651

Merged
Fridge003 merged 2 commits into
mainfrom
flashmla-release-wheels
Oct 22, 2026
Merged

Fridge003 merged 2 commits into
mainfrom
flashmla-release-wheels

Conversation

@DarkSharpness

@DarkSharpness DarkSharpness commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

(auto generated by Claude)

Supersedes #45402, moved to a branch in this repository so the workflow can be run before merging.

Adds the release workflow for sgl-flash-mla, the wheel built from sgl-project/FlashMLA (the SGLang fork of deepseek-ai/FlashMLA).

Scope: release plumbing only. Nothing in the framework consumes the wheel yet -- no AOT kernel changes, no pyproject.toml dependency. Those come later, separately.

Paired with sgl-project/FlashMLA#19, which does the packaging on the other side (distribution name, VERSION file, metadata). The intended order is: merge that one, register the PyPI project, then merge this.

Files

file what it does
docker/sgl-flash-mla.Dockerfile build image, CUDA 13.4 + torch 2.14.1
scripts/build_sgl_flash_mla.sh build in container, retag, produce the PyPI variant
scripts/rename_sgl_flash_mla_whl.sh linux_<arch> -> manylinux2014_<arch>, add +cu130
scripts/update_flashmla_whl_index.py PEP 503 index under sgl-whl/cu130/sgl-flash-mla/
.github/workflows/release-whl-flashmla.yml build -> GPU tests -> publish

Modelled on release-whl-deepgemm.yml. Three things differ, all because FlashMLA is an AOT-compiled extension rather than a JIT library.

No Python matrix. The wheel is cp310-abi3, and the extensions hold no CPython symbols at all — measured on the built wheel:

undefined CPython (Py*/_Py*) symbols:   0
undefined torch C++ mangled symbols:    0
undefined torch stable C shim:         68

Both register through STABLE_TORCH_LIBRARY during static initialisation and are loaded with torch.ops.load_library, not imported, so neither defines PyInit_*. One wheel per architecture serves CPython 3.10+.

Built with CUDA 13.4, published as +cu130. The kernels need nvcc >= 13.1 for cvt with .scaled::n2::ue8m0, and older toolkits emit suboptimal instructions, so the compiler is pinned to 13.4. The tag describes the runtime instead: the extensions link libcudart.so.13 — SONAME carries only the major version — and call no cudart API newer than 13.0, so they load against the cu130 torch SGLang ships. Verified by loading the wheel under torch 2.10.0+cu128 as well.

The test matrix splits by what each GPU can run. The current kernels are sm_100a/sm_103a and the frozen pre-2026.09.30 ones (tests/legacy/) are sm_90a/sm_100a/sm_103a, so H200 runs the legacy suite (dense MLA decoding lives there and is the reason SM90 is built at all), while B200 and GB300 run both. Each test job removes the FlashMLA source package from its checkout, which would otherwise shadow the installed wheel, and asserts that flash_mla comes from the wheel; it then loads both extensions and resolves an op from each namespace, so a missing symbol surfaces there rather than at the first kernel launch.

The retag step also differs from DeepGEMM's: setuptools tags this wheel cp310-abi3-linux_x86_64, so only the platform part becomes manylinux2014 and the abi3 part is left alone.

Checked locally

The build → retag → index chain was run end to end against a real wheel:

sgl_flash_mla-1.0.0-cp310-abi3-linux_x86_64.whl   (7.9 MB)
  -> sgl_flash_mla-1.0.0+cu130-cp310-abi3-manylinux2014_x86_64.whl
  -> sgl-whl/cu130/sgl-flash-mla/index.html  (with sha256)

The kernels themselves were verified on H200 (sm90) and GB300 (sm103a) at the FlashMLA commit this builds from.

Before merging

Needs a SGL_FLASH_MLA_PYPI_TOKEN repository secret, and the sgl-flash-mla project registered on PyPI. GH_PAT_FOR_WHL_RELEASE already exists and is reused.

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ✅ Run #39659463602
Latest PR Test (Extra): ❌ Run #39659463572
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

DarkSharpness and others added 2 commits October 20, 2026 07:05
Builds and publishes wheels for sgl-project/FlashMLA, the SGLang fork of
deepseek-ai/FlashMLA. Release plumbing only -- nothing in the framework
consumes the wheel yet.

Modelled on release-whl-deepgemm.yml, with three differences that come from
FlashMLA being an AOT-compiled extension rather than a JIT library:

- No Python matrix. The wheel is abi3 (cp310-abi3) and its extensions hold no
  CPython symbols at all: both register through STABLE_TORCH_LIBRARY during
  static initialisation and are loaded with torch.ops.load_library rather than
  imported. One wheel per architecture serves CPython 3.10+.

- Built with CUDA 13.4, published as +cu130. The kernels need nvcc >= 13.1 for
  `cvt` with `.scaled::n2::ue8m0`, and older toolkits emit suboptimal
  instructions for them, so the compiler is pinned to 13.4. The tag describes
  the runtime instead: the extensions link libcudart.so.13, whose SONAME
  carries only the major version, and call no cudart API newer than 13.0, so
  they load against the cu130 torch SGLang ships.

- The test matrix splits by what each GPU can run. The current kernels are
  sm_100a/sm_103a, so H200 runs tests/legacy/ -- the frozen pre-2026.09.30
  kernels, which is also where dense MLA decoding lives and the reason SM90 is
  built at all -- while B200 and GB300 run the current suites. Each job first
  loads both extensions and resolves an op from each namespace, so a missing
  symbol surfaces there rather than at the first kernel launch.

The retag step differs from DeepGEMM's too: setuptools tags this wheel
cp310-abi3-linux_x86_64, so only the platform part becomes manylinux2014, and
the abi3 part is left alone.

Needs a SGL_FLASH_MLA_PYPI_TOKEN secret; GH_PAT_FOR_WHL_RELEASE already exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
The test steps put the FlashMLA checkout on PYTHONPATH, so `import flash_mla`
resolved to the source package, which has no built extensions. Remove it before
the tests and assert that flash_mla comes from the installed wheel.

The frozen extension is built for sm_90a/sm_100a/sm_103a, so B200 and GB300 now
run tests/legacy/ too (dense decoding stays SM90-only), plus the V3.2 bit-equal
decoding check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread docker/sgl-flash-mla.Dockerfile Resolved
@Fridge003
Fridge003 merged commit a56024c into main Oct 22, 2026
108 of 112 checks passed
@Fridge003
Fridge003 deleted the flashmla-release-wheels branch October 22, 2026 06:34
@DarkSharpness DarkSharpness added the run-ci CI: run the baseline test suite on this PR label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants