refactor(nvidia): use vLLM binary for gptq marlin repack - #857
Draft
voltjia wants to merge 1 commit into
Draft
Conversation
voltjia
force-pushed
the
refactor/source-gptq-marlin-repack
branch
from
July 29, 2026 10:46
6ea84ce to
c753381
Compare
voltjia
force-pushed
the
refactor/source-gptq-marlin-repack
branch
from
July 31, 2026 12:24
c753381 to
2f5391b
Compare
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.
Summary
gptq_marlin_repackCUDA implementation with an adapter to an installed vLLM_Cbinary.src/CMakeLists.txt, with no new provider layer.Motivation
The previous implementation copied upstream kernel code and generated CUDA sources into InfiniOps. That approach increases source ownership, license-review, regeneration, and update costs for every third-party internal operator.
This PR is a deliberately narrow external-binary pilot for one representative operator. vLLM already registers
gptq_marlin_repackwith the PyTorch Dispatcher, which gives InfiniOps a typed, discoverable boundary above device binaries. The adapter therefore uses the registered schema instead of binding an unstable implementation symbol. For a future library that has no Dispatcher or equivalent registry, a stable exported host C/C++ entry point discovered with tools such asnm -D -Cis the next acceptable boundary; no generic provider framework is introduced before a second concrete case exists.Upstream implementation: vLLM
gptq_marlin_repack.cuatbc150f50.N/A - no linked issue.
External Binary Contract
gptq_marlin_repack(b_q_weight, perm, size_k, size_n, num_bits, is_a_8bit, out)_C::gptq_marlin_repack(Tensor b_q_weight, Tensor perm, SymInt size_k, SymInt size_n, int num_bits, bool is_a_8bit) -> TensoroutTensorvllm/_C.*.so, or useINFINI_OPS_VLLM_LIBRARYThe vLLM binary must be compatible with the active PyTorch, CUDA, and C++ ABI. CMake fails during configuration when the library is missing, the schema differs, or no CUDA implementation is registered.
Type of Change
feat- new feature / new operator / new platformfix- bug fixperf- performance improvement (no behavioral change)refactor- code restructuring without behavior changetest- adding or fixing tests onlydocs- documentation onlybuild/ci- build system or CI configurationchore- tooling, formatting, or other non-code changes!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
Remote environment:
ssh nvidia,docker.1ms.run/verlai/verl:vllm020.dev2, NVIDIA A100, PyTorch2.11.0+cu130, vLLM0.20.2, CUDA13.0.The existing smoke operator list was not expanded for this integration. The focused operator build used
INFINI_OPS_OPS=gptq_marlin_repackand a minimal generated-Torch allowlist. The smoke build did not selectgptq_marlin_repack, and configured successfully without probing vLLM.Test Results on Supported Platforms
tests/test_gptq_marlin_repack.py --devices nvidia -q:13 passed in 1.99sAdditional validation output
No full test suite was run. Per the agreed validation scope, this PR uses the pruned operator build, the focused operator test, and the existing smoke suite.
Benchmark / Performance Impact
N/A - this PR changes kernel source ownership and linkage, not the public operator contract, and makes no performance claim. The adapter performs one device-to-device copy from the vLLM-returned Tensor into the existing trailing
outTensor.Notes for Reviewers
src/CMakeLists.txt: exact schema validation, CUDA kernel validation, no-AS-NEEDED linkage, and runtime lookup paths.src/torch/ops/gptq_marlin_repack/gptq_marlin_repack.cc, especiallySymIntand output-copy handling.providersdirectory or generic binary-provider layer is introduced. Shared CMake machinery remains deferred until another concrete integration demonstrates reusable requirements.