Tencent-Hunyuan/Prism
Dynamic block-sparse attention for native 2K joint video–audio training
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Prism is a Python/PyTorch diffusion research stack for native high-resolution video–audio training. It partitions tokens into spatiotemporal macro-zones, then uses directional video feature variance and feature norms from audio-to-video cross-attention to choose a block shape for each zone. Partitioning is finer along axes with rapid visual change or strong audio–visual coupling. A hybrid block selector then decides how sparsely each query attends, so both block geometry and routing adapt to the input.
For training, pdsh_train.sh dispatches train_wan_ti2va.sh across nodes, and torchrun starts hymm/train_t2va_wan.py. FSDP shards parameters, while sequence parallelism distributes one sample’s tokens across GPUs. The stack pins diffusers==0.33.0 and transformers==4.57.1 and includes FlashAttention, Triton, and yunchang. Experiment settings and resolution-specific model and data settings live in separate YAML files.
Key Capabilities & Differentiators
Prism supports native joint training and preview inference at 720p, 1080p, and 2K. Inference loads a MOVA-360p base and a Prism preview checkpoint separately. It accepts separate text prompts for video and audio, an optional reference image for image-to-video generation, and writes MP4 output. Recommended height × width settings are 720 × 1280, 1072 × 1920, and 1440 × 2560. The default is 205 frames; a requested count that does not satisfy (n − 1) % 4 == 0 is adjusted automatically.
Training consumes CSV manifests with one row per clip, linking cached WAN VAE .npy latents in [C, T, H, W] order to the source video, audio, and caption. Source video supplies the reference frame, and frame rate is used for audio–video alignment. tools/build_dataset_csv.py can scan latent headers and print bucket occupancy before launch. The distributed batch sampler draws each mini-batch from one bucket to keep tensor shapes consistent across data-parallel ranks.
Trade-offs & Limitations
Full attention is the natural experimental control: it preserves all token interactions but has quadratic cost as sequence length grows. Prism uses video and cross-modal signals to decide which interactions to keep, making sparsity part of training rather than just an inference optimization. Experiments report a 2.5× training speedup over full attention and better generation quality in that comparison. That result is not a basis for predicting inference speed or assuming the same gain on a different cluster.
An inference-only sparse approach is a better first comparison if you already have a checkpoint and only want cheaper serving. Prism adds offline latent extraction, CSV bucketing, and coordination across FSDP and sequence-parallel workers. Even preview inference at higher resolutions requires multiple large-memory GPUs. The root contains a LICENSE file, but the terms are unspecified here; verify code and weight permissions separately before commercial deployment or redistribution.
Hardware & Deployment Guide
This is a self-hosted GPU CLI workflow. The setup requires Python 3.10 or later, CUDA 12.4 or later, and system ffmpeg; the installation uses PyTorch 2.7.1 with matching CUDA 12.4 wheels and a CUDA-capable FlashAttention build. Download and arrange the MOVA and Prism weights locally, then set their paths in the launcher. prism_infer.sh supports single-GPU and DeepSpeed multi-GPU inference; prism_infer_fsdp.sh is recommended for 1080p and 2K.
Budget one NVIDIA 80 GB GPU for 720p inference and at least four for 1080p or 2K. Native training raises that to at least 32 such GPUs at 720p and 64 at either higher resolution. For multi-node training, verify the pdsh node list and ensure checkpoint, latent, and media paths resolve on the workers. Preview alpha targets stability and beta targets motion; Prism-pro remains pending, and there is no tagged GitHub release.
.npy latents and a CSV manifest feed shape bucketing and distributed single-bucket batches.pdsh and torchrun launch hymm/train_t2va_wan.py using a top-level experiment YAML and a resolution-specific inject YAML.Multimodal diffusion research teams with an 80 GB GPU cluster that want to train natively at high resolution and compare content-adaptive sparsity against full attention.
You need single-GPU 2K generation, a turnkey hosted API, acceleration for an unrelated pretrained model, or commercial terms you can rely on without further review.
Quick Start & Installation
# 1 — Install PyTorch (CUDA 12.4) pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu124 # 2 — Install core dependencies pip install -r requirements.txt # 3 — Install FlashAttention (requires CUDA) pip install flash-attn --no-build-isolation # 4 — Install `ffmpeg` (system-level) sudo apt-get install ffmpeg # 5 — Verify the installation python -c " import torch, diffusers, transformers, flash_attn, triton from audiotools import AudioSignal from decord import VideoReader print(f'torch {torch.__version__}') print(f'diffusers {diffusers.__version__}') print(f'transformers {transformers.__version__}') print(f'flash_attn {flash_attn.__version__}') print(f'triton {triton.__version__}') print('All imports OK ✅')"
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/Tencent-Hunyuan/Prism.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about Prism
How do I connect the base model, Prism checkpoint, and inputs?
--ckpt and Prism preview weights through --resume_ckpt. Set --config and the output dimensions for the target resolution. Use --prompt and --audio_prompt for text conditioning, and add --ref_path for image-to-video generation. Training uses a separate CSV pipeline with cached WAN VAE video latents and source media.What GPU configuration should I budget for?
Can I self-host Prism or use it commercially?
LICENSE file exists, but the applicable terms are unspecified here. Before deployment or redistribution, review the code license and the terms for both the MOVA base weights and the Prism preview weights.When should I choose Prism over full attention or inference-only sparsity?
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