Commit graph

6,540 commits

Author SHA1 Message Date
Daniel Han
c38ae1cef5 Widen the load request type for the explicit Dtype off value
The Dtype select now sends none through instead of omitting it, so the
request type must accept it (tsc caught the mismatch at the badges tip).
2026-07-04 09:46:38 +00:00
pre-commit-ci[bot]
4719a51601 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 09:44:31 +00:00
Daniel Han
56636401aa Merge branch 'diffusion-auto-policy' of https://github.com/unslothai/unsloth into diffusion-auto-policy 2026-07-04 09:43:56 +00:00
Daniel Han
9a34934030 Dtype defaults to auto: unset resolves by hardware, explicit off pins the GGUF
An unset transformer_quant used to mean off (run the GGUF as-is), so the
hardware ladder only engaged when auto was explicitly chosen and the panel
showed Off as the default. Unset (or auto) now hands the decision to the
ladder: a dense-capable GPU gets at least int8, data-center silicon fp8,
falling back to the GGUF when the device, VRAM, family deny table or disk
cannot take it. An explicit none/off pins GGUF-as-is and is now
expressible in the API (previously only omission meant off, so pinned-off
and unset were indistinguishable); an explicit scheme pins that scheme.

The dense candidate also gains a free-disk gate: with auto as the default
the bf16 base download (up to ~40 GB) must never wedge a nearly-full
model-cache disk, so the candidate is dropped (GGUF build kept) when free
space cannot hold it plus a 10 GiB margin. Unprobeable disk passes.

Frontend: the Dtype select defaults to Auto (fastest for GPU), keeps Off
as an explicit choice, and sends none through instead of omitting it.

Suite: 622 diffusion tests green (default-load test rewritten to the new
contract, explicit-off short-circuit covered), CI-sim green.
2026-07-04 09:43:43 +00:00
pre-commit-ci[bot]
bc612370f2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 08:55:46 +00:00
Daniel Han
4c4f432330 Thread the family into the auto-policy dense-quant candidate
resolve_dense_quant_candidate now passes fam.name to
select_transformer_quant_scheme so the policy's proposed scheme honors the
family deny table (qwen-image lands on int8 instead of proposing fp8 that
the execution path would refuse). Test stub updated for the new keyword.
2026-07-04 08:55:11 +00:00
Daniel Han
a4833a5c37 Merge diffusion-train-perf2: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:54:07 +00:00
Daniel Han
243b7b5dbd Merge diffusion-krea2: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:53:03 +00:00
Daniel Han
ef03dd2780 Merge diffusion-train-tab-2: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:52:32 +00:00
Daniel Han
200543daca Merge diffusion-train-precision: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:52:22 +00:00
Daniel Han
7aac4770cd Merge diffusion-train-perf: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:52:13 +00:00
Daniel Han
92ac400bbb Merge image-generation: qwen dense-quant family deny (black frames, measured) 2026-07-04 08:52:03 +00:00
pre-commit-ci[bot]
ab56d81935 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 08:51:46 +00:00
Daniel Han
7bf80f6a4e Deny fp8/mxfp8/nvfp4 dense quant for the Qwen DiT (black frames, measured)
A 28-pair accuracy gate on a B200 (same-seed vs the dense bf16 reference)
found per-row fp8 dynamic quant renders EVERY qwen-image frame black
(mean luma 0.0000, SSIM 0.016), reproduced identically with on-the-fly
quantize_ on the dense transformer, so it is the model's activation range,
not a checkpoint artifact. mxfp8 shows real semantic damage at 1024px
(CLIP delta mean 0.0146, worst cases 0.064/0.102) and nvfp4 measures
LPIPS mean 0.51. int8 dynamic (per-token scales) is excellent on Qwen:
LPIPS mean 0.069, SSIM 0.958.

