Commit graph

2,231 commits

Author SHA1 Message Date
Daniel Han
71c20ded19 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 00:31:31 +00:00
Daniel Han
79b97e9ad0 Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 00:31:30 +00:00
Daniel Han
ad7d5c6827 Coerce cache_latents and enable_tf32 string flags in the config dict path
The generic Studio config dict path can deliver these flags as strings, and a
non-empty string like "false" is truthy, so an opt-out silently no-ops (the
latent cache still builds, TF32 stays on). Coerce them the same way
gradient_checkpointing already is.
2026-07-05 00:12:47 +00:00
Daniel Han
97f90e609c Merge remote-tracking branch 'origin/diffusion-train-precision' into diffusion-train-tab-2 2026-07-04 13:49:19 +00:00
Daniel Han
5b090bc0f0 Merge remote-tracking branch 'origin/diffusion-train-perf' into diffusion-train-precision 2026-07-04 13:49:18 +00:00
Daniel Han
da5f4232e3 Merge remote-tracking branch 'origin/image-generation' into diffusion-train-perf 2026-07-04 13:49:17 +00:00
Daniel Han
c241886c67 Merge branch 'image-generation' of https://github.com/unslothai/unsloth into image-generation 2026-07-04 13:47:00 +00:00
Daniel Han
24de50062c Enable conv-direct in the default native speed profile
Measured on the fresh linux x64 prebuilt (z-image Q8_0, sd-cli, 192 CPU
threads, 512x512, 9 steps, steady state): sampling 56.1s vs 51.3s (about
9 percent faster), VAE decode unchanged, peak RSS identical. The sd.cpp
engine only serves the no-GPU tier, so the default profile now matches
max: --diffusion-fa plus --diffusion-conv-direct.
2026-07-04 13:46:59 +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
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
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
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]
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
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
Daniel Han
2c5955bda8 Coerce num_epochs in normalized() and use utf-8 for run records
num_epochs was only int-coerced for the range check, so a string value
from a dict-built config would reach resolve_train_steps' arithmetic;
normalized() now stores the coerced int. Run record reads/writes pass
encoding utf-8 explicitly so non-ASCII prompts survive on Windows
2026-07-04 04:31:07 +00:00
Daniel Han
8ad8a58742 Add grad norm chart, clearer completion state, Windows caption keys, GGUF compute copy
- Trainers emit the pre-clip gradient norm; the service keeps a bounded
  grad_norm history and the Train tab renders a Grad Norm chart next to
  Loss and LR
- Completed runs show 'Training complete' with a celebratory marker in
  the success color instead of a plain status word
- metadata.jsonl caption keys now match on Windows (as_posix relative
  paths) in both the trainer discovery and the dataset image records
- RMSNorm eager patch skips installation on torch builds without
  F.rms_norm instead of failing at forward time
- GGUF compute description no longer says the GGUF is dequantised: the
  INT8/FP8/FP4 modes load the base model's bf16 transformer and quantise
  that directly; label no longer wraps in the Advanced panel
2026-07-04 04:31:04 +00:00
pre-commit-ci[bot]
d8495d058f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 03:30:53 +00:00
pre-commit-ci[bot]
f2af2874df [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 03:30:20 +00:00
pre-commit-ci[bot]
32556949ce [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 03:29:49 +00:00
pre-commit-ci[bot]
07f27b23e8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 03:29:17 +00:00
Daniel Han
7a8f363c52 Merge diffusion-train-precision: torchao functional probe + image-generation review fixes 2026-07-04 03:25:08 +00:00
Daniel Han
a4a38b5672 Merge diffusion-train-perf: image-generation review fixes 2026-07-04 03:24:44 +00:00
Daniel Han
7d6c022489 Merge image-generation: review fixes (engine unload, caption precedence, dataset counts, local diffusers tagging, family LoRA targets)
# Conflicts:
#	studio/backend/core/training/diffusion_dit_trainer.py
2026-07-04 03:24:38 +00:00
Daniel Han
51de9da488 Fix review findings: run history robustness, epoch-mode sentinel, seed 0, history refresh race
- list_diffusion_runs skips wrong-shape records and the runs route tolerates
  per-record ValidationError so one bad file never breaks the panel
- max_steps: 0 epoch-mode sentinel no longer trips train_steps validation
  before epochs are resolved
- numberField keeps an explicit 0 (Seed, LR warmup) instead of falling back
- previous-runs list refetches once more shortly after a terminal status so
  the just-finished run appears even if the record write races the fetch
2026-07-04 03:23:20 +00:00
Daniel Han
89d99e31af Gate int8 and fp8 on a functional torchao import, not find_spec
The Windows ROCm torchao import stub satisfies find_spec and even lets
from torchao.quantization import quantize_ succeed, but its quantize_ is a
no-op: auto would pick int8, leave the transformer dense, and disable
compile as if it were quantized. has_functional_torchao imports the exact
symbols the int8 path uses and rejects the stub via its sentinel; both the
auto picker and the /info advertised modes now use it
2026-07-04 03:23:16 +00:00
Daniel Han
6f9d8b356c Merge branch 'image-generation' of https://github.com/unslothai/unsloth into image-generation 2026-07-04 03:23:05 +00:00
Daniel Han
bfbb902610 Fix review findings: engine unload before training, caption precedence, dataset caption counts, local diffusers tagging, family LoRA targets
- Unload the ACTIVE image engine (sd_cpp or diffusers) before diffusion training starts, not just the diffusers singleton
- Count metadata.jsonl captions in dataset summaries so metadata-captioned datasets are not reported as uncaptioned
- Sidecar captions now override metadata rows everywhere (grid edits win); trainer and dataset API agree
- Tag local diffusers image checkpoints with text-to-image so they appear in the Images picker
- Family LoRA targets (_FLUX_TARGETS etc) apply when the config carries the generic defaults; explicit overrides still win
2026-07-04 03:23:05 +00:00
Daniel Han
f1dbb74308 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-04 02:21:11 +00:00
Daniel Han
1a99c81f59 Merge branch 'diffusion-train-precision' of https://github.com/unslothai/unsloth into diffusion-train-precision 2026-07-04 02:21:03 +00:00
Daniel Han
bdebf61e28 Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-04 02:20:54 +00:00
Daniel Han
f76d7c8d2f Merge remote-tracking branch 'origin/image-generation' into diffusion-train-perf 2026-07-04 02:20:44 +00:00
pre-commit-ci[bot]
bbca561d38 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-04 02:20:19 +00:00
Daniel Han
71ab68fd55 Merge remote-tracking branch 'origin/main' into image-generation
# Conflicts:
#	studio/frontend/src/app/router.tsx
2026-07-04 02:18:20 +00:00