Repository navigation
Studio: show diffusion training preparation progress - #15337
Merged
Merged
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. |
The status route's response model filtered out the new preparation field, so the UI only ever saw the counts through the legacy message fallback. Declare it on DiffusionTrainingStatusResponse, clear it (and in_model_load) when the worker dies mid-preparation without a terminal event, and keep warnings and stop requests visible in the preparation caption.
A run stopped or failed during preparation reports its terminal status a moment before the worker exits, while active is still true. Treat that as terminal instead of showing "Starting training" with an animated bar.
MiniMax-H3 reports encode_prompts as n/n before it starts caching latents, so a full encode stage is not the end of preparation. [skip ci]
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 26, 2026
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
This was referenced Oct 26, 2026
danielhanchen
added a commit
that referenced
this pull request
Oct 26, 2026
## Problem `trl-internal-testing/tiny-Phi3ForCausalLM` and `trl-internal-testing/tiny-Qwen3_5ForConditionalGeneration` no longer exist on the Hub. The model API returns 404 for both, even with a token. TRL now publishes versioned names instead: - `tiny-Phi3ForCausalLM-3` and `-3.5` - `tiny-Qwen3_5ForConditionalGeneration-3.8`, `-NoThink` and `-Think` Every test that loads one of the old ids fails with `OSError: ... is not a valid model identifier`. This is red on every PR based on current main, in both `Repo tests (CPU, rest)` and `Repo tests (CPU, gloo)` (#15337, #15342): - the `phi3` cases of `test_tp_native_oracle.py` and `test_tp_native_gloo.py` - the Qwen3.5 cases of `test_decision_model.py` and `test_decision_from_lm.py` Nothing in the repo changed; the upstream repos were renamed. ## Fix Point the seven references at the closest renamed repo. I picked each one by diffing its config against the old repo's config, which was still in a local Hub cache: | old | new | config differences | |---|---|---| | `tiny-Phi3ForCausalLM` | `tiny-Phi3ForCausalLM-3` | `vocab_size` 32011 to 32064, `sliding_window` None to 2047, `attention_bias` None to False | | `tiny-Qwen3_5ForConditionalGeneration` | `tiny-Qwen3_5ForConditionalGeneration-NoThink` | `text_config.full_attention_interval` 4 to 2; byte-identical `chat_template.jinja` | I rejected the other candidates: - `tiny-Phi3ForCausalLM-3.5` adds `longrope` scaling and a 131k context. - `tiny-Qwen3_5ForConditionalGeneration-3.8` changes the MLP size, the value heads and the embedding tying, and ships a different chat template. `tiny-Qwen3_5ForConditionalGeneration-NoThink` was already used by one test. No other `trl-internal-testing/*` id referenced under `tests/`, `studio/`, `unsloth/`, `scripts/` or `.github/` is missing from the org's current model list. ## Verification Every test id that failed in CI on #15337 and #15342 for this reason now passes against the downloaded new repos: - `test_tp_native_oracle.py`: `phi3` plan, simulated TP, fused-qkv GQA layout and per-module local heads - `test_tp_native_gloo.py`: `test_tp2_matches_one_process[phi3]`, `test_sharded_loading_matches_full_load[phi3-2-None]`, `test_tp2_x_fsdp2_dp2_matches_one_process[phi3-True-None]` and `test_tp2_phi3_fused_qkv_under_a_packed_plan_matches_one_process` - `test_decision_model.py`: the clef encoding, collator and temperature-folding cases - `test_decision_from_lm.py`: the train, save and reload case, and `test_the_decision_notebook_runs_unchanged_on_a_plain_qwen3_5` That is 45 + 1 passed. The wider selection over the seven touched files passes as well: 187 passed, 12 skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Diffusion training shows a fixed zero-percent training bar, empty loss metrics, and an empty chart while it prepares the dataset. Its status text says "Preparing (cache latents 48/60)...", but those counts never reach the progress bar, making a working run look stuck.
Preserve preparation stage/counts in the status response and show preparation separately from optimization. For example, 48/60 fills the preparation bar to 80%; 60/60 says "Training data prepared" and explains that model setup is finishing. Loading and first-step work of unknown duration use an indeterminate indicator. Training metrics and charts appear after preparation; training steps then own the bar. Older backends' existing preparation messages are supported too.
Validation:
This change reports dataset preparation progress. It does not add model download byte tracking to the diffusion trainer.
Before / after
Tiny SDXL LoRA run, 2000 images with
cache_latents=True, the run card while latents are being cached. Before is the merge base, after is this branch:Follow-up fixes
DiffusionTrainingStatusResponse, which did not declarepreparation, so FastAPI dropped the field from every/api/train/diffusion/statusresponse. The bar still moved, but only through the legacyPreparing (...)message parser, which loses the counts as soon as a warning or a stop request replaces the message.preparationis now declared on the response model, and a route-level test checks that it comes back over HTTP.in_model_loadand the preparation counts stale. That path now clears both.activeis still true. During that window the card showed "Starting training" with an animated bar. A terminal status now wins.encode_promptsas n/n before it caches latents, so a finished encode stage no longer reads as "Training data prepared".Validation of the follow-up
cache_latents=True(48 images), polling the live status route: with the fix,preparationgoes 4/48, 8/48, ... 48/48, then clears atmodel_load_completed. On the previous head the key was absent from every response. Cancelling at 40/400 ends withpreparation: null.test_diffusion_training.py: 140 passed. Both new backend tests fail without the fix.