Skip to content

docs: model-size guidance for scheme selection, language alignment for calibration data - #3025

Open
spped2000 wants to merge 2 commits into
vllm-project:mainfrom
spped2000:docs/model-size-and-language-guidance
Open

docs: model-size guidance for scheme selection, language alignment for calibration data#3025
spped2000 wants to merge 2 commits into
vllm-project:mainfrom
spped2000:docs/model-size-and-language-guidance

Conversation

@spped2000

Copy link
Copy Markdown

Two documentation gaps I ran into while quantizing Thai models, each backed by paired measurements.

1. choosing-scheme.md — model size, not just GPU

The scheme table answers what can my GPU run. It does not answer what can my model absorb, and that turned out to matter more than hardware for us. Same recipe (NVFP4 W4A4 via QuantizationModifier), same 512-sample calibration set, same machine, paired per-item against each model's own BF16 source with exact McNemar:

Model size Outcome
~30B multiple-choice recovery within noise (−0.5 pt, n.s.)
~7B −2.4 pt knowledge (p=0.02), −10.2 pt instruction following (p=0.0009)

Re-running the same 7B as W4A16 recovered both (−0.7 and −3.7 pt, neither significant) at the same footprint and speed — hence the added rule of thumb to prefer weight-only below ~10B.

The two halves of W4A4 also fail on different task types, which the two arms isolate cleanly: dropping activation quantization fixed instruction following and knowledge, but mathematical reasoning was unchanged (−5.4 vs −5.6 pt, both significant) — that damage comes from the 4-bit weights and weight-only does not rescue it.

2. choosing-dataset.md — language alignment

"Domain alignment" covers general/instruct/code, and all four suggested datasets are English. There is currently no guidance that calibration data language matters, even though calibration is what sets the activation scales. Added a short subsection: use a mixed set (we used 50/50 target-language/English, 512 samples), a snippet for building one, and a note to evaluate in the target language too.

Framing

These are one lab's numbers on one model family (Thai-capable Qwen2/Qwen3 derivatives, NVIDIA GB10). I wrote both sections as a starting prior with an explicit "validate on your own workload" caveat rather than as universal rules — happy to soften or cut anything that reads as over-claiming. All runs were pre-registered before measurement and the artifacts are public: https://github.com/spped2000/thaillm-nvfp4-dgx-spark


Disclosure: prepared with assistance from Claude (Anthropic). Every figure quoted comes from paired runs on the hardware described.

…ent to dataset selection

choosing-scheme.md organizes schemes by GPU capability only, which answers
'what can my GPU run' but not 'what can my model absorb'. Adds a short
section with paired measurements showing 4-bit cost growing sharply as
parameter count falls (~30B W4A4 within noise; ~7B -2.4 knowledge and -10.2
instruction-following, both significant), the practical rule to prefer
W4A16 below ~10B, and the observation that activation and weight
quantization fail on different task types.

choosing-dataset.md has no guidance on the language of calibration data and
every listed dataset is English. Adds a Language alignment subsection with
the mixed-set recommendation, a short snippet for building one, and a note
to evaluate in the target language.

Signed-off-by: spped2000 <spped2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: spped2000 <spped2000@gmail.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@mergify mergify Bot added documentation Improvements or additions to documentation two-reviews When a PR requires two reviews labels Aug 12, 2026
@mergify

mergify Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require one maintainer review 👀 reviews
🔴 Require two reviews 👀 reviews

🔴 Require one maintainer review

Waiting for any of

  • approved-reviews-by=HDCharles
  • approved-reviews-by=brian-dellabetta
  • approved-reviews-by=dsikka
  • approved-reviews-by=kylesayrs
  • approved-reviews-by=yiliu30
This rule is failing.

All PRs must have at least one approving review from a maintainer before merging.

  • any of:
    • approved-reviews-by=HDCharles
    • approved-reviews-by=brian-dellabetta
    • approved-reviews-by=dsikka
    • approved-reviews-by=kylesayrs
    • approved-reviews-by=yiliu30
  • #changes-requested-reviews-by = 0

