Conversation
…d-API An editable or in-place build compiles everything and then aborts at the copy step: setup.py declares every CMakeExtension with py_limited_api=True, so setuptools expects <name>.abi3.so, while CMake defines five pybind11 targets WITH_SOABI without USE_SABI and emits the full SOABI suffix. pybind11 cannot be built against the limited API (1CatAI#319/1CatAI#320's USE_SABI route is not open to these), so the declaration follows CMake: CMakeExtension accepts a py_limited_api override and the five modules pass False. Wheel builds are unaffected. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Peuqui <peuqui@github.com>
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.
Purpose
An editable or in-place build with
TORCH_CUDA_ARCH_LIST=7.0compileseverything and then aborts at the copy step:
(
pip install -e . --no-build-isolation, after the full compile.)It is the same symptom #319/#320 fixed for
_sm70_sampler_C, for five moremodules:
_sm70_exact_reduce_C,_h3_w8a16_C,_h3_flashinfer_C,_h3_flashattn_Cand_sm70_sparse_attention_C.setup.pydeclares everyCMakeExtensionwithpy_limited_api=True, so setuptools expects<name>.abi3.so, while CMake defines these five targetsWITH_SOABIwithoutUSE_SABIand emits<name>.cpython-312-x86_64-linux-gnu.so.The fix from #320 does not carry over.
_sm70_sampler_Cregisters its opsthrough
TORCH_LIBRARYand could move to the stable ABI; these five arepybind11 modules (
PYBIND11_MODULE(TORCH_EXTENSION_NAME, …)incsrc/sm70_turbomind/ops/exact_row_reduce.cu,csrc/sm70_turbomind/ops/h3_w8a16.cu,flashinfer-sm70/csrc/h3_noncausal_sm70.cu,flash-attention-v100/kernel/h3/forward.cuandflash-attention-v100/kernel/h3/forward_sparse.cu), and pybind11 cannot bebuilt against the limited API. The CMake side is therefore right, and the
declaration has to follow it:
CMakeExtensionnow accepts apy_limited_apioverride, and the five modules pass
False. Every other extension keeps itscurrent declaration.
Only builds that copy extensions into the source tree are affected. In
setuptools 80.10.2,
pip install -e .andsetup.py build_ext --inplaceendin the same place:
editable_wheelsetsbuild_ext.editable_mode,build_ext.finalize_optionsturns that intoinplace,build_ext.runthencalls
copy_extensions_to_source, andget_ext_filenamederives the expected.abi3.soname fromext.py_limited_api. A wheel build never takes thatcopy step, and its ABI tag comes from
bdist_wheel.py_limited_api, not fromthe extension declarations — the official wheel is tagged
cp312-cp312(
1cat_vllm-1.5.0-cp312-cp312-linux_x86_64.whl), so the change cannotmove it.
Test Plan
pre-commit run --files setup.pyCMake emits.
main(fe67339) plus thischange, 2x Quadro RTX 8000 + 3x Tesla V100 host, CUDA 12.8, Torch 2.10,
Python 3.12:
TORCH_CUDA_ARCH_LIST=7.0 MAX_JOBS=4 python setup.py build_ext --inplaceTest Result
pre-commit run --files setup.py: all applicable hooks passed (ruff check,ruff format, typos, mypy);
pre-commit run mypy-3.10 --hook-stage manual --files setup.py: passed.setuptools 80.10.2 expects, per declaration:
CMake emits the second form for all five targets, and
.abi3.sofor_sm70_sampler_C(which hasUSE_SABI 3since [Bugfix][SM70] Emit sampler stable ABI module #320).In-place build of fe67339 plus this change: exit 0 after 52 min
(
MAX_JOBS=4). The copy step now places all eleven extension modules inthe source tree, the five pybind11 modules under their SOABI names:
The build then continues through the Flash-V100 and FlashQLA bundling. The
optional Rust frontend is skipped on this host ("can't find Rust
compiler"), which is unrelated and does not fail the build.
Without the change the build aborts at exactly this step: the error quoted
above is from
pip install -e .on 2026-09-10, on a tree whosesetup.py,CMakeLists.txtand native sources matchedmain. I did not repeat the52-minute build without the change.
Each module imports from the in-place tree and exposes its bindings:
_sm70_exact_reduce_C(allocate, open_handle, release, run),_h3_w8a16_C(ColumnMajorGemmPlan, dequantize, gemm, prepare_fp16),_h3_flashinfer_C,_h3_flashattn_Cand_sm70_sparse_attention_C(forward).
Wheel build with the change, same tree and toolchain
(
python setup.py bdist_wheel, incremental on the build directory ofstep 3): exit 0 after 24 min 34 s, wheel tag
cp312-cp312like therelease wheel. The seven
.sofiles of the official1cat_vllm-1.5.0wheel carry identical names in the new wheel; the fivemodules touched here appear under their SOABI names (they postdate the
1.5.0 release). Installed into a copy of a working venv:
vllmimportsfrom
site-packages, and each of the five modules imports under itsSOABI name. A model served from that wheel (Qwen3.8-27B NVFP4 target,
incoai/Qwen3.8-27B-DFlash2draft, TP2 on 2x Tesla V100, k=7, greedy,400 tokens, 5 runs) boots in 175 s without a traceback and decodes at
70.67 tok/s with acceptance length 3.448, coherent German output.
No kernel source, CMake target or runtime path changes; only the filename
setuptools expects for these five modules.
Not a duplicate
Searched
1CatAI/1Cat-vLLMissues and PRs on 2026-09-11 foreditable,abi3,py_limited_api,build_ext inplaceandpybind11 limited: the onlyrelated work is #319/#320 (merged), which fixed
_sm70_sampler_Con the CMakeside, a route not open to pybind11 modules. The one open search hit, #409
(TokenSpeed MLA optional), does not touch
setup.py. No open PR touches thesedeclarations.
Two further editable-install gaps exist that this PR leaves alone: the
flash_attn_v100package is missing from the editable finder mapping, and theprebuilt SM70 FlashQLA GDN extension is only placed in
build_lib, so aneditable install JIT-compiles it at first use. I can follow up on both
separately if that is welcome.
AI assistance (Claude) was used to trace the failure and prepare the change;
I reviewed every line and ran the tests above.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.