Skip to content

No-torch install harness: model a feed that resolves the Unsloth / Zoo pair - #16532

Merged
danielhanchen merged 1 commit into
mainfrom
dh/no-torch-harness-pair
Nov 3, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/no-torch-harness-pair

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Since #16157 (95aae40bb4), three installer tests fail on main. On staging CI, Repo tests (CPU, studio-install) failed on #16423, #16182 and #16523 in the last hour:

tests/studio/install/test_ca_trust_floor.py::test_the_full_pass_raises_the_floor_in_both_modes[no-torch-update]
tests/python/test_no_torch_filtering.py::TestInstallPythonStackSubprocessMock::test_update_path_intel_macos_still_skips_overrides
tests/python/test_no_torch_filtering.py::TestInstallPythonStackSubprocessMock::test_update_path_intel_macos_still_skips_triton
studio/install_python_stack.py:10044: in _desktop_unsloth_spec
E   RuntimeError: Could not resolve a compatible unsloth / unsloth-zoo pair for no-torch mode

#16157 makes every no-torch install pin a compatible Unsloth / Zoo pair, read from wheel metadata by _no_torch_pair, and refuse when none resolves. That is deliberate, and its own tests cover it with real offline wheels. The refusal can only trigger when the feed cannot serve Unsloth's metadata, and then the no-deps install would fail anyway, so I left the product as it is.

All three failing tests run install_python_stack() through TestInstallPythonStackSubprocessMock._capture_install, which mocks every subprocess.run to return 0 and write nothing. The pair probe then finds no installed metadata and returns None, so every no-torch update path through this harness now stops before reaching what the test checks: the CA trust floor, and the Intel macOS override and triton skips.

Change

tests/python/test_no_torch_filtering.py: _capture_install also patches ips._no_torch_pair to return a resolved pair, modelling a feed that serves one, as a real index does. No assertion changes. The pair logic itself stays covered by tests/python/test_desktop_unsloth_spec_no_deps_pair.py, which runs the real probe against real wheels.

Testing

  • tests/python/test_no_torch_filtering.py, tests/studio/install/test_ca_trust_floor.py, tests/python/test_install_python_stack.py and tests/python/test_desktop_unsloth_spec_no_deps_pair.py:
    • main: 3 failed, with the error above;
    • this branch: 423 passed, 3 skipped.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T07:23:31.660987Z ef39c03 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. Swish!

Reviewed commit: ef39c03a9c

ℹ️ 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 69f489d into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the dh/no-torch-harness-pair branch November 3, 2026 07:24
danielhanchen added a commit that referenced this pull request Nov 3, 2026
)

## Summary

`Repo tests (CPU, studio-install)` is still red on main after #16532.
That PR fixed the shared no-torch harness in
`test_no_torch_filtering.py`. A second test class has the same problem:
it runs `install_python_stack()` in no-torch mode with `subprocess.run`
mocked. It failed on #16534 and #16527, both of which ran on top of
#16532:

```
tests/studio/install/test_rocm_support.py::TestProgressStepCountMatchesTotal::test_progress_reaches_total_without_torch[linux-False]
tests/studio/install/test_rocm_support.py::TestProgressStepCountMatchesTotal::test_progress_reaches_total_without_torch[windows-False]
tests/studio/install/test_rocm_support.py::TestProgressStepCountMatchesTotal::test_progress_reaches_total_without_torch[macos_arm-False]
E   RuntimeError: Could not resolve a compatible unsloth / unsloth-zoo pair for no-torch mode
```

The cause is the same as in #16532. Since #16157, a no-torch install
resolves a compatible Unsloth / Zoo pair from wheel metadata, and it
refuses only when the feed has no such pair. That is right for users,
since such an install would fail anyway. `_run_stack` mocks
`subprocess.run` to return nothing, so the probe finds no metadata and
the full-pass (`SKIP_STUDIO_BASE=0`) cases stop before they reach the
progress count they check.

## Change

`tests/studio/install/test_rocm_support.py`,
`TestProgressStepCountMatchesTotal._run_stack` only: `_no_torch_pair`
returns a compatible pair, which models a feed that serves one. This is
the same model as #16532.

`NO_TORCH` and the new patch share one `patch.multiple`. That `with`
statement already holds 20 context managers, which is Python's limit on
nested blocks: a 21st `patch.object` makes the whole file fail to import
with `SyntaxError: too many statically nested blocks`. The patched
values are otherwise unchanged.

## Testing

`tests/studio/install/test_rocm_support.py`:
- main: 3 failed, 686 passed (the three cases above);
- this branch: 689 passed, 2 skipped.

I also ran `tests/studio/install` plus `tests/python` on this branch.
"Could not resolve a compatible" no longer appears anywhere. 22 other
tests fail locally, in `test_dependency_pass_skips.py` and
`test_e2e_no_torch_sandbox.py`, and they fail the same way on main here.
CI passes them in the same shard, so the cause is this host's
environment.
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