ifm-ai/PAN2
HF Paper ↗Train and run a dual-stream video transformer for action-conditioned world modeling
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
train.py drives YAML-configured training for a 29.2B-parameter video transformer with 44 joint-attention blocks over video and state streams. The backbone uses 3D RoPE and RMS query/key normalization. Qwen3.5-9B hidden states feed the caption projection, with a budget of 1,536 caption tokens; Wan 2.2 provides the video latent representation.
The loader reads precomputed latents from local disk, packs samples to a token budget, and can mix in image data. It neither decodes pixels nor runs the VAE in the training loop. The PyTorch stack combines FSDP2 hybrid sharding, optional Ulysses context parallelism, and Muon, with FlashAttention 4 and Quack in the pinned CUDA kernel stack. YAML configurations and checkpoint conversion are the main integration points.
Key Capabilities & Differentiators
PAN 2 generates text-to-video and image-to-video from action descriptions. A shared 97-channel input concatenates 48 noisy latent channels, 48 conditioning channels, and a mask; image-to-video uses the first latent frame as the condition. The 704 × 1248 recipe runs at 24 fps and supports up to 481 frames (roughly 20 seconds), with 858 tokens per latent frame after patching.
The trainer covers pretraining and supervised fine-tuning, with logit-normal timestep sampling for pretraining and uniform sampling for SFT under a flow-matching objective. Native inference accepts prompt JSON and offers optional rewriting into structured captions. The rewriter is a separate text step, not a physics verifier. Checkpoint tooling converts transformer weights between native and Diffusers layouts without retraining.
Trade-offs & Limitations
Offline latents remove pixel decoding and VAE compute from each training step, but move preprocessing cost to a separate job and make local storage throughput part of the training budget. Changing the latent representation requires regenerating compatible training data. Context parallelism can help fit long sequences, with communication costs that should be tested on the intended cluster rather than inferred from a debug run.
For inference only, Diffusers or vLLM are integration paths for the same model, not substitutes for the native data and training stack. The repository covers pretraining and SFT but omits the reward learning and model soup used to produce the released weights, so it does not reproduce the full release pipeline. For robotics or planning, a plausible video is useful for proposing outcomes, not as evidence of a constraint-checked state transition.
Hardware & Deployment Guide
The baseline CLI environment uses Python 3.14 and CUDA 13.2 wheels: install PyTorch 2.12.1 and torchvision 0.27.1 from the cu132 index first, followed by the prerelease FlashAttention 4 build and Quack kernels in the specified order. Check the H200 guide and kernel compatibility notes against the target driver and GPU. Cache Qwen3.5-9B for text encoding and Wan 2.2 for offline data preparation and inference.
Use the Slurm scripts for pretraining or SFT and inference/inference.sh for single-node batch generation. Training resumes from the latest checkpoint in the configured output directory, so use a separate directory for a deliberately fresh run. Size memory and local storage throughput against representative clip lengths and workloads. Single-node prompt sharding increases batch throughput; it is not pooling VRAM for one clip. No GitHub release milestone is listed; pin the code revision, model artifacts, and environment for reproducibility.
generate.py workers shard prompt lists across GPUs, with BF16 sampling and completed-clip skipping in the launch workflow.Research teams with CUDA GPU infrastructure and an offline latent pipeline that want to pretrain, fine-tune, or batch-evaluate action-conditioned video models.
You need lightweight inference on commodity hardware, exact reproduction of the full released-weight recipe, or a simulator that exposes verifiable physical states.
Quick Start & Installation
conda create -n pan python=3.14 -y && conda activate pan pip install torch==2.12.1 torchvision==0.27.1 --index-url https://download.pytorch.org/whl/cu132 pip install --pre "flash-attn-4[cu13]==4.0.0b29" --no-build-isolation pip install "quack-kernels[cu13]==0.6.4" pip install -r requirements.txt
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/ifm-ai/PAN2.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about PAN2
Can I serve a native training checkpoint through Diffusers?
scripts/convert_checkpoint.py. The conversion renames, splits, and concatenates tensors rather than retraining the model. Use the matching architecture YAML and provide the Qwen3.5-9B text encoder and Wan 2.2 VAE separately. A converted transformer is not a full training-resume checkpoint.How should I size GPUs for training and inference?
What does Apache-2.0 cover for commercial self-hosting?
NOTICE and THIRD_PARTY_LICENSES. Check the terms for the PAN 2 weights, upstream model assets, and any training data separately; the code license does not establish those rights.When should I choose the native repository over Diffusers, vLLM, or a simulator?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy