Skip to content

fix(loader): resolve tt-blockfloat checkpoints under subfolder - #5476

Merged
Qubitium merged 1 commit into
mainfrom
fix/5363-tt-blockfloat-subfolder
Nov 19, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/5363-tt-blockfloat-subfolder

Conversation

@ZX-ModelCloud

@ZX-ModelCloud ZX-ModelCloud commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

GPTQModel.load(root, subfolder="packed") resolved the checkpoint directory, but the native block-float probe and model build still used the repository root. The nested checkpoint therefore missed the block-float route and fell through to the GPTQ config parser, raising:

ValueError: QuantizeConfig: Unknown quantization format: `tt-blockfloat`.

Passing root/packed directly worked, so the two public spellings selected different loaders. The resolved checkpoint_dir is now used for both the probe and construction.

Fixes #5363

What Changed

  • gptqmodel/models/loader.py: detect tt-blockfloat from checkpoint_dir and pass the same directory to _load_tt_blockfloat_model, so the checkpoint's own config.json, weights, tokenizer, and processor all come from the selected subfolder.
  • tests/test_tenstorrent_support.py: added a regression that saves a one-layer block-float checkpoint under root/packed, loads it both directly and via subfolder="packed", and compares the recorded checkpoint root, module types, packed codes/exponents, and logits.

No API or behavior change for the direct path or for non-block-float checkpoints. No follow-up work is required for this issue.

Tests

Red evidence on unmodified origin/main at a17bddb73 with the new test:

cd tests
python -m pytest test_tenstorrent_support.py::test_gptqmodel_load_accepts_a_blockfloat_checkpoint_selected_by_subfolder -q -ra
FAILED ... ValueError: QuantizeConfig: Unknown quantization format: `tt-blockfloat`.

Green after the fix:

cd tests
python -m pytest test_tenstorrent_support.py::test_gptqmodel_load_accepts_a_blockfloat_checkpoint_selected_by_subfolder -q -ra
python -m pytest test_tenstorrent.py test_checkpoint_subfolder_resolution.py -q -ra
1 passed
151 passed, 15 skipped

The 15 skips are the file's existing explicit TTNN hardware and end-to-end model gates; they are unrelated to this CPU loader path.

Lint:

bash format/check.sh
ruff 0.14.2
All checks passed!

Model Support / Module Plan

Not applicable: no model type, alias, definition, or module plan changed.

AWQ onboarding safety

Not applicable: no model/AWQ grouping, search, replay, or fold change.

Logic Flow Documentation

  • This change does not alter a major logic flow, or the required diagrams and docs page are included below.

The dispatch stages, guards, and fallbacks are unchanged. This is a local correction of which directory is passed to the existing block-float probe and build, so a diagram would restate the one-line diff.

Diagram summary: not applicable.

Review Requirements

  • Reviewed this PR.
  • Checked that the code matches existing project structure, APIs, and conventions.
  • Avoided unnecessary monkeypatching and used the project's normal extension points where possible.
  • Minimized and compacted the impacted code surface.
  • Considered and eliminated potential regressions.

Kernel Accuracy Requirements

Not applicable: no kernel, dispatch implementation, or quantization math changed.

Notes

The direct-path behavior is preserved: resolve_checkpoint_subfolder(root, "") returns the root itself, so the probe and build receive exactly the previous path when subfolder is absent.

The quantized loader resolved checkpoint_dir from subfolder= but probed
and built block-float checkpoints from the repository root. A nested
checkpoint therefore fell through to the GPTQ config parser and failed
with 'Unknown quantization format: tt-blockfloat'.

Use the resolved directory for both the probe and model construction,
and add a regression that compares the direct path with the
parent-plus-subfolder path at the packed-tensor and logits level.
@ZX-ModelCloud
ZX-ModelCloud marked this pull request as ready for review November 19, 2026 07:30
@Qubitium
Qubitium merged commit 0ffac4a into main Nov 19, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/5363-tt-blockfloat-subfolder branch November 19, 2026 07:45
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.

[BUG] GPTQModel.load rejects tt-blockfloat checkpoints selected with subfolder=

2 participants