BBuf/HunyuanVideo-ModelOpt-FP8-SGLang
HunyuanVideo ModelOpt FP8 SGLang Transformer
This repository contains a SGLang-ready ModelOpt FP8 transformer override for `hunyuanvideo-community/HunyuanVideo`. It only replaces the DiT/transformer weights; text encoders, VAE, scheduler, tokenizer, and other non-transformer components are loaded from the original base model.
The checkpoint is intended for SGLang Diffusion with the HunyuanVideo FP8 support from sgl-project/sglang#23199.
Usage
sglang generate \
--backend=sglang \
--model-path hunyuanvideo-community/HunyuanVideo \
--transformer-path BBuf/HunyuanVideo-ModelOpt-FP8-SGLang \
--prompt "A cat and a dog baking a cake together in a kitchen. The cat is carefully measuring flour, while the dog is stirring the batter with a wooden spoon. The kitchen is cozy, with sunlight streaming through the window." \
--seed=42 \
--text-encoder-cpu-offload \
--pin-cpu-memory \
--num-frames=65 \
--fps=13 \
--width=848 \
--height=480 \
--num-inference-steps=30 \
--save-output \
--warmup \
--enable-torch-compileThe command above follows the HunyuanVideo preset used by the sglang-diffusion-benchmark-profile skill. The --num-frames=65 --fps=13 pair gives an exact 5.000s video.
H100 Validation Snapshot
Validation was run on one H100 GPU using rank0 (CUDA_VISIBLE_DEVICES=0) with --backend=sglang. Logs show Using pipeline from model_index.json: HunyuanVideoPipeline; no diffusers fallback markers were observed.
Artifacts:
- Validation tree: `validation/h100_skill_5s_20260420`
- Full command and run summary: `result_summary_skill_5s.md`
- BF16 video: `hunyuanvideo_bf16_skill_5s.mp4`
- FP8 video: `hunyuanvideo_fp8_skill_5s.mp4`
- Profiler traces: BF16, FP8, kernel summary

Benchmark, warmup excluded:
Profiler kernel share over 5 profiled denoise timesteps. Profiler timings include profiling overhead and are not used as benchmark latency numbers.
Conversion Notes
The checkpoint was converted from a ModelOpt FP8 export with SGLang's build_modelopt_fp8_transformer tool using the hunyuan-video preset. The preset keeps numerically sensitive embedder, modulation, and output layers in BF16, and maps ModelOpt/diffusers module names to SGLang runtime module names for fused QKV and fused QKV+MLP projections.
One runtime caveat: the CLI can keep the same offload flags as the BF16 skill preset, but ModelOpt FP8 checkpoints currently force dit_cpu_offload off while preserving layerwise offload behavior for restored FP8 tensor strides.