🔴 Require two reviews

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

PRs labelled "two-reviews" must have at least two approving reviews before merging.

  • #approved-reviews-by >= 2
  • #changes-requested-reviews-by = 0

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to include guidelines on language alignment during calibration and how model size affects the choice of quantization schemes (specifically comparing W4A4 and W4A16). The review feedback suggests correcting a spelling inconsistency ("behaviour" to "behavior") for regional consistency and refining the speed comparison between W4A16 and W4A4 to accurately reflect compute throughput differences at larger batch sizes.

Comment thread docs/steps/choosing-dataset.md Outdated
Comment on lines +50 to +51
A mixed set is usually enough: half target-language, half English preserves
English behaviour while covering the target language's activation ranges. In

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The rest of the documentation consistently uses American English spelling (e.g., 'optimization', 'quantization'). To maintain consistency, 'behaviour' should be spelled as 'behavior'.

Suggested change
A mixed set is usually enough: half target-language, half English preserves
English behaviour while covering the target language's activation ranges. In
A mixed set is usually enough: half target-language, half English preserves
English behavior while covering the target language's activation ranges. In

Comment thread docs/steps/choosing-scheme.md Outdated
Comment on lines +82 to +85
- **Below roughly 10B parameters, prefer weight-only (W4A16) over W4A4**, or
step up to FP8. Re-running the same 7B with W4A16 recovered the knowledge
and instruction-following losses entirely (−0.7 pt and −3.7 pt, neither
significant) at the same size and speed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While W4A16 and W4A4 share the same 4-bit weight footprint (leading to similar memory bandwidth limits at batch size 1), they do not have the same compute speed. W4A4 can leverage 4-bit Tensor Cores (e.g., NVFP4 on Blackwell) for significantly higher compute throughput at larger batch sizes or longer contexts, whereas W4A16 is limited by 16-bit activation math. To avoid misleading users, it is better to qualify the speed comparison.

Suggested change
- **Below roughly 10B parameters, prefer weight-only (W4A16) over W4A4**, or
step up to FP8. Re-running the same 7B with W4A16 recovered the knowledge
and instruction-following losses entirely (−0.7 pt and −3.7 pt, neither
significant) at the same size and speed.
- **Below roughly 10B parameters, prefer weight-only (W4A16) over W4A4**, or
step up to FP8. Re-running the same 7B with W4A16 recovered the knowledge
and instruction-following losses entirely (−0.7 pt and −3.7 pt, neither
significant) at a similar memory footprint (though without the compute speedups of W4A4 at larger batch sizes).

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ac57ed8d-ddca-4b7b-a576-4723d3c81b02

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…d claim

- behaviour -> behavior for consistency with the rest of the docs.
- 'same size and speed' overstated the comparison: W4A16 matches W4A4 only
  where decode is bandwidth-bound. At larger batch or longer context W4A4
  can use 4-bit tensor cores and wins on compute throughput. Qualified.

Signed-off-by: spped2000 <spped2000@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: spped2000 <spped2000@gmail.com>
@spped2000

Copy link
Copy Markdown
Author

Thanks — both points taken, pushed:

  • behaviourbehavior.
  • The speed claim was overstated. My measurement was single-stream decode, which is bandwidth-bound, so the two schemes looked equal there; that does not generalize. Reworded to say W4A16 matches W4A4 only in the bandwidth-bound regime and that W4A4 pulls ahead on compute throughput at larger batch or longer context via 4-bit tensor cores, with a note to measure your own serving shape.

Also adding the ready label now that the PR is code-complete.

@spped2000

Copy link
Copy Markdown
Author

Note: I cannot add the ready label myself (no write access as an outside contributor). The PR is code-complete and the review feedback above is addressed — could a maintainer add ready so the test suite runs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation two-reviews When a PR requires two reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant