Repository navigation
Report measured model loading and 4-bit conversion during image training - #15536
Conversation
53a0800 to
1ce53aa
Compare
…5501 (#15549) `Source lint` and `workflow-trigger lint` (`tests/security/test_lint_risky_loaders.py::test_the_tree_matches_the_baseline`) fail on main since #15501 merged, and so on every PR based after it (e.g. #15536, job 122152574837): ``` 1 risky loader call site(s) not in the baseline: unsloth/_cpu_init.py:205 [dynamic-import] spec_from_file_location ``` #15501 added `_load_dataprep` to the CPU backend init, which loads `unsloth/dataprep/raw_text.py` and `ebooks.py` by file (so it skips `dataprep/__init__`, which needs a GPU device type). The call is safe, but the baseline entry was not recorded before it merged. ## Review - The path is `Path(__file__).resolve().parent / "dataprep" / f"{name}.py"`, inside the installed package. - The only callers pass the constants `"raw_text"` and `"ebooks"`, and `_load_dataprep` is deleted right after, so nothing else can reach it. - This is the same shape as the existing `unsloth/__init__.py` entry that loads `dataprep/ebooks.py` by file on MLX. ## Change One entry from `python scripts/lint_risky_loaders.py --update`, with the reason filled in. Nothing else in the baseline moves. ## Verification - `python scripts/lint_risky_loaders.py`: main reports the site above and exits 1; this branch prints `ok: 111 risky loader call site(s), all recorded`. - `tests/security/test_lint_risky_loaders.py`: main 1 failed, 45 passed; this branch 46 passed. - The entry is digest-pinned to the call: changing its path argument to `os.environ["X_DATAPREP"]` reopens the site and the lint exits 1 again.
|
|
|
This PR adds measured progress while Unsloth prepares an image-training model, including loading and 4-bit conversion. Model loading and 4-bit conversion: before, the page shows generic loading feedback with an indeterminate bar. After, it reports completed work: 28 of 62 weight tensors processed → 45%, with clearer wording that downloaded files are reused while conversion runs in memory each time. Encoder loading: the page also identifies the conditioning stage and reports component progress—1 of 3 components → 33% in this scene. Compared the PR merge base All six states passed on both revisions (12 captures), including fallback without measured counts and switching correctly to download, preparation, and training feedback. |
|
Review record for #15536, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#621. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
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. |


Image training can spend a long time loading weights or converting them to 4-bit without reporting how much work is complete. This adds scoped loader observers in the training worker and carries successful tensor/component/shard counts through the service and HTTP status schema to the existing progress UI. Conversion is credited only after it succeeds; the text explains that cached downloaded weights can still be converted in memory on each run.
This PR targets main and is independent of #15535. Either PR can be reviewed and merged first.
The existing shared download manager remains responsible for HTTP/XET transfers. Active downloads suppress retained loading counts, and preparation, training, cancellation/error/completion clear them. The observers restore library hooks on exit and fall back to ordinary waiting feedback for unsupported loader API shapes.
Validation on the independent branch:
No new full-size FLUX training run is claimed. Basic UI/music refinements, download readiness/preflight and reusable quantized weights are outside this PR.
UI before / after
Both builds were served the same mid-load status (4-bit conversion, 28 of 62 weight tensors). Main shows the generic loading card with an elapsed timer and an empty bar; this branch shows the conversion stage, the measured count and 45%.