Skip to content

Tests: follow the tiled MLP hooks from #16125 (encoding, loader stubs, trainer logger) - #16196

Merged
danielhanchen merged 2 commits into
mainfrom
tests-follow-tiled-mlp-16125
Oct 30, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
tests-follow-tiled-mlp-16125

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Main went red in three Backend CI shards after #16125 (tiled MLP) landed (seen on the staging run for #16071, reproduced on main):

  • Repo tests (CPU, rest): all of tests/test_optimized_precision_conflicts.py fails with NameError: name 'check_tiling_available' is not defined. The fixture runs FastLanguageModel.from_pretrained from loader.py in a hand-built namespace of stubs, and Tiled MLP: one flag or one line for any model, on the new sequence tiling engine #16125 added a check_tiling_available(unsloth_tiled_mlp) call there that the namespace does not provide.
  • Repo tests (CPU, rest-2): tests/test_source_read_encoding.py flags tests/test_tiling_integration.py:148: read_text(). The new test file reads checked-in sources with the platform default encoding (7 calls).
  • Repo tests (CPU, fsdp2): four tests in tests/test_fsdp2_native_accelerator_loop_gloo.py crash every rank with NameError: name 'logger' is not defined from _unsloth_trainer_init. The harness in tests/test_fsdp2_native_trainer_args_gloo.py execs that wrapper in a stub namespace and auto-stubs the bare helper calls it makes. Tiled MLP: one flag or one line for any model, on the new sequence tiling engine #16125 added a try: revalidate_for_trainer(self) except Exception as e: logger.warning_once(...), and in the harness the revalidation raises, so the warning reaches logger, which only exists as the real module's import.

In all three cases the product is right (loader.py imports check_tiling_available, _utils.py imports logger); the tests' namespaces had not followed.

Fix

  • tests/test_optimized_precision_conflicts.py: stub every name loader.py imports from ..tiling, the way the fixture already stubs the Mistral-format helpers. So a future tiling helper called from from_pretrained does not break the precision checks, which never reach tiling.
  • tests/test_tiling_integration.py: every read_text() names encoding = "utf-8".
  • tests/test_fsdp2_native_trainer_args_gloo.py: the harness namespace carries a no-op logger standing in for _utils.py's module logger.

Verification

Before (main) and after (this branch), same local environment:

file main this branch
tests/test_optimized_precision_conflicts.py 20 failed 19 passed
tests/test_fsdp2_native_accelerator_loop_gloo.py 4 failed 5 passed
tests/test_source_read_encoding.py 1 failed passed
tests/test_tiling_integration.py (with unsloth-zoo main for tiling_registry) n/a 50 passed
tests/test_fsdp2_native_trainer_args_gloo.py passed passed

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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 ⚠️ Failed 2026-10-30T20:55:31.373442Z
We couldn’t complete this review. Comment @codex review to try again.
f5b6c0d 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

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@danielhanchen
danielhanchen merged commit 9dc1055 into main Oct 30, 2026
@danielhanchen
danielhanchen deleted the tests-follow-tiled-mlp-16125 branch October 30, 2026 21:16
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