Commit Graph
878 Commits
Author SHA1 Message Date
Aryan Kumar 881400490c [bugfix]: stabilize fastcheck lanes for Kandinsky PR 2026-07-06 11:42:26 -07:00
SolitaryThinker fca6fb3aa1 [test]: add reduced-size Kandinsky-5 T2V SSIM test 2026-07-05 16:31:59 -07:00
SolitaryThinker fa6e50fc7c [misc]: drop the bundled Modal checkout rewrite (separate PR material) 2026-07-05 16:09:06 -07:00
SolitaryThinker 9f28d34d6d [bugfix]: keep text-encoder CPU offload on by default
Revert the default flips from 40c8b7c1 (OffloadConfig.text_encoder and
FastVideoArgs.text_encoder_cpu_offload False -> True). Flipping the
global default changes the baseline VRAM footprint for every model
family, not just Kandinsky, and breaks the unit lane:
fastvideo/tests/api/test_parser.py::test_load_run_config_supports_yaml_roundtrip
still golden-checks text_encoder offload as True.

Nothing in this PR needs the flip: the Kandinsky examples pass
text_encoder_cpu_offload explicitly, and the offload-aware
TextEncodingStage (kept) makes offload work for Kandinsky's CLIP
either way. Offload stays opt-out rather than opt-in.
2026-07-05 15:25:06 -07:00
Will LinandClaude Fable 5 a7470d2da3 [bugfix]: retry the non-pr ci checkout too
The blob-less clone defers all file downloads to checkout, so the direct
'git checkout <commit>' on main-branch/merge-queue shards is a large lazy
blob fetch with no retry — the same transient-disconnect flake class the PR
path's retry loop was added for. Share one retry wrapper across both paths;
all four command compositions verified with bash -n.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 821b4bc275 [misc]: document why i2v keeps diffusers cond-channel semantics
The official kandinsky-5 repo zeros the visual_cond block for I2V while the
diffusers port copies the image latent into it. A same-seed A/B on the
Pro-distilled Diffusers export shows the copy is required (zeroing smears
faces mid-video), so keep the diffusers semantics and record the evidence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 09c42cc73a [bugfix]: raise on unknown rope types in custom qwen2.5-vl encoder
The transformers-5.x compat fallback rescued every rope_type missing from
ROPE_INIT_FUNCTIONS, silently computing unscaled default frequencies for
typo'd or future scaling types; only 'default' (removed from the table in
transformers>=5) falls back now, anything else raises KeyError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 d6ed0e54da [bugfix]: restore pipeline-class override short-circuit and dedup kandinsky5 detectors
get_model_info again skips model_index.json resolution entirely when
override_pipeline_cls_name is set, so overrides keep working for local
checkpoints without a diffusers model_index (and trigger no downloads).
Replace the nine copy-pasted kandinsky5 detectors with a parameterized
factory (identical matching semantics) and add a dedicated I2V Lite distilled
entry + preset so those checkpoints get distilled sampling defaults
(guidance 1.0 / 16 steps) instead of the sft fallback's 5.0 / 50.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 6ce4993ab7 [bugfix]: kandinsky5 stages: official rng order, attn metadata, tensor resize, decode dedup
Match the official kandinskylab/kandinsky-5 RNG order for I2V seed parity:
image encoding now runs after latent preparation and places the conditioning
latent itself, so the initial noise is the seeded generator's first draw
(upstream leaves the image-latent sample unseeded; drawing it second from the
same generator keeps FastVideo deterministic). The denoising stage now sets
the forward context with NABLA attention metadata per step — which also
routes the dense path through LocalAttention instead of the no-context SDPA
fallback. Resize tensor conditioning images to the requested resolution like
the PIL path. Collapse Kandinsky5DecodingStage to a channels-first permute +
super().forward(), regaining the base class's MPS handling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 b9dfb12502 [feat]: register NABLA sparse attention as an attention backend
Move nablaT_v2 + the flex-attention guard out of the Kandinsky5 DiT into
fastvideo/attention/backends/nabla.py with backend/metadata/builder/impl
classes, a NABLA_ATTN enum entry, and CUDA platform wiring that refuses to
silently fall back to dense attention when flex_attention is unavailable.
Add a generic default_backend parameter to the selector and LocalAttention —
a layer-level default that the global force and FASTVIDEO_ATTENTION_BACKEND
still override — so nabla checkpoints select the backend by default while
users keep env-var control. The DiT's sparse path now dispatches through a
dedicated LocalAttention (with a direct-flex fallback for standalone parity
tests without a forward context); verified bit-identical to the previous
inline flex call.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 375ba410c7 [misc]: default text_encoder_cpu_offload to False
Keep text encoders GPU-resident by default (both the legacy arg and the
engine-config schema); offload remains an explicit opt-in now that the
swap path makes it work for encoders without FSDP shard conditions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 a43284ae1b [bugfix]: swap cpu-offloaded text encoders to GPU for the forward
text_encoder_cpu_offload means params rest on CPU between calls but compute
on GPU: FSDP-wrapped encoders (T5/llama/clip) already get this via
CPUOffloadPolicy streaming, but encoders without _fsdp_shard_conditions
(reason1/Qwen2.5-VL) were parked on CPU and, after the encoder-device input
routing added for kandinsky5, silently ran their 7B forward on CPU (crashing
outright with flash-attn installed). Move plain CPU-parked encoders to the
target device for the forward and back afterwards, mirroring the
image-encoder/VAE offload pattern; FSDP (DTensor) encoders keep the existing
input routing. Revert the examples to text_encoder_cpu_offload=True now that
the default works. Verified e2e: T2V/I2V outputs are metric-identical to
GPU-resident runs, with ~12GB lower VRAM during denoising.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 6ab2d6f98d [bugfix]: kandinsky5 stages: nabla validation, seeded i2v latent, trajectory support
Validate NABLA resolutions (divisible by 128) in latent preparation instead
of crashing mid-denoise with a cryptic reshape error after all encoding work.
Encode the I2V conditioning image with a generator-seeded sample instead of
mode() for diffusers seed parity. Restore base DecodingStage behavior the
override dropped (pipeline.add_module on lazy VAE reload,
return_trajectory_decoded) and record trajectory latents in the denoise loop.
Always normalize PIL conditioning images deterministically; keep the
diffusers-style range heuristic only for raw tensors and log the assumption.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 9472ed0aab [bugfix]: surface kandinsky5 flex-attention failures and preserve rotary dtype
Replace the bare except around the flex_attention import (which swallowed
every error, printed blank lines to stdout, and silently degraded NABLA
requests to dense attention over ~95k tokens) with except ImportError plus a
logger warning, and raise a RuntimeError when sparse attention is requested
without flex_attention, matching the reference implementation. Also restore
the input dtype in _apply_rotary instead of hard-casting to bf16, which
truncated fp32 q/k through a bf16 round-trip in fp32/parity runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 4eb4e252eb [bugfix]: preserve tokenizer_kwargs customizations across update_model_arch
TextEncoderArchConfig.__post_init__ rebuilt tokenizer_kwargs from scratch, and
TextEncoderLoader.load -> update_model_arch re-runs __post_init__, silently
wiping customizations applied by pipeline configs (kandinsky5/gen3c/longcat
set 'padding'; multi-prompt kandinsky5 runs then crash on ragged sequences).
Merge defaults under existing keys instead of rebuilding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 0434e9dcf0 [bugfix]: fix kandinsky5 registry detectors and distilled repo name
The i2v detector matched any path containing 'i2v' without excluding 't2v',
misrouting T2V checkpoints stored under i2v-containing directories. The
variant detectors all require lite/pro tokens, so the model_index _class_name
fallback ('kandinsky5t2vpipeline') could never match and I2V-Lite-distilled
checkpoints had no detector at all; add base T2V/I2V fallback registrations
after the variants. Also fix the registered Lite distilled repo to the real
kandinskylab/Kandinsky-5.0-T2V-Lite-distilled16steps-5s-Diffusers (the old
name 404s) and correct the example comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 36cf64b15f [bugfix]: fix bash syntax error in modal ci pr checkout
The multi-line retry checkout command ended with a newline, so splicing it
into '{checkout_command} &&' left a lone '&&' on the line after 'done' — a
bash syntax error failing every PR-triggered shard before checkout. End the
f-string at 'done' so the composed script reads 'done &&'; verified all four
compositions (PR/direct x kernel/no-kernel) with bash -n.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 7a270e66be [bugfix]: keep kandinsky5 example text encoders on GPU
text_encoder_cpu_offload=True makes the Qwen encoder compute on CPU, where
flash-attn has no kernels; with flash_attn installed both examples crash in
the first text-encoding forward. The offloaded path only worked in envs
without flash_attn via the silent SDPA fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 74de6f27a2 [bugfix]: fix kandinsky5 t2v frame-0 denoising and restore trained prompt template
Denoising keyed cond_frames off transformer.visual_cond, but official T2V
checkpoints also ship visual_cond=true, so latent frame 0 was never stepped
and decoded as pure noise in every T2V video; key off batch.image_latent
instead. Restore the byte-exact upstream prompt template (typos included):
the checkpoints were trained with it, and ENCODE_START_IDX=129 matches the
upstream template while the corrected wording moves user content to 127,
silently dropping the first user-prompt tokens. Verified against the
checkpoint tokenizer and by end-to-end T2V/I2V generation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Will LinandClaude Fable 5 6979040225 [bugfix]: make custom qwen2.5-vl encoder compatible with transformers 5.x
transformers>=5 stops forwarding text-model attributes from the composite
Qwen2_5_VLConfig, drops the 'default' ROPE_INIT_FUNCTIONS entry, and requires
flash-attn functions to be preloaded before _flash_attention_forward. Flatten
text_config at model entry, replicate the 4.x default rope init, and preload
flash-attn (falling back to SDPA). Fixes Kandinsky5 and Cosmos 2.5 encoder
loading under the transformers>=4.57.3 pin.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:58:12 -07:00
Aryan Kumar 80972d07fa [bugfix]: harden modal ci pr checkout 2026-07-05 14:58:12 -07:00
Aryan Kumar 260b326d8b [bugfix]: address kandinsky5 i2v review feedback 2026-07-05 14:58:12 -07:00
Aryan Kumar c57fa1eab0 [misc]: polish kandinsky5 sparse attention updates 2026-07-05 14:58:12 -07:00
leffff 562b951208 [feat] add support for Kandinsky 5 Pro, Lite I2V 2026-07-05 14:58:12 -07:00
leffff aa893056e8 [misc] I2V debug 2026-07-05 14:58:12 -07:00
leffff 313c2985f0 [feat] add support for Kandinsky5 I2V 2026-07-05 14:58:12 -07:00
leffff b3b3858c02 [misc] add skeleton for Kandinsky5 I2V pipeline 2026-07-05 14:58:12 -07:00
leffff d39e2e9fd7 fix nabla attention 2026-07-05 14:58:12 -07:00
leffff a66fb26781 add nabla 2026-07-05 14:58:12 -07:00
leffff f303d94780 add exmaple for kandinsky5 T2V Lite 5s 2026-07-05 14:58:12 -07:00
coderabbitai[bot]andCodeRabbit dae7c0da89 fix: apply CodeRabbit auto-fixes
Fixed 2 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
2026-07-05 14:58:12 -07:00
Aryan Kumar 0ce6dc928f [feat]: add kandinsky5 pipeline support 2026-07-05 14:58:12 -07:00
William Lin 76b0550c15 [ci]: run pre-commit on fork PRs without manual approval (#1555) 2026-07-05 14:18:16 -07:00
William Lin 384c1e9493 [misc]: update reseed-performance-baseline skill for the hf_store move (#1545 follow-up) (#1553) 2026-07-05 14:16:55 -07:00
William Lin b1dbcc93f6 [misc]: reformat fastvideo/performance to the repo yapf config (#1554) 2026-07-05 14:16:20 -07:00
William Lin b93833772e [ci]: guard against test directories no CI lane collects (#1552) 2026-07-05 14:07:38 -07:00
Mac Lee 30b523edd6 [ci] Normalize performance stage component metrics (#1475) (#1550) 2026-07-05 14:05:26 -07:00
Mac LeeandSolitaryThinker 6aab7f3832 [ci] cover Hunyuan 1.5 chat-list text preprocessing (#1518)
Co-authored-by: SolitaryThinker <wlsaidhi@gmail.com>
2026-07-05 12:05:25 -07:00
Mac Lee 9cd53fe5f8 [ci] Add metric-specific performance thresholds (#1545) 2026-07-05 12:04:33 -07:00
Mac Lee 6a32cf3a5e [ci]: expose LoRA extraction slash command (#1542) 2026-07-05 06:45:31 -07:00
William Lin 98be9b3da2 [bugfix]: address the three remaining #1447 review findings (#1549) 2026-07-05 06:43:27 -07:00
Mac Lee c53e85b767 [ci] Add v2 performance benchmark config identity fields (#1544) 2026-07-05 06:18:15 -07:00
William Lin 40a8bd2d3b [bugfix]: skip ThunderKittens kernels on aarch64 and document the kernel build matrix (#1548) 2026-07-05 06:13:11 -07:00
Mac LeeandSolitaryThinker 31aa115611 [bugfix]: preserve FSDP hooks for RMSNorm qk norms (#1513)
Co-authored-by: SolitaryThinker <wlsaidhi@gmail.com>
2026-07-05 04:15:49 +00:00
zainnhandSolitaryThinker 98ac10a528 [infra] Auto-rebuild CUDA images when docker/Dockerfile changes on main (#1526)
Co-authored-by: SolitaryThinker <wlsaidhi@gmail.com>
2026-07-04 16:25:46 -07:00
William Lin a5a6d171e5 [attn] Make FA4 explicit opt-in via FASTVIDEO_FA4 and delete the runtime fallback machinery (#1540) 2026-07-04 14:51:00 -07:00
William Lin 51ed1ea423 [build] Bump fastvideo-kernel pin to 0.3.2 (#1541) 2026-07-03 14:48:15 -07:00
Mac Lee 00ec3e7388 [bugfix]: compute VSA topk from padded blocks (#1517) 2026-07-03 14:16:51 -07:00
William Lin 0d626ef2d1 [kernel] Bump fastvideo-kernel pin to 0.3.1 and version the FA4 tile_mn port as 0.3.2 (#1539) 2026-07-03 14:11:08 -07:00
William Lin b36d0ef085 [infra] Add DGX Spark and multi-architecture CUDA support (#1447) 2026-07-03 13:41:43 -07:00