Skip to content

docs: fix stale #4724 example, rotation kwarg, EoRA save path, and drifted contract refs (#4762) - #4791

Merged
Qubitium merged 1 commit into
mainfrom
root/docs-contract-4762
Nov 17, 2026
Merged

Qubitium merged 1 commit into
mainfrom
root/docs-contract-4762

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

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.

  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-refactor(api): quantize() takes a CalibrationConfig; drop the calibration kwargs (#4393) #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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant