Conversation
Author
|
Could a maintainer please run |
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
compressed-tensorsmetadata, including explicit groups,presets, ignored modules, quantization status, KV-cache metadata, and nested
text_config.quantization_config.exact module name >
re:regex > module type. Reject ambiguous matches andunsupported schemes instead of silently selecting an incompatible kernel.
projections while enforcing the uniform schemes required by fused QKV and
fused gate/up projections.
weight_scaletensors as FP32 and shard output-channel scales and biasesconsistently under tensor parallelism.
W8A8 configuration fixture, and standalone xmake test targets.
Motivation
InfiniLM previously selected one quantization method for the entire model. A
compressed-tensorscheckpoint can instead define severalconfig_groupsandan
ignorelist, so global selection can quantize a module that the checkpointstores in BF16 or choose a kernel for an unsupported scheme.
This PR adds a fail-closed, module-aware resolution path and validates it with
the public
RedHatAI/Qwen3-4B-Instruct-2507-quantized.w8a8checkpoint and an independently generated hybrid checkpoint containing both
W8A8 and BF16 projections.
Related issue: N/A — this is a Project #4 quantization contribution.
Type of Change
feat— new feature / new modelfix— 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 changesDesign and Supported Execution Scheme
The parser retains the original JSON in
raw_configfor diagnostics andforward-compatible metadata inspection. Execution is intentionally narrower
than parsing: a module is dispatched to the existing W8A8 kernel only when its
resolved group has all of the following properties:
format = "int-quantized";W8A8/INT8andUNQUANTIZEDpreset groups are supported. Other parsedstrategies remain visible in metadata but produce a path-qualified error at
resolution time. This prevents a checkpoint from appearing supported while
being executed with the wrong quantization semantics.
For fused projections,
q_proj,k_proj, andv_projmust resolve to the samescheme; the same invariant applies to
gate_projandup_proj.o_projanddown_projare independently selectable, which enables practical mixedW8A8/BF16 checkpoints.
Test Results of Involved Models on Supported Platforms
Platform matrix
Focused tests
The following commands pass on the current branch:
Coverage includes:
quantization_configextraction;config.jsonshape.End-to-end model validation
RedHatAI/Qwen3-4B-Instruct-2507-quantized.w8a8RedHatAI/Qwen3-4B-Instruct-2507-quantized.w8a8The hybrid checkpoint uses W8A8 for Transformer linear layers while keeping

lm_headandmodel.layers.0.self_attn.o_projin BF16. Passing both TP1 andTP2 demonstrates that
ignorechanges actual parameter layout and execution,not only parser output.
Benchmark / Performance Impact
Methodology
29ddfb9bafa1805fb8685e45e09debac9c638cec, rebased onInfiniLM-v0.2.9cat270feb3e14976ca14c3b012df1d1740f939a941e.driver 570.124.06. TP1 results below use GPU 0 only.
checkpoints.
Qwen/Qwen3-4B-Instruct-2507BF16 and the corresponding public Red Hat AI compressed-tensors W8A8
checkpoint linked above.
examples/bench.py, greedy decoding, 32 generated tokens, onewarmup, and three measured repetitions per shape.
configuration. Only the checkpoint changes.
Offline performance, TP1
Across these shapes, W8A8 improves prefill throughput by 25.0%-64.0% and
decode throughput by 22.0%-30.1%. In the batch-1 benchmark process, checkpoint
loading decreased from 2,443.8 ms to 1,677.8 ms (31.3%).
Concurrent service performance, TP1
Both services used 64 requests, concurrency 20, greedy sampling, 64 maximum
new tokens,
max_batch_size=20, a static KV cache of 512 tokens, and the sameGPU. Each model used a freshly started service and one measured workload, with
no separate service warmup. The client used a fixed random seed of 0 and
consumed the OpenAI-compatible streaming endpoint; default prefix caching
remained enabled for both runs. Each run completed 64/64 requests with no
client or server errors.
Resident GPU memory was sampled with

