Commit Graph
1197 Commits
Author SHA1 Message Date
William LinandClaude Opus 5.5 f9b2d4957b [docs] Put the PAN 2 cookbook under the pan family
The recipe moves to /cookbook/pan/pan2 and the family guide to /cookbook/pan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 500ba51680 [docs] PAN2: review follow-ups
- Guardrail install points to ifm-ai/pan2-guardrail, as in the vLLM-Omni and Diffusers ports.
- The basic example runs the release's own text-to-video structured caption (10 s, 241 frames) instead of a plain prompt.
- Docs and the flow-shift comment name the release checkpoint IFM/PAN2; the docs and cookbook no longer describe its release status or the parity tests' checkpoint.
- FASTVIDEO_FA4 is set only while the PAN2 pipeline loads, instead of for the rest of the process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 8f21bb5aaf [bugfix] PAN2: pre-commit and unit-test fixes
- mypy types for the guardrail broadcast and the negative-prompt fill; yapf kept off the negative prompt.
- Classify PAN2PipelineConfig's kernel and guardrail fields in the schema parity inventory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 bec159cac0 [feat] PAN2: FlashAttention-4 on Blackwell by default, reference first-frame loading, per-process kernel builds
- Attention: on sm_100+ with flash_attn.cute installed and FASTVIDEO_FA4 unset, the PAN2 pipeline turns FA4 on
  before its modules load. One B300, 241 frames: 288 s instead of 670 s with the SDPA fallback. FASTVIDEO_FA4=0
  keeps the previous backend.
- First frame: an image_path is read as its stored pixels, without the EXIF orientation rotation, as the reference
  sampler reads it (load_image gains exif_transpose=True). All 11 sign-off inputs, one EXIF-rotated, now reach the
  VAE bit-identical to the reference.
- Wan2.2 VAE decode kernel: each process builds in a temporary directory of its own instead of a shared
  rank<LOCAL_RANK> directory, and finished builds go through the loader's keyed cache, added by atomic rename.
  Two processes building at once both succeed; a later one fetches the build in about 2 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 cd98b76f37 [test] Allow TRITON_INTERPRET in the env policy
test_pan2_fusions runs the fused kernels through the Triton interpreter in a child process; the contract test
flagged the override as a new violation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 678bc6e1f5 [fix] PAN2: fail every rank at once when the guardrails fail on the first rank
The first sequence-parallel rank loads the guard models and runs each check. When either step raised there, the
other ranks waited at their next collective until the 10-minute store timeout. The first rank now broadcasts its
error as well as its result, and the other ranks raise with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 946094bc77 [feat] PAN2: default to the released negative prompt; align serving and cookbook with CFG 2.5
An empty negative prompt now selects the release's structured negative caption with its time ranges set to the
clip's duration, as the reference sampler does; a single space still gives the empty unconditional prompt.
The serving config and cookbook now say guidance 2.5, matching the presets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 d637f14f08 [docs] PAN2: point the guardrail install at MBZUAI-IFM/PAN2-guardrail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William LinandClaude Opus 5.5 4f28086f0e [feat] PAN2: prompt and video guardrails, on by default
PAN 2's vLLM-Omni and Diffusers integrations check every prompt and every
generated video with the `pan2-guardrail` package's PAN2SafetyChecker, on by
default. FastVideo now does the same:

- `PAN2PromptGuardrailStage` checks the prompt right after input validation,
  before any compute. It also refuses `output_type="latent"`, which the video
  check cannot see.
- `PAN2VideoGuardrailStage` checks each decoded video after the decoding stage,
  as the uint8 `[T, H, W, 3]` frames the generator delivers.
- A blocked prompt or video raises `PAN2GuardrailViolationError`.
- `PAN2PipelineConfig.enable_guardrails` (default True) turns both checks off;
  `offload_guardrail_models` keeps the guard models on CPU between checks.
  Loading fails with install instructions when the package is missing and the
  guardrails are on.
- With sequence parallelism, only the first rank of the SP group loads the
  checker and runs the checks; it broadcasts the verdict, so every rank raises
  together and the guard models take memory on one GPU.

The parity test turns the guardrails off (random-weight checkpoint). Docs and
PORT_STATUS updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:31:55 +00:00
William Lin 86ef6bfadf [perf] PAN2 sampling: Wan2.2 VAE decode kernel, split decode, fused DiT kernels
- fastvideo-kernel/wan22_vae_decode: the Wan2.2 (TI2V-5B) VAE decoder on sm_100a / sm_103a at 704x1248, built on
  first use against fastvideo-kernel's CUTLASS submodule. It frees intermediates early and carries 4 latent frames
  per pass: a 5 s video peaks at 20.3 GiB, down from 94.6 GiB in the kernel's first version, with the same output.
- WanVAEConfig.decode_kernel routes AutoencoderKLWan.decode through it where it applies (bf16 with fp32
  accumulation, about 7x faster than the fp32 decode on a B300, PSNR 61-63 dB, SSIM 0.998 against it);
  decode_kernel_parallel splits the decode over the sequence-parallel group (2, 4 or 8 GPUs) and broadcasts the
  video, with the ranks agreeing on whether every one of them could build the kernel.
- PAN2's DiT runs fused Triton kernels for Q/K RMSNorm + RoPE and LayerNorm + modulation (pan2_fusions,
  set_fused_kernels).
- PAN2PipelineConfig turns all three on (vae_decode_kernel, vae_decode_kernel_parallel, dit_fused_kernels).
- VideoGenerator copies a decoded RGB video's frames to the host once instead of once per frame.
- The PAN2 presets sample at guidance 2.5, the reference launcher's default since 2026-10-23.
2026-11-03 20:31:55 +00:00
William Lin fa4e3659c7 [new-model] Re-add PAN2 text-to-video and image-to-video (reverts #2025)
This reverts commit 6743f4b4b, restoring #1961.
2026-11-03 20:31:55 +00:00
Aryan KumarandAryan Kumar 661d18ba55 [docs] Pika H3 Flex cookbook: --weights for the NVFP4 QAD releases and FP4 attention (#2054)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-03 01:07:54 -08:00
Aryan KumarandAryan Kumar 4b4df1a94e [perf] Fused Q/K preconditioning + NVFP4 quantize for FA4 NVFP4 attention (bit-identical) (#2052)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-03 01:07:11 -08:00
Aryan KumarandAryan Kumar 7066408fb3 [feat] Pika H3 Flex NVFP4 QAD training: calibration, QAD, FP4 attention and export (#2051)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-03 01:04:26 -08:00
Aryan KumarandAryan Kumar fcec554456 [feat]: shared FastH3 NVFP4 FP4-attention QAD recipe (OmniRef + V2 T2AV) (#1989)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-03 00:54:28 -08:00
Aryan KumarandAryan Kumar 181725e3fd [docs] Fix cookbook component selection and memory reporting (#2045)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-03 00:54:18 -08:00
Aryan KumarandAryan Kumar 3fe9c0c70d [bugfix]: get the full CI suite green on main (pytest 9 flag teardown, Qwen golden env) (#2059)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-02 23:32:40 -08:00
William Lin de873eae2d [bugfix] Pass disable_autocast through to FastVideoArgs (#2056) 2026-11-02 13:42:08 -08:00
4f80c5a3da [feat] Open-H3-Regenerate-2K: regenerate FastH3 QAD, Trim and V2 drafts at 2K (text to 2K 3.1-3.4x faster) (#2037)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
Co-authored-by: Aryan <aryan@aryan5v.dev>
2026-11-02 03:44:28 -08:00
Aryan KumarandAryan Kumar b0047cfedc [feat] Open-H3-Regenerate-2K: NVFP4 H3 video decoder (decode 23 s to 5 s at 2K) (#2036)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:51:41 -08:00
Aryan KumarandAryan Kumar ac81198d33 [new-model] Open-H3-Regenerate-2K: 768P H3 draft to 2560x1440, served on the OpenAI video routes (#2035)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:45:09 -08:00
Aryan KumarandAryan Kumar cb02062930 [new-model] Add Pika H3 Flex inference support (#2038)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:33:10 -08:00
Aryan KumarandAryan Kumar d954fad9ec [perf] MiniMax H3: faster FP4 attention padding, uint8 VAE pixel path and cuDNN FP4 GEMMs (#2046)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:23:10 -08:00
Aryan KumarandAryan Kumar 166b9b8a07 [perf] MiniMax H3: fuse VAE decoder QK RMSNorm and partial RoPE (#2041)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:15:35 -08:00
Aryan KumarandAryan Kumar 7e1ed5e28e [perf] MiniMax H3: decode eight VAE spatial tiles per call by default (#2040)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 22:06:23 -08:00
Aryan KumarandAryan Kumar cb6a9a13e1 [bugfix] FA4 JIT cache vs tuning env, MXFP8 import and scale dtype, H3 VSA gate double quantization (#2049)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 19:11:25 -08:00
Aryan KumarandAryan Kumar 0d1244a869 [perf] MiniMax H3: opt-in faster kernel tier for the DiT fused ops (#2042)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 15:22:09 -08:00
Aryan KumarandAryan Kumar 18b2a35106 [bugfix] FA4: stop forwarding max_seqlen to the varlen kernel (#2043)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-11-01 15:21:38 -08:00
Aryan KumarandAryan Kumar 4d0a10d989 [docs] Fix the docs build, cookbook memory status, and broken commands (#2023)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-30 17:08:41 -07:00
Lifa Ha d9e6c3eb82 [bugfix] Fix extra work in VSA64 layout benchmark (#2027) 2026-10-30 02:30:07 +00:00
Aryan Kumar 7203b4976e [bugfix]: compile only the LoRA delta, not the wrapped base layer
BaseLayerWithLoRA.forward was decorated with torch.compile, so wrapping a linear also compiled its base layer.
Compiling a packed NVFP4/FP8 linear on its own changes its numerics, so a wrapped layer at strength 0 could differ
from the unwrapped layer. forward now adds no compiled region: the base layer runs exactly as it would unwrapped
(eagerly, or traced with a caller's compiled block), and only the adapter delta is compiled.
2026-10-28 14:49:15 -07:00
Aryan Kumar 6bb444eef1 [bugfix]: run the base layer while a LoRA wrapper has no adapter 2026-10-28 14:49:15 -07:00
Aryan Kumar 6743f4b4b7 Revert "[new-model] Add PAN2 text-to-video and image-to-video" (#2025) 2026-10-27 18:03:59 -07:00
465654d900 [bugfix] Reject missing CFG negative conditioning during input validation (#2011)
Co-authored-by: Weiers <16632241+zoechen1212@user.noreply.gitee.com>
Co-authored-by: Aryan Kumar <156166681+aryan5v@users.noreply.github.com>
Co-authored-by: aryan5v <aryan5v@users.noreply.github.com>
2026-10-27 08:45:21 +00:00
69b3829293 [bugfix] Normalize local and HF-cache model paths before registry lookup (#1997)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Aryan Kumar <156166681+aryan5v@users.noreply.github.com>
2026-10-27 07:47:20 +00:00
William Linandaryan5v a0e6cf1f50 [new-model] Add PAN2 text-to-video and image-to-video (#1961)
Co-authored-by: aryan5v <email.aryan1005@gmail.com>
2026-10-25 20:20:00 -07:00
Loay RashidandAryan Kumar 0d05b09c57 [new-model] Add initial Qwen-Image-2.1 inference (#1918)
Co-authored-by: Aryan Kumar <156166681+aryan5v@users.noreply.github.com>
2026-10-25 17:28:49 +00:00
Kyle HuandAryan Kumar a92c5c1578 [docs]: add spark4 CI backend routing (#2014)
Co-authored-by: Aryan Kumar <aryank@Aryans-Mac-Studio.local>
2026-10-24 16:29:44 -07:00
Aryan KumarandAryan Kumar dfc5550c35 [ci] Add FA2-enabled Spark CI image and GB10 reference setup (#2017)
Co-authored-by: Aryan Kumar <aryank@Aryans-Mac-Studio.local>
2026-10-24 16:16:25 -07:00
posiposi443-opsandAryan Kumar 8db2d71ef2 [perf] Cache MLX H3 text refinement and speed up attention (#2002)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-23 12:40:47 -07:00
Aryan Kumar 1a1e7216d2 [ci]: Run macOS MLX smoke when a draft PR is marked ready 2026-10-23 12:01:17 -07:00
Aryan Kumar 33bdd2528b [ci]: Require macOS MLX smoke for PRs that touch MLX code 2026-10-23 12:01:17 -07:00
Aryan Kumar 9bbdd18548 [ci]: Fix env-policy and schema-parity contract tests
The unit lane fails on main in two contract tests. All three failures are
bookkeeping that drifted from the code, not runtime bugs:

- `test_env_policy.py::test_env_doc_table_matches_registry`: the generated
  table in docs/contributing/env_vars.md is stale for
  FASTVIDEO_MLX_QUANT_GEMM. Regenerated with the documented command
  (`python fastvideo/tests/contract/test_env_policy.py`).
- `test_env_policy.py::test_env_access_follows_policy`: two new violations.
  - fastvideo/tests/mlx/test_mlx_affine_dq_gemm.py wrote
    FASTVIDEO_MLX_QUANT_GEMM through monkeypatch.setenv; now uses the
    registered field's override() through the env_overrides fixture.
  - fastvideo/tests/train/models/test_load_kandinsky5.py read
    FASTVIDEO_ATTENTION_BACKEND with `not in os.environ`; now uses
    envs.FASTVIDEO_ATTENTION_BACKEND.is_set() and override(). Its entry in
    KNOWN_VIOLATIONS is deleted, as the shrinking-list rule requires.
- `test_schema_parity_inventory.py::..._extension_fields_are_classified`:
  MiniMaxH3PipelineConfig declares video_scheduler_shift and
  audio_scheduler_shift (training-time noise clocks rejected by
  check_pipeline_config at inference); both are added to
  pipeline_config_extensions.internal_only.

Test plan (CPU, no GPU required):

  python -m pytest fastvideo/tests/contract/test_env_policy.py \
      fastvideo/tests/api/test_schema_parity_inventory.py \
      fastvideo/tests/mlx/test_mlx_affine_dq_gemm.py -q
  # 45 passed

  python -m pytest fastvideo/tests/contract/ fastvideo/tests/api/ -q -m "not gpu"
  # 501 passed
2026-10-23 11:08:37 -07:00
Aryan KumarandAryan Kumar 7c2b447264 [ci] Run single-GPU CI lanes on a DGX Spark runner; weekly full suite on main (#2007)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-22 13:44:55 -07:00
William Lin e136c2b7f8 [infra]: fix the DGX Spark (GB10) Docker image: importable flashinfer, sm_121a kernels, native-matching output (#1986) 2026-10-22 11:59:31 -07:00
Aryan KumarandAryan Kumar fa2d1324c6 [feat]: FastH3 Omni (Ref2VA) on Apple Silicon MLX (#2000)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-21 12:01:54 -07:00
William Lin cdda1b7535 [feat] Add H3 PDD/DMPDD training and packed Ref2VA preprocessing (#1984) 2026-10-20 11:15:57 -07:00
Aryan KumarandAryan Kumar 089a5a55a0 [feat] Cookbook serving, hardware catalog, and landing page (#1999)
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-20 09:10:29 -07:00
Aryan Kumar 137d9110ca [docs] Make cookbook copy actions explicit and hardware opt-in (#1992) 2026-10-20 09:00:56 -07:00
d4f144581d [feat] Add capacity metadata to existing cookbook model manifests (#1983)
Co-authored-by: leo <yixingwang@YIXINGs-MacBook-Pro.local>
Co-authored-by: aryan5v <email.aryan1005@gmail.com>
Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com>
2026-10-20 08:24:19 +00:00