Skip to content

Video: verify the H3 denoiser artifact before the pull drops its dense shards - #8337

Merged
danielhanchen merged 2 commits into
mainfrom
h3-ref2va-denoiser-optims
Aug 10, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
h3-ref2va-denoiser-optims

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #8329, which merged before the last review round landed. Two fixes, both on the reference (ref2va) denoiser path.

The pull can drop the dense shards for an artifact that does not exist

_run_load set skip_transformer_weights from _denoiser_prequant_covered, a registry-only probe. The plan already gates its own skip on the artifact resolving (dq_repo), and both encoder skips next to it gate on the checkpoint actually landing, but the load path had no equivalent.

A task-specific prequant_filenames row gets no filename fallback, so a Ref2VA checkpoint that is renamed, unpublished or gated resolves to nothing while the registry still reports the scheme as covered. _predownload_base then removed every dense transformer_ref weight before load_prequantized_transformer had established a replacement, so the documented bf16 fallback ran against a snapshot without them: an offline or pre-staged load fails, and an online one pulls ~66 GB inline, outside the load progress, the cancel path and the disk preflight.

_denoiser_prequant_verified is the registry probe plus the Hub check, in the same shape as _h3_te_quant_scheme_verified beside it and with the same fail-closed direction: unanswerable keeps the dense shards.

The reference partition never reached the optimisation helpers

apply_attention_backend and apply_speed_optims reach the denoiser through pipe.transformer, and both enumerate only transformer, transformer_2 and unconditional_transformer. A reference load denoises out of transformer_ref, so neither helper found a DiT at all.

This used to be hidden: the pin read getattr(pipe, "transformer"), found nothing on a reference load, and the profile was downgraded to eager. #8329 correctly pinned the partition the load opens, which removed that downgrade and left the reference DiT native and uncompiled while the resolved record still reported the requested profile - the exact over-reporting _denoiser_dits and _attention_dits document as the thing to avoid.

_NamedDiTView generalises the existing _SecondDiTView seam: it presents pipe.<component> as pipe.transformer and reads everything else through. A keyframe load is handed the pipe itself, so its behaviour is unchanged.

Tests

Four added in studio/backend/tests/test_video_backend.py, two of them AST-based:

  • the verified probe refuses an absent reference artifact, accepts it once published, treats an unreadable repo as a refusal, and never asks for bf16;
  • _run_load gates its dense skip on the verified probe, not the registry-only one;
  • _denoiser_view makes the reference DiT visible to _denoiser_dits / _attention_dits, passes writes through to the real partition, and returns the pipe unchanged for a keyframe load;
  • the H3 loader hands both helpers the denoiser view.

Each was mutation-checked: reverting either fix fails its tests, restoring it passes.

414 passed across the prequant, video, routes and speed test files; backend and hub suites show no new failures against main.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 009ec7b4f4

ℹ️ 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 f57c05d into main Aug 10, 2026
1 of 44 checks passed
@danielhanchen
danielhanchen deleted the h3-ref2va-denoiser-optims branch August 10, 2026 12:11
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