Commit graph

6,661 commits

Author SHA1 Message Date
Daniel Han
c800d7cf93 Merge branch 'diffusion-auto-policy' into diffusion-fp16-accum 2026-07-05 07:57:06 +00:00
Daniel Han
8dce79ff51 Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-05 07:57:01 +00:00
Daniel Han
466f853f14 Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-05 07:56:51 +00:00
Daniel Han
4b93558ad4 Merge branch 'diffusion-train-tab-2' into diffusion-krea2 2026-07-05 07:56:47 +00:00
Daniel Han
69f32b9586 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 07:56:20 +00:00
Daniel Han
3925aea07f Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 07:56:14 +00:00
Daniel Han
8c00f81a5d Size-gate the automatic diffusion latent cache
The latent cache holds two fp32 posterior tensors per crop/flip variant per
image, pinned on CUDA hosts, so datasets with thousands of images can exhaust
host or pinned memory with no fallback. Estimate the cache size from the first
real encoded latent and fall back to per-step VAE encoding when it exceeds a
4 GiB budget. UNSLOTH_DIFFUSION_FORCE_LATENT_CACHE bypasses the gate; the
existing UNSLOTH_DIFFUSION_NO_LATENT_CACHE opt-out is unchanged.
2026-07-05 07:53:12 +00:00
Daniel Han
da3a79468e Use permutation-cycle index sampling in diffusion trainers and guard non-object run records
Replace the with-replacement per-batch index draw in the SDXL and DiT LoRA
trainers with a shared PermutationBatchSampler that visits every image once per
cycle before repeating, so short runs cover the whole dataset. The sampler
reshuffles from the run's rng so the index stream stays seed-deterministic.

Guard the diffusion run detail route against a valid-JSON non-object record,
which previously raised TypeError and returned a 500; it now 404s like the list
path's shape check.

