Skip to content

feat(nf12): public nf12 name and nf12_packed key - #3627

Merged
Qubitium merged 1 commit into
ModelCloud:mainfrom
Qubitium:feat/nf12-public-name
Nov 8, 2026
Merged

Qubitium merged 1 commit into
ModelCloud:mainfrom
Qubitium:feat/nf12-public-name

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #3573.

  • Public name is now nf12. METHOD.NF12_AD and FORMAT.NF12_AD serialize
    as "nf12", matching the paper, AlpinDale's library and vLLM's
    --quantization nf12. The enum members, class names and files are unchanged.
  • Internal symbols stay nf12_ad. libnf12_ad.so, the JIT cache dir,
    QUANT_TYPE, BACKEND.NF12_AD and gptqmodel_ext/nf12_hip/ keep the
    _ad suffix so they cannot collide with an installed upstream nf12
    package or its torch.ops.nf12.
  • Packed tensor is nf12_packed, not qweight, matching the upstream
    serialization names (nf12_packed / nf12_escapes / nf12_exp_base).
    The HF load bridge discovers NF12 modules by .nf12_packed.
  • No backward-compatibility aliases for the old nf12_ad string.

Files

File Change
gptqmodel/quantization/config.py METHOD/FORMAT value nf12_ad → nf12
gptqmodel/utils/backend.py legacy backend map keyed by nf12
gptqmodel/nn_modules/qlinear/nf12_ad.py buffer qweight → nf12_packed
gptqmodel/utils/hf_load.py discover NF12 modules by .nf12_packed
gptqmodel/models/auto.py, base.py, utils/model.py messages/comments
README.md, CREDITS.md, gptqmodel_ext/nf12/README.md public name + tensor key

Validation

Suite Result
test_nf12_ad_codec + test_backend_naming + test_quant_bits_validation + test_rocm_llc 229 passed
test_hf_gptqmodel_load_bridge 18 passed
ruff check (changed files) clean

The packed buffers are now ['nf12_escapes', 'nf12_exp_base', 'nf12_packed'];
a save/load round-trip reproduces identical bytes.

Expose the method/format string as `nf12` so it matches the paper, the
upstream library and vLLM. Internal symbols keep the `nf12_ad` suffix
(libs, JIT cache, QUANT_TYPE, BACKEND) so they cannot collide with an
installed upstream `nf12` package.

Store the packed weight as `nf12_packed` instead of `qweight`, matching
the upstream serialization names. No backward-compatibility aliases.
@Qubitium
Qubitium force-pushed the feat/nf12-public-name branch from 6e0ed1e to a69114a Compare November 8, 2026 11:28
@Qubitium
Qubitium merged commit 0eff760 into ModelCloud:main Nov 8, 2026
1 check 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