Repository navigation
Multi-LoRA grouped experts: run the grouped support and parity probes only eagerly - #16415
Conversation
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. |
…, not at collection (#16430) ## Summary `(Python 3.13, g-r)` fails on several unrelated PRs (#16413, #16414, #16415): ``` test_hub_source_env_reset_between_tests.py::test_the_next_test_starts_on_the_source_it_inherited E AssertionError: assert 'huggingface' == None E + where 'huggingface' = get('UNSLOTH_STUDIO_HUB_SOURCE') ``` The test reads `_INHERITED = os.environ.get(SOURCE_ENV)` at module import, during collection. Collection goes on after that. Any module collected later that imports the app (for example `tests/test_liveness_reports_*.py` with a module-level `from main import ...`) runs `apply_hub_settings()`, and that always writes `UNSLOTH_STUDIO_HUB_SOURCE`. The conftest fixture `_restore_hub_settings_env` then correctly restores the value each test started with (`huggingface`), but the test compares it against the stale collection-time value (`None`). The fixture is right. The test's baseline is taken too early, and whether it fails depends on which files share the shard. #16236 made it compare against the inherited source, which made it sensitive to this. ## Change The first test records the source env and the "other" source at the moment it starts. That is exactly what the fixture saves and restores. The second test compares against those, and fails with a clear message if it runs without the first one. Nothing else changes. ## Testing - **Repro of the CI failure:** run this file plus a later-collected stand-in module that sets `UNSLOTH_STUDIO_HUB_SOURCE=huggingface` at import, the way the app import does. - main: fails with the same `assert 'huggingface' == None`; - this branch: 3 passed. - This file alone: 2 passed. With `UNSLOTH_STUDIO_HUB_SOURCE=modelscope` in the environment (the case #16236 was for): 2 passed. - Sabotage: with the conftest restore loop disabled, the second test fails again. The test still catches a missing restore.
[skip ci]
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
## Summary `Repo tests (CPU, rest-2)` is red on main since #16415 (`bf38ae0ac6`). On staging CI it hit #16423, #16182 and #16523 in the last hour: ``` tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding, so they break on Windows as soon as that file gains a non-ASCII byte. Pass encoding = "utf-8": ['tests/test_multi_lora_cold_compile_cpu.py:33: read_text()'] ``` #16415's new test parses a checked-in source file with `path.read_text()`. On Windows that decodes with the ANSI codepage, so it breaks as soon as the source file gains a non-ASCII byte. The guard is right. ## Change `tests/test_multi_lora_cold_compile_cpu.py`: `read_text()` becomes `read_text(encoding = "utf-8")`. Nothing else changes. ## Testing - `tests/test_source_read_encoding.py` and `tests/test_multi_lora_cold_compile_cpu.py`: - main: the encoding guard fails as above; - this branch: 20 passed.
Summary
A first call into multi-LoRA experts can fail under
torch.compile(fullgraph=True)because grouped-backend support and numerical-parity probes run during tracing. Cold compiled calls now keep the existing per-adapter path, while eager warmup still enables grouped execution before compilation.Initial adapter selection also uses a first-match loop, preserving the previous selection semantics while avoiding torch 2.6 Dynamo's unsupported
next(generator, default)call.Validation
The switchboard's only DOM-only flag is a crawler fact about a Search button; the corresponding Model Hub screenshot and normalized DOM are byte-identical. UI triage is NO and the UI gate is PROBE.
No timing improvement is claimed. GPU correctness checks used shared hardware; native WSL, Intel XPU, Ascend and multi-GPU kernel execution were not exercised. The change adds no device-specific branch or new kernel.