Repository navigation
Tests: keep the zoo num_proc anchor tests meaningful once the zoo adopts the edit - #13269
Conversation
… edit unsloth_zoo now ships the sft_prepare_dataset worker-count block exactly as rl_replacements.py rewrites it. The canary counted the old anchor in the installed zoo and the drift tests mutated it, so they failed or tested nothing against a newer zoo. Treat an adopted block as done, run the drift tests against the anchored spelling, and pin that an adopted block is left untouched with no warning (the narrow fallback must not rewrite its first line).
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c8ae689da
ℹ️ 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".
|
|
||
| def _zoo_adopted_the_num_proc_edit(source): | ||
| """Whether the Zoo already ships the replacement itself, which the edit's idempotence check leaves alone.""" | ||
| return _num_proc_replacement() in source |
There was a problem hiding this comment.
Normalize quotes when recognizing an adopted block
If the Zoo ships the adopted block with single-quoted strings, _replace_or_fallback correctly treats it as already applied because its _same_source check normalizes quote style, but this exact substring test returns false. Consequently, the anchor canary requires the removed old block, while test_a_zoo_that_adopted_the_num_proc_edit_is_left_alone attempts to replace that nonexistent block and fails its adopted != source assertion, causing CI failures for a Zoo spelling explicitly supported by the production helper.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The zoo block (unslothai/unsloth-zoo#1674) is spelled byte for byte as unsloth's replacement text, so the exact match is what ships; a zoo reformat that changed quote style is what this canary should flag, not silently accept.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
Follow-up to unslothai/unsloth-zoo#1674, which makes
sft_prepare_datasetin the zoo useget_dataset_num_procdirectly.The canary and drift tests in
tests/utils/test_dataset_num_proc.pyread the installed zoo'ssft_prepare_datasetblock and expect the old host-wide text. Against the new zoo they either failed (4 tests) or tested nothing. They now accept a zoo that already adopted the block, run the drift cases against the old anchor text, and add a test that an adopted block is left unchanged, with no warning and valid code.Tests only, no runtime change.
tests/utils/test_dataset_num_proc.py+test_train_on_responses_only_num_proc.py: 139 passed against both the current and the new zoo.