Repository navigation
docs: fix stale #4724 example, rotation kwarg, EoRA save path, and drifted contract refs (#4762) - #4791
Merged
Conversation
…ntract refs (#4762) Fixes the four docs-vs-code items from #4762. Every corrected snippet was run on CPU (`CUDA_VISIBLE_DEVICES=""`); no model was downloaded. 1. `docs/quantization-lifecycle-contracts.md` no longer builds a pre-bound `CalibrationConfig`. The processor example imports `CalibrationConfig` from `gptqmodel` (not `gptqmodel.looper.loop_processor`) and uses the post-#4724 `CalibrationConfig(...).bind(model.prepare_dataset)` form, because `prepare_dataset` is `init=False` and passing it raises `TypeError`. The run-plan and `LoopPlan` examples now import the names they use, and `docs/calibration-config.md` imports `BACKEND` (it raised `NameError`). 2. Rotation is documented as the `QuantizeConfig.rotation` field, not a `quantize()` keyword, in `docs/quantization-features.md` (table row and Mermaid node) and `docs/rotation-model-support.md` (opening sentence and Mermaid node). `quantize()` has no `rotation` parameter, so the old call raised `TypeError`; the config form is the one `docs/gptq-w4a-gb10.md` already showed. 3. EoRA: `docs/eora/eora_generation.py` now sets `Lora(path=eora_path)` instead of joining `quant_path` and `eora_path`. `save()` writes the adapter to `adapter.path` (`models/writer.py:_eora_save`), so the old join produced `<quant>/<eora>` while the README's evaluation and inference steps read `<eora>`. Save and load now agree for both generation options. The inference snippet's trailing space in `Lora.path` is removed. 4. Contract `file:line` references: re-pointed 72 drifted citations across 40 pages at the definition line the page names, and removed 2 stale `gptqmodel/utils/nf12.py` line refs (that file has 91 lines). Each new line was verified by opening the file, and each replaced citation was checked against the revision that introduced the doc line: where the old number named a `def`/`class`, it was that definition in that revision, so the new number is that symbol's definition today. Line ranges keep their span. Citations that already pointed at a correct usage line were left alone: the issue's heuristic flagged ~100 refs, and this change covers the ones whose named symbol moved, not the whole flagged set. Guard: `tests/test_docs_contract_refs.py` imports every `gptqmodel` name used by the doc blocks this change touches and resolves an explicit list of contract citations (file exists, symbol defined within +-8 lines of the cited line). It also pins the three API contracts above. It downloads nothing and takes ~6 s. On unmodified `main` it fails 15 of 20 cases. Tests: tests/test_docs_contract_refs.py: 20 passed
This was referenced Nov 17, 2026
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.
docs: fix stale #4724 example, rotation kwarg, EoRA save path, and contract refs (#4762)
Fixes the four docs-vs-code items from #4762. Every corrected snippet was run
on CPU (
CUDA_VISIBLE_DEVICES=""); no model was downloaded.docs/quantization-lifecycle-contracts.mdno longer builds a pre-boundCalibrationConfig. The processor example importsCalibrationConfigfromgptqmodel(notgptqmodel.looper.loop_processor) and uses the post-refactor(api): quantize() takes a CalibrationConfig; drop the calibration kwargs (#4393) #4724CalibrationConfig(...).bind(model.prepare_dataset)form, becauseprepare_datasetisinit=Falseand passing it raisesTypeError. Therun-plan and
LoopPlanexamples now import the names they use, anddocs/calibration-config.mdimportsBACKEND(it raisedNameError).Rotation is documented as the
QuantizeConfig.rotationfield, not aquantize()keyword, indocs/quantization-features.md(table row andMermaid node) and
docs/rotation-model-support.md(opening sentence andMermaid node).
quantize()has norotationparameter, so the old callraised
TypeError; the config form is the onedocs/gptq-w4a-gb10.mdalready showed.
EoRA:
docs/eora/eora_generation.pynow setsLora(path=eora_path)instead of joining
quant_pathandeora_path.save()writes theadapter to
adapter.path(models/writer.py:_eora_save), so the old joinproduced
<quant>/<eora>while the README's evaluation and inference stepsread
<eora>. Save and load now agree for both generation options. Theinference snippet's trailing space in
Lora.pathis removed.Contract
file:linereferences: re-pointed 72 drifted citations across 40pages at the definition line the page names, and removed 2 stale
gptqmodel/utils/nf12.pyline refs (that file has 91 lines). Each new linewas verified by opening the file, and each replaced citation was checked
against the revision that introduced the doc line: where the old number
named a
def/class, it was that definition in that revision, so the newnumber is that symbol's definition today. Line ranges keep their span.
Citations that already pointed at a correct usage line were left alone: the
issue's heuristic flagged ~100 refs, and this change covers the ones whose
named symbol moved, not the whole flagged set.
Guard:
tests/test_docs_contract_refs.pyimports everygptqmodelname usedby the doc blocks this change touches and resolves an explicit list of
contract citations (file exists, symbol defined within +-8 lines of the cited
line). It also pins the three API contracts above. It downloads nothing and
takes ~6 s. On unmodified
mainit fails 15 of 20 cases.Tests:
tests/test_docs_contract_refs.py: 20 passed