Skip to content

tests: stub the tensor parallel guard in the for_training extraction harness - #15498

Merged
danielhanchen merged 1 commit into
mainfrom
fix/for-training-test-tp-stub
Oct 27, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/for-training-test-tp-stub

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

tests/test_for_training_generation_flag.py fails on main, in the Repo tests (CPU, rest) job (all 8 cases):

unsloth/models/llama.py:5526: in for_training
    _tensor_parallel_for_training(model)
E   TypeError: 'NoneType' object is not callable

Since #15368, for_training calls _tensor_parallel_for_training(model) first. The test compiles for_training out of llama.py with a fixed set of _utils.py helpers into its own namespace, and that helper is not one of them. These tests have no tensor parallel world, so the namespace now gets a no-op for it. Test-only change.

main this PR
torch 2.13 / transformers 5.17 8 failed 8 passed
torch 2.6 / transformers 4.57.6 8 passed

…harness

for_training calls _tensor_parallel_for_training first since #15368; the test
compiles for_training out of llama.py into its own namespace without that
helper, so every case raised TypeError: 'NoneType' object is not callable.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T05:20:46.623538Z 63d3c44 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 63d3c4440e

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 945bf3f into main Oct 27, 2026
8 of 15 checks passed
@danielhanchen
danielhanchen deleted the fix/for-training-test-tp-stub branch October 27, 2026 06:23
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