Skip to content

Tests: make the packed host-lengths carry test independent of test order - #18525

Merged
danielhanchen merged 1 commit into
mainfrom
ci/packed-carry-test-self-contained
Nov 19, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/packed-carry-test-self-contained

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, rest) fails intermittently (seen on #18519, which only touches Studio diffusion training):

FAILED tests/test_packed_host_lengths_and_eval_flush.py::test_carry_leaves_other_moves_alone
tests/test_packed_host_lengths_and_eval_flush.py:65: in test_carry_leaves_other_moves_alone
    assert accelerate_data_loader.send_to_device._unsloth_host_lengths_carry
E   AttributeError: 'function' object has no attribute '_unsloth_host_lengths_carry'

Reproduced on main by running that test on its own: 1 failed.

Root cause

#18494 added the test. It asserts that accelerate.data_loader.send_to_device carries Unsloth's host-lengths wrapper, but nothing in the test installs it: the wrapper is installed by packing.enable_padding_free_metadata(), which only the test above it calls. Under xdist the two tests can land on different workers, or run in the other order, and then the assertion reads the stock send_to_device. The product code is fine; the test depended on its neighbour.

Changes

  • The test calls packing._install_host_lengths_carry() first. It is idempotent (it returns early when the wrapper is already in place), so the test now states its own precondition and keeps checking the same three things: no tuple on an unrelated move, none on a plain batch, and the wrapper marker.

Testing

  • test_carry_leaves_other_moves_alone alone: passes (fails on main).
  • The whole file, in order and under -n 3: 3 passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T20:14:21.036726Z 6922c6f 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. Nice work!

Reviewed commit: 6922c6f2cb

ℹ️ 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 0027fd2 into main Nov 19, 2026
@danielhanchen
danielhanchen deleted the ci/packed-carry-test-self-contained branch November 19, 2026 20:14
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