Add regression tests for both.
2026-07-05 07:49:30 +00:00
Daniel Han
12ff90119d Merge branch 'diffusion-auto-policy' into diffusion-fp16-accum 2026-07-05 07:41:35 +00:00
Daniel Han
45e6dc8a12 Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-05 07:41:34 +00:00
Daniel Han
715d4965c8 Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-05 07:41:32 +00:00
Daniel Han
866e03d4ce Merge branch 'diffusion-train-tab-2' into diffusion-krea2 2026-07-05 07:41:31 +00:00
Daniel Han
882b5354c4 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 07:41:30 +00:00
Daniel Han
8c4cdcd385 Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 07:41:29 +00:00
Daniel Han
3977f1a71d Merge branch 'image-generation' into diffusion-train-perf 2026-07-05 07:41:28 +00:00
Daniel Han
f313cfd7e5 Security audit: baseline the new huggingface-hub Sandboxes findings
The latest huggingface-hub release added the Sandboxes feature. Its
bootstrap (_sandbox.py) fetches the static sbx-server binary into /tmp with
an Authorization header and marks it executable, which is exactly the
staged-dropper pattern the scanner hunts, and three while True polling loops
in _sandbox.py / hf_api.py / utils/_http.py match the beaconing heuristic.
All four verified against the official huggingface/huggingface_hub
repository: the snippet is the documented sandbox server injection and the
loops are deadline-style job and sandbox polling. Entries generated with
--write-baseline and reviewed line by line; scan_packages.py huggingface-hub
now exits 0 with the four findings suppressed.
2026-07-05 07:40:45 +00:00
Daniel Han
10ba804db7 Merge branch 'diffusion-auto-policy' into diffusion-fp16-accum 2026-07-05 05:35:58 +00:00
Daniel Han
a61e56b975 Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-05 05:35:56 +00:00
Daniel Han
6a9db8017b Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-05 05:35:55 +00:00
Daniel Han
e0786a98be Merge branch 'diffusion-train-tab-2' into diffusion-krea2 2026-07-05 05:35:54 +00:00
Daniel Han
1978b2a844 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 05:35:53 +00:00
Daniel Han
1919491665 Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 05:35:52 +00:00
Daniel Han
dfe15c8141 Merge branch 'image-generation' into diffusion-train-perf 2026-07-05 05:35:50 +00:00
Daniel Han
fc35c40c18 Return 404 for malformed diffusion run records in the detail route
The run detail route built DiffusionTrainingRunDetail(**rec) unguarded, so a
valid-JSON-but-wrong-shape record (hand-edited or an older schema) would 500
instead of reading as absent. Catch ValidationError and 404, matching how the
list route skips malformed records.
2026-07-05 05:34:18 +00:00
Daniel Han
7a05d8655b Stream every DiT through group offload, not just the primary transformer
A dual-DiT pipeline (Ideogram 4's unconditional tower) placed its second
denoiser resident under the group tier, which defeats the tier since the
pair rarely fits where one alone did not. Stream transformer_2 and
unconditional_transformer alongside the transformer and keep only the
smaller companions resident.
2026-07-05 05:30:58 +00:00
Daniel Han
d6795ed077 Restore pre-Ampere bf16 fail-fast in the DiT trainer
The perf rewrite dropped the bf16 capability guard, so a pre-Ampere CUDA
device (T4/V100/RTX 20xx) would die deep in model load with an opaque dtype
error instead of a clear message. Restores parity with the SDXL trainer.
2026-07-05 05:27:58 +00:00
Daniel Han
bcb3b90ac4 Merge branch 'diffusion-auto-policy' into diffusion-fp16-accum 2026-07-05 05:01:15 +00:00
Daniel Han
9c219a9cac Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-05 05:01:14 +00:00
Daniel Han
94dff34968 Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-05 05:01:13 +00:00
Daniel Han
d13c1d37c9 Merge branch 'diffusion-train-tab-2' into diffusion-krea2 2026-07-05 05:01:12 +00:00
Daniel Han
017ef14877 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 05:01:10 +00:00
Daniel Han
54159ac64b Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 05:01:09 +00:00
Daniel Han
34a8459f2f Merge branch 'image-generation' into diffusion-train-perf 2026-07-05 05:01:08 +00:00
pre-commit-ci[bot]
848b8da9f2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 05:00:18 +00:00
pre-commit-ci[bot]
4064332a92 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:59:43 +00:00
pre-commit-ci[bot]
ea1aa16d6f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:59:12 +00:00
pre-commit-ci[bot]
237d197b5d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:58:38 +00:00
pre-commit-ci[bot]
5732e3adc5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:58:06 +00:00
pre-commit-ci[bot]
c475f7da00 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:57:35 +00:00
pre-commit-ci[bot]
09ff9e24f9 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:57:03 +00:00
pre-commit-ci[bot]
bcf25ca569 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-07-05 04:56:29 +00:00
Daniel Han
c5524b0d7f Merge branch 'diffusion-auto-policy' into diffusion-fp16-accum 2026-07-05 04:56:23 +00:00
Daniel Han
f39e997523 Merge branch 'diffusion-train-perf2' into diffusion-auto-policy 2026-07-05 04:56:22 +00:00
Daniel Han
d9d3ef462d Merge branch 'diffusion-krea2' into diffusion-train-perf2 2026-07-05 04:56:21 +00:00
Daniel Han
10d01cbc92 Merge branch 'diffusion-train-tab-2' into diffusion-krea2
# Conflicts:
#	studio/backend/core/inference/diffusion.py
2026-07-05 04:56:19 +00:00
Daniel Han
45f5ee7628 Merge branch 'diffusion-train-precision' into diffusion-train-tab-2 2026-07-05 04:55:07 +00:00
Daniel Han
83a0f15c07 Merge branch 'diffusion-train-perf' into diffusion-train-precision 2026-07-05 04:55:05 +00:00
Daniel Han
e0f7ac68a4 Merge branch 'image-generation' into diffusion-train-perf 2026-07-05 04:55:04 +00:00
Daniel Han
e3ad2263fb Merge branch 'image-generation' of https://github.com/unslothai/unsloth into image-generation 2026-07-05 04:53:43 +00:00
Daniel Han
c53a6cb65e Address review findings: dataset preflight, sd.cpp unload barrier, caption tombstone, ControlNet cache race
- Run the trainer's caption discovery in the start route BEFORE freeing GPU
  residents, so a missing or uncaptionable dataset 400s without evicting the
  loaded chat/Images model.
- sd.cpp unload now waits out a cancelled one-shot generation on the generate
  lock before reporting the device free, matching the diffusers backend.
- Clearing a caption that came from metadata.jsonl writes an empty sidecar
  tombstone instead of unlinking (both readers treat an existing sidecar as
  authoritative), so the cleared label cannot resurface.
- The ControlNet wrapper pipe is only cached while its load is still current,
  closing the unload race the model cache already handled.
2026-07-05 04:53:37 +00:00