Repository navigation
Jetson / Rosetta follow-ups: an explicit GPU index beats the Jetson CPU record, JetPack 7 off the CPU note - #14494
Conversation
…cord, JetPack 7 off the CPU note, hermetic tests - _expected_cpu_flavor_was_chosen: an explicit UNSLOTH_TORCH_INDEX_URL/_FAMILY naming a GPU index is not overridden by the automatic cpu record on a pre-CUDA-13 Jetson (torch_cpu_build reported as before). - install.sh CPU note: with no driver CUDA answer (GPU-less container), L4T R38+ or tegra264 is JetPack 7 and keeps the 'No GPU detected' note, as utils/tegra.py decides. - Tests no longer depend on the host: tegra_before_cuda13 stubbed in test_torch_cpu_build_on_nvidia_host, _running_under_rosetta stubbed in the MLX platform matrix and the video CPU opt-in tests.
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 |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Swish! 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". |
## Problem Five checks fail on main, so the `Repo tests (CPU, studio)`, `Repo tests (CPU, rest)` and `workflow-trigger lint` shards are red on every open PR (for example #14472, #14482, #14488, #14490 and #14494). All five reproduce on main `4d7ebf5cea`. | Test | Introduced by | Fault | |---|---|---| | `tests/security/test_lint_risky_loaders.py::test_the_tree_matches_the_baseline` | #14437 | Baseline. Two new dynamic-import sites: `import_module` in `studio/backend/core/rag/embeddings.py`, and a third `import_from_string` in `unsloth/models/sentence_transformer.py` (`_require_word_tokenizer`). Both are safe, see below. | | `tests/studio/test_tauri_branding_contract.py::test_desktop_surfaces_do_not_restore_studio_branding` | #14473 | Product. "Studio" became "Unsloth Studio" in the Markdown import errors and the Tauri webview reject message. The desktop contract allows "Unsloth" there, never "Unsloth Studio". "Unsloth" meets both #14473's rule (no bare "Studio") and this one. | | `tests/studio/test_usage_examples_model_source_contract.py::test_auto_switch_section_sits_above_the_usage_examples` | #14455 | Test. The redesign moved the usage examples above the monitor link on purpose, and its own `api-settings-tab.test.ts` pins that. | | `tests/studio/test_usage_examples_model_source_contract.py::test_monitor_can_unload_the_loaded_model` | #14455 | Test. Unloading moved from a standalone button on the page into the model picker's eject (`ApiModelLoadControls`). The `/unload` path itself is unchanged. | | `tests/studio/test_settings_compact_overflow_contract.py::test_api_monitor_entries_and_expanded_text_can_shrink` | #14455 | Test. Entry rows are now rounded cards (no `border-b`), and the prompt/reply box's `rounded-lg` became conditional, so the class literals the test matched are gone. The overflow guards themselves are still in the source. | ## Fix - **Risky loaders:** two baseline entries with reasons. - `embeddings.py` imports only the three `sentence_transformers.models` paths written out in a literal tuple, to wrap their `import_from_string` with the trust gate. - `_require_word_tokenizer` imports only after its caller has refused any `tokenizer_class` outside `sentence_transformers.*`, and only dotted identifiers. - **Branding:** "Unsloth Studio" to "Unsloth" in those seven Markdown import errors and the Rust reject message. `conversation-markdown-import.test.ts` now matches `/Unsloth Markdown/`. - **#14455 contracts:** rewritten to guard what the redesign keeps: - the auto-switch section still follows the monitor link, and the usage examples come before both; - the page passes `unloadActiveModel` to the load controls as `onUnloadActive`, and eject is withheld while `busy` (`modelLoading || unloading`, #11223's rule); - the `/unload` call still reads the internal id from status; - entry rows keep `w-full min-w-0`; - the prompt/reply box keeps `max-h-72 overflow-auto break-words`; - the model id keeps `min-w-0 break-all`. ## Verification - The four Python files: 78 passed (5 failed on main). - `studio/frontend/tests/conversation-markdown-import.test.ts`: 20 passed. - Sabotage, each run against the rewritten tests, each failing exactly one test: - removing `min-w-0` from the entry row, or `break-words` from the text box: the overflow test fails; - dropping `unloading` from `busy`, or passing `onEject` while busy: the unload test fails; - putting the auto-switch section above the monitor link: the order test fails.
…fixed list (#14518) ## Problem The `Repo tests (CPU, fsdp2)` shard fails on main: 11 tests across the gloo files that wrap `Trainer.__init__` with `_install_wrapped_trainer_init` from `tests/test_fsdp2_native_trainer_args_gloo.py` (for example #14494). Every rank crashes the same way: ``` File "unsloth/models/_utils.py", line 5615, in _unsloth_trainer_init _size_auto_checkpoint_skip_for_trainer(self) NameError: name '_size_auto_checkpoint_skip_for_trainer' is not defined ``` The harness runs the real `_unsloth_trainer_init` source from `_utils.py` in a namespace that stubs the helpers it calls. That list is written out by hand. #14404 added a call to `_size_auto_checkpoint_skip_for_trainer`, which is not in the list. The product is fine: the helper is defined at module level in `_utils.py`. ## Fix Test only. The explicit stubs stay. On top of them, every free function `_unsloth_trainer_init` calls that the namespace does not provide is stubbed as well. Builtins, and names the wrapper binds itself (assignments and in-function imports), are excluded. The next helper added to the wrapper cannot take the shard down this way again. ## Verification CPU torch 2.10, peft 0.21.2, accelerate 1.15.0, unsloth-zoo main. Files run: `test_fsdp2_native_optim_reentry_gloo.py`, `test_fsdp2_native_trainer_fsdp_clip_gloo.py`, `test_fsdp2_native_subclass_optimizer_gloo.py` and `test_fsdp2_native_trainer_args_gloo.py`. - main: 5 failed, 12 passed (the `NameError` above). - With this change: 17 passed.
…utoopt parity checks (#14522) ## Problem #14473 renamed user-facing "Studio" to "Unsloth" in the backend messages, but three tests still expect the old wording. They fail on main and on open PRs (for example #14494 and #14488): | Test | Expects | Product now says | |---|---|---| | `test_sandbox_linux.py::test_an_interpreter_symlinked_out_of_the_workdir_fails_the_call` | `Python that runs Studio` | `Python that runs Unsloth` (`sandbox_linux.py`) | | `test_diffusion_attention.py::test_a_hidden_xformers_is_not_reinstalled_in_the_same_process` | `restart Studio` | `restart Unsloth` (`diffusion_attention.py`) | | `test_diffusion_autoopt_parity.py` (two tests) | `the Studio fast step that replays decode steps from tensors`, 16 times in `fixtures/diffusion_autoopt_parity.json` | `the Unsloth fast step ...` (`diffusion_capture_safe.py`) | The rename was intended, so the tests are what is out of date. ## Fix Test only. Both assertions and the 16 recorded reasons in the parity fixture now use "Unsloth". Those 16 strings were the only "Studio" in the fixture. Nothing else in it changes. ## Verification - `test_sandbox_linux.py` and `test_diffusion_attention.py`: both target tests fail on main and pass with this change. - The one remaining local failure, `test_active_attention_backend_reads_tuple_return`, is an `ImportError` from this host's `huggingface_hub` and fails the same way on main. - `test_diffusion_autoopt_parity.py` (CPU torch 2.10, diffusers 0.41.0.dev0): - with main's fixture: 2 failed, 1 passed; - with this change: 3 passed.
Summary
Follow-up to #14363 and #14374 from a post-merge regression review.
What changes
cpurecord, an explicitUNSLOTH_TORCH_INDEX_FAMILY=cu126(or a cu126 index URL) was overridden and Studio hid the CPU-only PyTorch report. The stated index is now checked before the Jetson exception.install.shnow decides JetPack 7 the wayutils/tegra.pydoes (L4T R38+, ortegra264with no release file).Tests