Repository navigation
Studio: recheck follow-ups for the merged VAE per-tap, Lanczos preprocess, INT8 attention and MPS guard changes - #19005
Conversation
…Windows ROCm (#18965 follow-up) The per-tap Conv3d rounds each fp16 tap before the fp32 sum, so taps that cancel can overflow to inf and return NaN where stock Conv3d returns a finite value, and under autocast it returned x's dtype instead of the autocast dtype. Only bf16 / fp32 calls outside autocast take it now (the measured bf16 path is unchanged). is_compiling is checked before the env switch so a flip does not recompile a compiled region.
…ference preprocess probe after an OOM (#18968 follow-up) The int32 guard bounds one image, but the identity-resize and vertical-first normalize launches run flat over the whole NHWC batch, so a [24, 8192, 8192, 3] batch wrapped the int32 index. The program offset is widened to int64 before the multiply. A transient OOM in the load-time probe no longer caches the device as off for the process: that call takes the CPU path and the next request probes again. Other probe failures are still cached.
…es (#18981 follow-up) Flipping the residual-fold, sink-order or native-P switch built a new launch plan, but the plan's decision key omitted the switches, so the new kernel reused the old kernel's accuracy and timing verdict without racing. The decision key now carries the same switch tuple as the plan key.
…er V batch in the score cap (#18979 follow-up) The prefill predicate parsed torch.__version__ with re.match; on a cold regex cache Dynamo traced into the pattern compiler and failed fullgraph=True. The pattern is compiled at import. SDPA broadcasts Q, K and V together, so a V batch wider than Q and K multiplies the score matrices; the cap now counts it (GQA and same-batch K / V are unchanged).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
… wider-V cap On gfx1151 the real LTX-2.3 fp16 decode is finite on the per-tap path and the stock op is 2.4x slower there with a 7.1 GiB higher peak, so only autocast calls stay on stock Conv3d. On Metal a V batch wider than Q and K does not broaden the attention, so the cap is back to counting Q and K. [skip ci]
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Follow-ups to #18965, #18968, #18979 and #18981 from a recheck of the merged kernel and compile changes. There is one commit per PR. Each fix is small and backwards compatible. The default bf16 / fp32 paths produce the same outputs as before.
#18965: Windows ROCm per-tap Conv3d
Conv3d; bf16, fp16 and fp32 calls outside autocast keep the per-tap path. fp16 stays on it on purpose: on Windows gfx1151 the real LTX-2.3 fp16 decode is finite there, and stockConv3dwas 2.4x slower (35.7 s vs 87.0 s) with a 7.1 GiB higher peak.torch.compiler.is_compiling()is now checked before the env switch. Before this, flippingUNSLOTH_VIDEO_VAE_ROCM_PERTAPinside a compiled region added an env guard and forced a recompile.#18968: Lanczos reference preprocess
[24, 8192, 8192, 3]batch wrapped the int32 index._normalize_rgbnow widens the program offset to int64 before the multiply. The TTIR now shows ani64multiply andi64pointer offsets.#18981: INT8 attention kernel switches
decisionkey left the switches out, so the new kernel reused the old kernel's accuracy and timing verdict without racing. The decision key now carries the same switch tuple as the plan key.#18979: MPS large-attention guard
torch.__version__withre.match. On a cold regex cache, Dynamo traced into the pattern compiler and failedfullgraph=True. The pattern is now compiled at import.Tests
Each new test fails on
origin/mainand passes here:test_video_vae_rocm_pertap.py:test_autocast_keeps_stock_output_dtype,test_compiled_kill_switch_flip_does_not_recompile(plustest_fp16_outside_autocast_still_takes_pertap)test_diffusion_ref_preprocess.py:test_batched_normalize_uses_64_bit_offsets,test_probe_oom_is_not_cachedtest_diffusion_int8_attention_resid_fold.py:test_a_flipped_switch_races_its_own_kerneltest_mps_large_attention_guard.py:test_cold_prefill_check_traces_under_fullgraphThe touched suites and their neighbours (per-tap VAE, reference preprocess, MPS guard and families, ROCm contiguous q/k/v and k/v, CUTLASS race key, attention install, every INT8 attention suite) give 657 passed, 175 skipped (GPU / Mac only) on Linux CPU, torch 2.12.1, Triton 3.7.1.
Not changed
fullgraph=True, dynamic=Truecompiled 2 graphs. Studio's trainer never marks a dynamic range across the threshold.GPU, Windows ROCm and Mac checks
Same host and job for both arms, base = the merge base.
[24, 8192, 8192, 3]uint8 batch-m gputestsUNSLOTH_MPS_LARGE_ATTENTION=1On Metal, a V batch wider than Q and K does not broaden the attention, so the guard keeps counting Q and K only.