The per-scheme smoke probe only proves the GEMM kernel runs, so it cannot
catch model-level breakage. Add _FAMILY_SCHEME_DENY consulted by
select_transformer_quant_scheme: auto skips denied schemes (Qwen lands on
int8) and an explicit denied request returns None, the same GGUF-fallback
contract as an unsupported scheme. Family is threaded from the three
diffusion.py call sites; existing behavior is unchanged for every other
family. 4 new tests; 529 diffusion tests green; CI-sim green.
2026-07-04 08:51:10 +00:00
pre-commit-ci[bot]
21bdb9741d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 08:22:15 +00:00
pre-commit-ci[bot]
310849726e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 08:21:43 +00:00
Daniel Han
5fb79d39ad Merge diffusion-train-perf2: torchao probe stub in precision-mode tests 2026-07-04 08:21:14 +00:00
Daniel Han
5df56c0804 Stub the torchao probe in the precision-mode capability tests
train_precision_modes gates int8/fp8/mxfp8 on has_functional_torchao, and the
Backend CI runner does not install torchao, so the three capability-gating
tests collapsed to nf4/bf16/auto and failed. They exercise the CAPABILITY
gate, not torchao presence: stub the probe functional alongside the CUDA
capability patch. Validated with a torchao-blocked run (22 passed).
2026-07-04 08:21:07 +00:00
Daniel Han
02b496cf03 Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-04 07:27:06 +00:00
Daniel Han
0393e5c398 Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-04 07:27:05 +00:00
Daniel Han
466f86c45a Skip the krea-2 forward roundtrip test on hosts without diffusers
spec.forward imports Krea2Pipeline for prepare_position_ids, so the test needs a
real diffusers install; the backend CI matrix runs without one and failed on the
import. Same importorskip guard the sigmas gather test already uses.
2026-07-04 07:26:56 +00:00
pre-commit-ci[bot]
df5c829732 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 06:50:45 +00:00
Daniel Han
a8e708f66e Add the diffusion auto-policy layer: per-family footprint estimates and the dense-quant re-plan
The loader used to plan memory from the GGUF file size and only offer the dense
transformer-quant fast path when that plan was already resident, so on a card where
the GGUF forced offload the int8/fp8 build (roughly half the bf16 bytes, or exactly
the quantised size when a pre-quantized checkpoint exists) was never attempted.

diffusion_auto_policy.py is a pure decision layer: a bf16-resident component table
per family (transformer / text encoders / VAE, with base-repo overrides for the
multi-size families), per-scheme size factors with separate steady and transient
(build peak) numbers, and resolve_dense_quant_candidate which the loader now uses to
re-plan memory against the candidate artifact before settling for offload. The
engaged plan is adopted only when the dense build succeeds; the GGUF fallback keeps
its own plan.

