Repository navigation
Package as sgl-flash-mla for release - #19
Merged
Merged
Conversation
Distribution name sgl-flash-mla; the import name stays flash_mla, so downstream code reads the same whichever wheel it came from. Mirrors sgl-deep-gemm, which installs as sgl-deep-gemm and imports as deep_gemm. The version comes from flash_mla/VERSION, which the release workflow overwrites, and which ships in the wheel so __version__ reads the same string the metadata does. get_version() used to append +<git rev>: PyPI rejects local version segments, and the wheel index spells the CUDA build as +cuNNN itself, so the two would have collided. torch is pinned to 2.14.1, the version SGLang builds against. The extensions use PyTorch's stable C++ ABI and would load against any 2.10+, but a release is tested against one version, so that is the one it asks for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SGLang and sgl-kernel pin torch==2.14.1 because their extensions link libtorch's C++ ABI, which moves between releases. These do not: the built wheel holds 68 undefined symbols from the stable C shim (aoti_torch_*) and zero mangled C++ ones, which is what TORCH_TARGET_VERSION buys. An == pin would be paying for the stable ABI and not using it. >= cannot conflict with SGLang's ==: installed together, pip resolves to 2.14.1 either way. It only stops the wheel from pinning anyone who uses it without SGLang. The floor stays 2.14.1, not the 2.10 that TORCH_TARGET_VERSION would allow. A 2.10 wheel is cu128 and does not bundle the libcudart.so.13 these extensions link, so it works only where a CUDA 13 runtime comes from somewhere else -- a condition pip has no way to express -- and 2.14.1 is what CI tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Prepares this fork to ship as its own wheel. Build infrastructure lives in the sglang repo; this is the packaging side.
What changes
sgl-flash-mla. The import name staysflash_mla, so downstream code reads the same whichever wheel it came from. Mirrorssgl-deep-gemm, which installs under that name and imports asdeep_gemm.flash_mla/VERSION, which the release workflow overwrites and which ships inside the wheel, soflash_mla.__version__and the wheel metadata cannot drift.get_version()used to append+<git rev>: PyPI rejects local version segments, and the wheel index spells the CUDA build as+cuNNNitself, so the two would have collided.python_requires>=3.10.torch==2.14.1, the version SGLang builds against.On the torch pin
The extensions are built against PyTorch's stable C++ ABI, so the binary is more permissive than the pin. Measured on the built wheel:
Zero CPython symbols, because neither extension defines
PyInit_*-- both register throughSTABLE_TORCH_LIBRARYduring static initialisation and are loaded withtorch.ops.load_library. Zero C++ mangled symbols, so nothing depends on libtorch's unstable ABI.Installing the wheel into a clean venv with torch 2.10.0+cu128 loads both extensions and resolves both op namespaces, so
torch>=2.10would work. The pin says 2.14.1 anyway because that is the version a release is tested against. One caveat if it is ever relaxed: the extensions linklibcudart.so.13, which a cu128 torch does not bundle, so a CUDA 13 runtime has to come from somewhere.Verification
The wheel builds and retags end to end:
packaging.parse_wheel_filenamereads it back asname=sgl-flash-mla, version=1.0.0+cu130, tag=cp310-abi3-manylinux2014_x86_64.🤖 Generated with Claude Code