nvidia-smiafter each workload while theservice remained loaded; GPU 1 stayed idle. W8A8 used 4,594 MiB less resident
memory. Service checkpoint loading also decreased from 2,672.2 ms to 1,743.0 ms
(34.8%).
Accuracy and evaluation throughput
The C-Eval increase is not presented as evidence that quantization improves
model quality; small benchmark deltas can result from changed answer choices
near decision boundaries. The relevant observation is that no material
accuracy collapse was observed on either suite.
Weight footprint
The checked checkpoint index metadata reports 8.05 GB of BF16 safetensors and
5.19 GB of W8A8 safetensors, a 35.5% reduction. This is an end-to-end checkpoint
footprint, not an idealized 2x figure: embeddings, normalization weights, and
other non-linear tensors remain at higher precision. The service measurement
above separately captures the resident runtime allocation after the workload;
it is not presented as a sampled peak-memory trace.
Reproduction
Build the extension and focused tests using the same InfiniCore installation:
Run the public W8A8 checkpoint through the official single-request entry point
on both validated tensor-parallel configurations:
The evidence archive includes
make_mixed_checkpoint.py. It dequantizes oneselected projection to BF16, removes its scale tensor, updates the checkpoint
index, and adds the module to the compressed-tensors
ignorelist withoutmodifying the source checkpoint:
Run the TP1 performance comparison. Repeated input lengths produce three
measurements for each shape:
Run the evaluation suites from a populated Hugging Face dataset cache:
Repeat the same two commands with
--model "$BF16"for the baseline.Run the concurrent service comparison once for each model:
The installed OpenAI 3.13.0 plus
httpx22.12.0 client completed 64/64requests with
scripts/test_perf.py, but emitted asynchronous-generatorwarnings during interpreter teardown. The attached evidence harness uses
standard
httpx0.28.1 against the same streaming endpoint and workload sothat transport cleanup is deterministic. No InfiniLM source change is needed.
Evidence
The external
infinilm-compressed-tensors-w8a8-29ddfb9-rtx4090-evidence.tar.gzarchivecontains the raw BF16/W8A8 offline, accuracy, single-request, and service logs;
CSV summaries; the hybrid checkpoint metadata and construction script; and the
explicit-cleanup service harness. The archive and six representative NVIDIA result screenshots are attached
below. The archive SHA-256 is provided next to its download link.
infinilm-compressed-tensors-w8a8-29ddfb9-rtx4090-evidence.tar.gz
SHA-256:2620c839a0d42bda8315ff87e4a4ba03bd95b7ea266ba383310e6f09efb705e3
Notes for Reviewers
scheme selection. Parsing a field does not imply kernel support.
order must not determine the selected quantization group.
They fail with an explicit error, while output/down projections remain
independently selectable.
quantization kernel.
client and server logs, together with the explicit-cleanup harness, are
included in the external evidence archive described above.
CI / ChatOps
This branch is rebased onto the requested
InfiniLM-v0.2.9ctarget. A forkworkflow dispatch passed Check Format and matrix generation for commit
29ddfb9, but its hardware jobs could not acquire the upstream self-hostedrunners. A maintainer has been asked to run
/reteston this PR.Checklist
Title, Branch, and Commits
feat(quantization): support compressed-tensors W8A8 and mixed modules).<type>/xxx-yyyy-zzzz:feat/compressed-tensors-w8a8.InfiniLM-v0.2.9ctarget.fixup!/squash!/wipcommits remain.Scope and Design
TODOremains.General Code Hygiene (applies to all languages)
git diff --checkreports no trailing whitespace or whitespace errors.C++ Specific (if C++ files changed)
new/deletewas introduced.scripts/format.py --check.csrc/models/llama_legacy/were added.Python Specific (if Python files changed)
scripts/format.py --check.python/infinilm/auto_config.pywere added.Testing
examples/test_infer.pywith the public W8A8 and generated hybrid checkpoints on NVIDIA TP1 and TP2.examples/bench.pyfor the BF16/W8A8 comparison.test/bench/test_benchmark.pyon MMLU and C-Eval validation splits.scripts/test_perf.pyworkload completed 64/64 requests; the reported comparison uses the equivalent explicit-cleanup harness because the installed OpenAI/httpx2client emitted teardown warnings.Build, CI, and Tooling
/retestfrom a maintainer after the fork workflow passed format and matrix generation.Documentation
Security and Safety