Skip to content

fix(studio): track the repository resolved by the training loader - #11462

Merged
Lyxot merged 2 commits into
unslothai:mainfrom
Imagineer99:fix/training-resolved-repo
Sep 22, 2026
Merged

Lyxot merged 2 commits into
unslothai:mainfrom
Imagineer99:fix/training-resolved-repo

Conversation

@Imagineer99

Copy link
Copy Markdown
Member

When the training loader maps a selected model to a different repository, Studio can keep polling the selected repository's cache. Report the resolved target directly from the text/vision loaders and pass it through worker events and training status to the existing download poller, including adapter base repositories.

Keep that target through preparation after model loading, reset it for a new load/run, and avoid showing the previous repository's progress while the new target starts polling. Existing readiness calculations and the Xet watchdog are unchanged; the worker no longer needs a second implementation of model-name mapping.

Supersedes #7649 with the narrower loader-reporting and status-plumbing approach requested in review.

Validation:

  • 321 focused Python tests and 245 training frontend tests passed; production TypeScript checks passed.
  • New loader reporting regressions fail on unchanged main. The preparation-lifecycle regression also detects clearing the target too early.
  • Python lint, diff checks, worktree checks and pre-push checks passed.
  • Full frontend test typechecking hits an existing TS2352 error in tests/sidebar-row-drag.test.ts:906, reproduced on base 917af38947. Targeted ESLint reports the same existing diagnostics as that base.

Verification used CPU/state-level tests; no live GPU download or browser end-to-end run was performed.

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the overlay in studio/frontend/src/features/studio/training-start-overlay.tsx polls the configured repository, so a model that maps to a different repo can show Ready while the worker is still fetching, and the loader callback here reports the real target. One request: the new tests in tests/python/test_loader_resolution_reporting.py assert an exact count of nine call sites and slice loader.py by AST position, which will break on unrelated edits, so could you loosen those before I review?

@Lyxot Lyxot self-assigned this Sep 22, 2026
@Lyxot

Lyxot commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Pushed 47d266f on top of your commit. It is test-only and fixes the three CI failures this PR introduced:

  • studio/backend/tests/test_job_accounts.py::test_owner_training_start_status_cancel_bytes_are_unchanged pins the exact status JSON, so it now includes the new details.model_download_repo_id key.
  • tests/test_source_read_encoding.py flagged the new tests' read_text() calls, which now pass encoding = "utf-8".
  • tests/studio/test_hf_token_validation_tick_contract.py matched the literal return { isStarting: true, startRequestId }, which no longer exists now that tryBeginStarting also resets modelDownloadRepoId. The check still requires the synchronous claim to set isStarting and startRequestId.

Codex review on a staging copy (Lyxot#68, diff identical to this PR at 47d266f) converged: Lyxot#68 (comment)

The first pass raised one P2, answered and resolved in-thread without a code change: after the base finishes, the adapter-only prefetch of a Hub LoRA repo is not tracked. Adapter files are typically a small fraction of the base checkpoint, so it is left for a follow-up if it matters in practice.

CI on the staging PR: 60 passed, 7 skipped, 4 failed. None of the 4 failures come from this change:

  • Repo tests (CPU, studio): 11502 passed, 4 failed (test_chat_response_details_ui_contract.py ×3, test_desktop_reliability_frontend_contract.py ×1). The same 4 fail on main at the merge base 917af38.
  • Frontend build + bundle sanity: the TS2352 in tests/sidebar-row-drag.test.ts:906, also on main.
  • Shell installer tests: AMD GPU-agent name cases, also on main.
  • Composer (ubuntu-latest, browsers): playwright install-deps failed in the fork runner (apt exit 100). It passed on this PR's upstream run.

The jobs that failed upstream because of this PR ((Python 3.13, a-k), Repo tests (CPU, rest)) now pass.

@Lyxot Lyxot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The loader now reports the repo it actually resolves, and the training overlay tracks that repo. Codex converged and staging CI is clean at 47d266f, and the relevant tests pass on a merge with current main.

@Lyxot
Lyxot merged commit b490d56 into unslothai:main Sep 22, 2026
67 of 71 checks passed
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…slothai#11462)

* fix(studio): report the training loader resolved repository

* test(studio): update status and source contracts for the resolved repo field

---------

Co-authored-by: Lyxot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants