Skip to content

gpt-oss: accept an absolute transformers_weights inside the local model dir - #16061

Merged
danielhanchen merged 3 commits into
mainfrom
dh/s9-15386-abs-transformers-weights
Oct 30, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
dh/s9-15386-abs-transformers-weights

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #15386.

Problem

#15386 checks config.transformers_weights for containment against a synthetic abspath("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:

  • main: 2 failed, 6 passed. Failing: test_absolute_explicit_name_inside_the_model_dir_decides_the_layout[None], [sub].
  • this branch: 8 passed.

Not covered

No end to end gpt-oss load; only the layout classification is checked.

…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.
@danielhanchen danielhanchen self-assigned this Oct 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T03:40:38.321412Z 1eaa352 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 1eaa35231f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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]
@danielhanchen
danielhanchen merged commit d4ebf72 into main Oct 30, 2026
@danielhanchen
danielhanchen deleted the dh/s9-15386-abs-transformers-weights branch October 30, 2026 04:55
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