Skip to content

Studio tests: skip the trainer-backed num_proc veto tests where unsloth_zoo is absent - #18338

Merged
danielhanchen merged 6 commits into
mainfrom
studio-test-packing-pool-zoo-skip
Nov 18, 2026
Merged

danielhanchen merged 6 commits into
mainfrom
studio-test-packing-pool-zoo-skip

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

A test fix for a check that fails on every PR against current main.

1. Trainer-backed num_proc veto tests without unsloth_zoo

These tests, added in #17701, import core.training.trainer, which imports unsloth and so needs unsloth_zoo:

  • test_the_batched_packing_pool_asks_the_same_veto (through _pack_num_proc's lazy import of the trainer);
  • the five test_block_swap_counts_for_the_veto_only_when_it_offloads cases.

Some CPU CI buckets (Repo tests, Python 3.13 a-f) do not install the zoo, so these fail there with ImportError: Unsloth: Please install unsloth_zoo.

Both tests now call a small _trainer_or_skip() helper. It skips the same way test_dataset_preview_role_aliases.py already does when the zoo cannot be imported.

studio/backend/tests/test_dataset_map_num_proc.py:

  • with unsloth_zoo: 40 passed, nothing skipped;
  • without it: 32 passed, 8 skipped (6 failed before).

The Unreal level tools encoding fix and the model picker contract update this PR also carried landed separately on main (#18344, #18372), so this branch now takes main's versions of those files.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 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-18T16:00:43.736332Z 0baf884 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 danielhanchen changed the title Studio tests: skip the trainer-backed num_proc veto tests where unsloth_zoo is absent Studio tests: skip trainer-backed veto tests without unsloth_zoo; Unreal test reads files as utf-8 Nov 18, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@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: 0baf8844d7

ℹ️ 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 added a commit that referenced this pull request Nov 18, 2026
…18357)

## Summary

Six tests in `unsloth_cli/tests/test_eval.py` fail on main since #18319:

```
FAILED test_dataset_task_avoids_explicit_yaml_name[True-.yaml]   (and the other 3 params)
FAILED test_standalone_yaml_is_copied_alone           - assert ['task_0.yaml'] == ['my_task.yaml']
FAILED test_eval_dataset_before_yaml_with_same_task_name - Error: unknown task 'qa'
```

They show up on every PR's CPU test run (for example on the staging runs
for #18332, #18334 and #18338).

## Cause

#18319 stages a standalone custom task YAML as `task_<n>.yaml` instead
of `<task name>.yaml`, so a task name like `../../x` cannot write
outside the staging directory. That change is correct. lm-eval names
tasks by the `task:` / `group:` key inside each file, not by the file
name: `lm_eval/tasks/_index.py` globs `**/*.yaml` and registers
`cfg["task"]` or `cfg["group"]` (checked against lm-eval 0.4.13). The
task name the user passes and sees is unchanged.

The tests were wrong in two ways:

- The fake `TaskManager` used by the CLI integration tests indexed tasks
by `p.stem`. Real lm-eval does not, so a correctly staged `task_1.yaml`
holding `task: qa` read as an unknown task.
- Two unit tests pinned the old staged file name (`custom/qa.yaml`,
`["my_task.yaml"]`).

## Fix

Test-only:

- The fake `TaskManager` now indexes each YAML under the include path by
its in-file `group:` / `task:` key, the same way lm-eval does.
- The two unit tests now check what lm-eval actually reads: exactly one
staged `.yaml`, whose content matches the source file and whose `task:`
key is the requested name.

## Verification

| `unsloth_cli/commands/eval.py` | old tests | these tests |
|---|---|---|
| main (#18319 staging) | 6 failed, 107 passed | 113 passed |
| before #18319 (`<name>.yaml` staging) | 113 passed | 113 passed |
| staged copy has the wrong `task:` key (sabotage) | n/a | 6 failed, 107
passed |

`tests/test_eval_custom_task_staging.py` from #18319 still passes. ruff
check is clean.
@danielhanchen danielhanchen changed the title Studio tests: skip trainer-backed veto tests without unsloth_zoo; Unreal test reads files as utf-8 Tests: skip trainer-backed veto tests without unsloth_zoo; picker contract follows #18253 Nov 18, 2026
…ool-zoo-skip

# Conflicts:
#	tests/studio/test_model_picker_contracts.py

[skip ci]
@danielhanchen danielhanchen changed the title Tests: skip trainer-backed veto tests without unsloth_zoo; picker contract follows #18253 Studio tests: skip the trainer-backed num_proc veto tests where unsloth_zoo is absent Nov 18, 2026
@danielhanchen
danielhanchen merged commit 287a36c into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the studio-test-packing-pool-zoo-skip branch November 18, 2026 18:57
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