Status now carries a resolved provenance record per Advanced control (value, source
auto or explicit, reason) so the UI can label backend decisions.
2026-07-04 06:49:49 +00:00
Daniel Han
e39ae8fb58 Merge diffusion-krea2: Dtype rename and empty-state copy 2026-07-04 06:17:58 +00:00
Daniel Han
2459bdbbf1 Merge diffusion-train-tab-2: Dtype rename and empty-state copy 2026-07-04 06:17:57 +00:00
Daniel Han
b219118ff0 Merge diffusion-train-precision: Dtype rename and empty-state copy 2026-07-04 06:17:56 +00:00
Daniel Han
be9aa7c9b3 Merge diffusion-train-perf: Dtype rename and empty-state copy 2026-07-04 06:17:55 +00:00
Daniel Han
168afdf6f1 Merge image-generation: Dtype rename and empty-state copy 2026-07-04 06:17:54 +00:00
Daniel Han
d146209f88 Rename the GGUF compute control to Dtype and simplify the empty-state copy
The always-visible description under the select is gone (the hint tooltip keeps the
full detail) and the no-model gallery placeholder now reads 'Select a diffusion model
to load'.
2026-07-04 06:17:45 +00:00
Daniel Han
8e589f8b27 Merge diffusion-krea2: CI test fixes (diffusers import order, arbiter device pin, sigma-gather skip) 2026-07-04 05:08:51 +00:00
pre-commit-ci[bot]
e6d775d0fc [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 05:08:43 +00:00
Daniel Han
8324cdc407 Merge diffusion-train-tab-2: CI test fixes (diffusers import order, arbiter device pin, sigma-gather skip) 2026-07-04 05:08:18 +00:00
Daniel Han
3fcf218614 Merge diffusion-train-precision: CI test fixes (diffusers import order, arbiter device pin, sigma-gather skip) 2026-07-04 05:07:46 +00:00
Daniel Han
f5d5b09ae5 Merge diffusion-train-perf: CI test fixes (diffusers import order, arbiter device pin, sigma-gather skip) 2026-07-04 05:06:59 +00:00
Daniel Han
c63df7d918 Merge image-generation: CI test fixes (diffusers import order, arbiter device pin) 2026-07-04 05:05:54 +00:00
Daniel Han
f1007fb466 Skip the sigma-gather test when diffusers is not installed
CI runs the backend suite without diffusers; the test checks our index math against
the scheduler's own gather, so it skips rather than fails there.
2026-07-04 05:05:54 +00:00
Daniel Han
1d3aa53d1f Validate the training config before importing diffusers and pin the arbiter test's device
The fp16-on-bf16-family refusal in run_dit_lora_training now fires before the heavy
imports, so a host without diffusers gets the real validation error instead of
ModuleNotFoundError. test_in_progress_returns_409_after_validation_passes pins the
resolved device to cuda because the load route only takes the GPU arbiter for non-CPU
loads, which made the ownership assert host-dependent.
2026-07-04 05:01:58 +00:00
Daniel Han
630689032e Merge branch 'image-generation' of https://github.com/unslothai/unsloth into image-generation 2026-07-04 05:01:57 +00:00
pre-commit-ci[bot]
3204874f7e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 04:42:28 +00:00
pre-commit-ci[bot]
6ecbb2b8a3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 04:41:56 +00:00
pre-commit-ci[bot]
96cecf9c47 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 04:41:23 +00:00
pre-commit-ci[bot]
d13ce4c74a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 04:40:51 +00:00
pre-commit-ci[bot]
285c8fbd20 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 04:40:19 +00:00
Daniel Han
67f8f6cfae Merge diffusion-krea2: grad norm reconciliation + review fixes 2026-07-04 04:38:24 +00:00
Daniel Han
a82fc89d03 Merge diffusion-train-tab-2: grad norm reconciliation + review fixes 2026-07-04 04:38:05 +00:00
Daniel Han
325ae8e3ce Merge branch 'diffusion-krea2' of https://github.com/unslothai/unsloth into diffusion-krea2 2026-07-04 04:38:05 +00:00
Daniel Han
a346a0eb20 Merge diffusion-train-precision: grad norm chart + review fixes
# Conflicts:
#	studio/backend/core/training/diffusion_dit_trainer.py
#	studio/backend/core/training/diffusion_lora_trainer.py
#	studio/backend/core/training/diffusion_training_service.py
#	studio/backend/models/training.py
#	studio/frontend/src/features/images/api.ts
#	studio/frontend/src/features/images/train/diffusion-charts.tsx
#	studio/frontend/src/features/images/train/diffusion-train-panel.tsx
2026-07-04 04:37:58 +00:00
Daniel Han
e9b9bdc5f4 Merge branch 'diffusion-train-tab-2' of https://github.com/unslothai/unsloth into diffusion-train-tab-2 2026-07-04 04:33:44 +00:00
Daniel Han
84a661b363 Merge diffusion-train-perf: grad norm chart + review fixes 2026-07-04 04:33:37 +00:00
Daniel Han
223a546cd8 Merge image-generation: grad norm chart, completion state, Windows caption keys, GGUF compute copy
# Conflicts:
#	studio/backend/core/training/diffusion_dit_trainer.py
#	studio/backend/core/training/diffusion_lora_trainer.py
#	studio/backend/core/training/diffusion_training_service.py
2026-07-04 04:33:30 +00:00