Repository navigation
fix(loader): resolve tt-blockfloat checkpoints under subfolder - #5476
Merged
Merged
Conversation
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.
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.
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:Passing
root/packeddirectly worked, so the two public spellings selected different loaders. The resolvedcheckpoint_diris now used for both the probe and construction.Fixes #5363
What Changed
gptqmodel/models/loader.py: detecttt-blockfloatfromcheckpoint_dirand pass the same directory to_load_tt_blockfloat_model, so the checkpoint's ownconfig.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 underroot/packed, loads it both directly and viasubfolder="packed", and compares the recorded checkpoint root, module types, packedcodes/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/mainata17bddb73with the new test:cd tests python -m pytest test_tenstorrent_support.py::test_gptqmodel_load_accepts_a_blockfloat_checkpoint_selected_by_subfolder -q -raGreen 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 -raThe 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:
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
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
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 whensubfolderis absent.