Repository navigation
gpt-oss: accept an absolute transformers_weights inside the local model dir - #16061
Merged
Merged
Conversation
…el dir #15386 checked `config.transformers_weights` for containment against a synthetic `abspath("model_dir")`, so an absolute name pointing inside the real local checkpoint dir (which transformers 4.57.6 joins verbatim and 5.x accepts after checking against model_dir + subfolder) was treated as escaping: the probe returned unknown and a fused bnb 4-bit gpt-oss checkpoint was classified as split. Check local paths against the real dir + subfolder, as transformers does. Test: absolute explicit name inside the dir (with and without subfolder) picks fused; an absolute path outside stays refused. Fails on main, passes here.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[skip ci]
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.
Follow-up to #15386.
Problem
#15386 checks
config.transformers_weightsfor containment against a syntheticabspath("model_dir"). An absolute name that points inside the real local checkpoint directory (transformers 4.57.6 joins it verbatim, 5.x accepts it after checking against the model dir plus subfolder) was treated as escaping the directory. The layout probe then returned unknown and a fused bnb 4-bit gpt-oss checkpoint was classified as split, which loads the experts randomly. Only a hand-edited config writes such a path.Change
Check local paths against the real directory plus subfolder, as transformers does. A path outside the directory is still refused.
Tests
tests/test_gpt_oss_transformers_weights_layout.py, CPU, torch 2.13, transformers 5.17:test_absolute_explicit_name_inside_the_model_dir_decides_the_layout[None],[sub].Not covered
No end to end gpt-oss load; only the layout classification is checked.