Skip to content

Studio: per-family diffusion tables move into the family registries - #13536

Merged
danielhanchen merged 3 commits into
mainfrom
studio-diffusion-family-data
Oct 13, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
studio-diffusion-family-data

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Second step of the diffusion auto-optimizer (after #13520): a new model should be data, not edits across about 25 side tables. The per-family tables move into the family registries as a FamilyProfile section, so adding a family is one registry row plus only the values that differ from the defaults.

  • New torch-free core/inference/family_profile.py defines FamilyProfile; every DiffusionFamily / VideoFamily row carries it as profile, with the reasoning comments moved next to the data. It holds the transformer quant policy (int8 excludes and pads, ConvRot, nvfp4 zero-row tokens, scheme denies, training denies, auto preferences, bf16-when-resident), the text-encoder int8 schedule, the untiled VAE coefficients, the preview factor key, the auto step-skip rows, extra trusted repos, the two LTX compile flags, and quant_names (the quant tables also answer the legacy ltx-2.3 key).
  • Registry rows also gain label (training labels derive from it) and, on video, trainable (TRAINABLE_VIDEO_FAMILIES derives from it). The content module's video-family set, both trusted-repo sets (base repo, variant bases, training bases and prequant variant bases plus explicit extras) and the reduction-config filters now come from the registries.
  • The modules that used the tables keep their table names, now built from the registry, so call sites and existing tests are unchanged; diffusion.py and video.py change by one block each.
  • The autoopt ltx_static_compile and ltx_stg_compile_adapter hooks from Studio: diffusion auto-optimizer core shared by the image and video load paths #13520 read compile_static / stg_compile_adapter from the profile instead of a hard-coded family list.

Published checkpoints keep validating. Exclude, ConvRot and policy sets are baked into the hosted prequant files and checked at load (the file's exclude tokens must cover the runtime's). The new freeze test pins every resolved value so this refactor cannot move them.

Testing

  • Freeze test (tests/test_diffusion_family_data_freeze.py, fixture tests/fixtures/diffusion_family_data_freeze.json): for every image and video family plus None, "", an unknown name and odd spellings, every scheme's exclude / pad / zero-row tokens, ConvRot spec, filename, repo and variant repos, ConvRot default-on, bf16-when-resident, TE int8 mode, preview key and content page, plus every raw table, sample untiled VAE byte counts, step-skip rows, cudnn and reduction flags, labels, the trainable set, both trusted-repo sets and the generation defaults. The fixture was generated on a clean current-main checkout and the branch reproduces it byte for byte.
  • After rebasing on current main: the freeze, autoopt parity and core, transformer quant, prequant, video families and LTX-2.5 (incl. prequant) tests give 772 passed, 0 failed. Every test file changed by the image LoRA training PRs that landed alongside (Studio: random flip opt-in, plus checkpoint retention, caption dropout, LoRA dropout and timestep shift on the image Train tab #13210 to Studio: scale the SDXL loss in fp16 and keep image LoRA training off devices it cannot use #13278) also passes.
  • Full backend suite, one pytest process per file: no failing test ID that is not also failing on main.

Adding a family now

  1. One registry row in diffusion_families.py or video_families.py with an optional label, trainable, the reduction / cudnn flags, and profile = FamilyProfile(...) holding only the non-default fields.
  2. A fitted preview map in FACTORS if it has a live preview; the row names its key.
  3. UNSLOTH_FREEZE_UPDATE=1 pytest tests/test_diffusion_family_data_freeze.py and a review of the JSON diff. If a family with a published prequant file changes its exclude, ConvRot or zero-row tokens, that file has to be rebuilt.

Left as they were: the checkpoint-name generation default tables (they match names like "distilled" or "fusionx", not just base repos), the arch-wide auto ladder, the NVFP4 policy constants, the TE ConvRot and H3 file lists and compile metadata such as _VERIFIED_BLOCKS. Frontend labels and defaults and catalog rows are still hand-edited.

Quant excludes, pads, ConvRot, NVFP4 zero-row guards, scheme and train denies,
auto preferences, bf16-when-resident, TE int8 schedules, untiled VAE
coefficients, preview factor keys, auto static step skip rows and trusted repo
extras now live on DiffusionFamily.profile / VideoFamily.profile
(family_profile.FamilyProfile). The consumer modules keep their table names,
derived from the registries, so call sites and lookups are unchanged. Labels
and the trainable video set come from the registry rows, the content video set
from the video registry, and both registries spell the reduction-filter flags
the same way. The freeze test resolves identically.
compile_static and stg_compile_adapter live on the ltx-2 / ltx-2.5 profiles;
the hooks read them through profile_for, which also resolves a stand-in
family object by its registry name.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T05:41:29.855154Z d70edae Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: d70edae3e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit e227a53 into main Oct 13, 2026
@danielhanchen
danielhanchen deleted the studio-diffusion-family-data branch October 13, 2026 05:49
danielhanchen added a commit that referenced this pull request Oct 13, 2026
…13536 left red on main (#13543)

- Baseline the two diffusion_autoopt splice_function compile/exec sites
  with their reasons (#13520).
- Name encoding="utf-8" on four file reads/writes in tests (#13520,
  #13534, #13536).
- Format six #13536 files with scripts/run_ruff_format.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant