Back to blog

Sol Video Inference Engine

Agent-Native Full-Stack Acceleration Framework for Efficient Video Generation

Sol Video Inference Engine: Agent-Native Full-Stack Acceleration Framework for Efficient Video Generation

一、论文概述

项目内容
标题Sol Video Inference Engine: Agent-Native Full-Stack Acceleration Framework for Efficient Video Generation
作者Yitong Li, Junsong Chen, Haopeng Li, Haozhe Liu, Jincheng Yu, Ligeng Zhu, Ping Luo, Song Han, Enze Xie
机构NVIDIA Research, Efficient AI Team & Singapore Lab
论文arXiv:2606.23743
代码github.com/NVlabs/Sol-Video-Inference-Engine
项目页nvlabs.github.io/Sol-Video-Inference-Engine
发布21 Jun 2026 (v2: 24 Jun 2026)
许可arXiv.org perpetual non-exclusive license

二、核心思想

问题定义

现代视频扩散模型通过规模扩展不断提升生成质量,但这也导致推理成本大幅增加。视频扩散推理结合数十亿参数骨干网络、长时空序列和多步采样,计算代价极高。更关键的是,最有效的加速策略高度依赖具体部署实例(model, hardware, inference configuration)——一个组合下有效的方案往往无法迁移到另一个组合。

具体而言:

  • 模型差异:不同模型在架构、数值敏感性、注意力集中度模式上各不相同
  • 推理配置差异:空间/时间分辨率、视频时长、去噪调度、批处理策略等
  • 硬件差异:从数据中心级高显存显卡到消费级边缘设备,支持的数值格式和内核吞吐量各异

这些因素共同构成了一个巨大的调优空间,使得手动性能工程成本极高。

解决方案概述

Sol Video Inference Engine 提出了一种 agent-native 的训练免费(training-free)全栈加速框架,将五种广泛适用的加速技术(cache、sparse attention、token pruning、quantization、kernel fusion)组织为可自动优化的加速栈。

核心工作流包含三个环节:

  1. 并行技能代理(Parallel skill agents):每个加速技术由独立的 skill agent 进行局部优化搜索
  2. 集成代理(Agent integrator):将各技术的候选方案组合成全局加速栈,解决技术间交互效应
  3. 人类验证器(Human validator):提供生成质量的视觉反馈,指导下一轮优化方向

该框架在三个不同规模和架构的视频模型上验证:64B Cosmos3-Super、22B LTX-2.3、2B SANA-Video,在 B200 GPU 上均实现了 2×–3× 的端到端加速,同时保持 VBench 质量指标几乎无损。

三、技术架构

整体框架图

架构图

Sol Video Inference Engine 的整体架构围绕两个耦合部分展开:

  1. 全栈加速技术:覆盖算法层(cross-step cache)、模型层(sparse attention, token pruning)和内核层(quantization, kernel fusion)
  2. Agent-native 工作流:将传统上由多个团队分别完成的工作自动化

整个流程分为两阶段:

  • Local parallel per-technique search:各 skill agents 独立探索各自的技术空间
  • Global integration + human-validator loop:integrator 组合局部最优解为完整加速栈,人类验证器提供质量反馈

Agent-Human 工作流对比

左图展示了传统手动加速工作流的痛点:不同专家团队分别优化不同技术,迭代周期长、沟通成本高、手动集成困难。右图展示了 Sol 的 agent-human 模式:agent 系统暴露加速技能,执行局部搜索和集成,人类主要做验证。

三层冗余分析

三层冗余

论文在 Section 3 系统分析了视频扩散推理中的三个层次的冗余:

算法层(Algorithm-level):相邻去噪步骤在缓慢变化的潜在状态上执行结构相似的计算,产生 cross-step 复用机会。扩散推理通常需要 30–50 个函数评估(NFE),相邻步骤产生相似的中间特征。

模型层(Model-level):长时空序列包含冗余 token 和注意力交互,每层每个 timestep 不需要完整的注意力图或全部 token。高分辨率/长视频场景下 token 数量极大,attention 的二次复杂度成为瓶颈。

内核层(Kernel-level):Transformer 推理中大量时间在 GEMM 周围的 memory-bound 算子上:布局转换、归一化、激活函数、精度转换等,这些操作算术强度低但 kernel launch 开销大。

部署异构性

部署组合空间

论文将加速目标定义为三维异构部署实例:(model, hardware, configuration)。

  • Model:决定数值和结构敏感性。不同骨干网络有不同的量化鲁棒性、注意力冗余度、跨去噪步骤的 cache 稳定性、对 token pruning 的容忍度
  • Hardware:决定暴露的瓶颈类型。高计算 GPU(如 B200)上大型 GEMM 可能足够快,此时小算子的 launch 开销和 memory-bound epilogues 占更大比例;低计算 GPU 上 dense compute 仍占主导
  • Configuration:运行时选择如空间/时间分辨率(720p vs 1080p、24fps vs 48fps)。改变有效 token 数量和 runtime 平衡:增加分辨率会增加序列长度,attention 随 token 数二次增长,FFN/MLP 线性增长,因此 attention-FFN 时间分割在不同分辨率下显著变化

五大加速技术

1. Cross-Step Cache(跨步缓存)

扩散推理需要大量去噪步骤(通常 30–50 NFE)。Cross-step caching 通过跳过选定的去噪步骤计算并补偿跳过的输出来利用轨迹级冗余。

可选策略:

  • TeaCache:从 timestep-conditioned 输入估计 step-to-step 输出变化,当预测变化小时复用 cached residuals
  • EasyCache:runtime-adaptive 缓存策略,在线调整特征复用以平衡加速和质量
  • TaylorSeer:用 Taylor 级数外推前几个 timestep 的特征,将特征复用扩展到特征预测

对于特定模型和部署配置,cache agent 需确定:哪种策略最合适、skip-step schedule、cached feature/residual 选择、补偿规则、warmup 策略、最大缓存步数约束。

2. Sparse Attention(稀疏注意力)

针对视频扩散推理中的大 spatiotemporal token 集,利用 temporal 和 spatial 冗余减少注意力计算。

可选方案:

  • PISA:training-free piecewise sparse attention,关键块精确计算,非关键块用一阶 Taylor 近似补偿
  • SpargeAttention:universal training-free 稀疏注意力框架,用 block-wise similarity metric 预测并跳过近零注意力条目
  • Sparse VideoGen / Sparse VideoGen2:exploit spatial-temporal sparsity patterns with online profiling

Sparse attention agent 需调优:层选择(哪些层可稀疏化,哪些保持密集以保证质量)、稀疏模式、补偿策略。

3. Token Pruning(Token 剪枝)

通过 skip、merge 或重建冗余 latent token 来减少序列本身,降低后续 attention 和 feed-forward 计算。

可选方案:

  • ToMe (Stable Diffusion):inference-time 合并冗余 diffusion tokens
  • Astraea:为视频 DiT 在性能目标下搜索 token budgets
  • TAPE:跨帧平滑 token 重要性以避免 temporal jitter
  • CoReDiT:prune spatially coherent DiT tokens 同时重建跳过输出以保持密集表示

Token pruning agent 需调优:pruning criterion、pruning ratio、layer schedule、timestep schedule、reconstruction rule。

4. Quantization(量化)

量化加速效果受模型隐藏维度、推理 token 数和硬件特性严重影响。模型的量化噪声敏感性由训练参数分布决定。

可选方案:

  • PTQ4DiT:识别 salient channels 和 timestep-varying activations 作为后训练量化的关键挑战
  • Q-DiT:自动量化粒度分配
  • SVDQuant:用 low-rank components 吸收 weight 和 activation outliers,实现 4-bit 扩散推理
  • SageAttention:target attention quantization,8-bit 到 4-bit attention 加速 with outlier smoothing

Quantization agent 需调优:layer-wise precision assignments、weight 和 activation bitwidths、timestep-dependent scaling。

5. Kernel Fusion(内核融合)

将 memory-bound 的碎片化算子(bias addition、residual updates、normalization、activation functions、scaling、layout conversion)融合执行,避免中间结果 materialize 到 HBM。

典型融合候选:

  • GEMM + GELU(epilogue fusion)
  • GEMM + residual
  • Fused RoPE + norm
  • QKV-path fusion
  • Normalization-path fusion

参考实现:CUTLASS epilogue programming、ByteTransformer、CODA(将 transformer blocks 重写为 GEMM-plus-epilogue programs)。

加速分解

加速分解

全栈加速不是单一技术的简单叠加,而是五个组件的渐进式累积效果:cache → sparse attention + token pruning → kernel-level optimization。

Human Validator 的必要性

人类验证

PSNR 等相似度指标与人类视觉感知不一致。给定高质量参考视频,PSNR 可能对 shifted visual details 分配大距离,而对 blur/temporal jitter/degraded motion 分配小距离。前者人类可接受而后者不可接受,因此人类反馈必不可少。

四、核心创新

创新点说明理论/实验依据
问题重构将视频扩散加速从一次性优化问题重新定义为 instance-specific tuning 问题Section 3 的系统分析,展示 model/hardware/configuration 三维组合空间的巨大规模
Agent-native 工作流用 skill agents + integrator agent + human validator 替代多团队协作三个模型上的自动化加速栈构建,人工投入极小
Full-stack 集成五个加速技术的协同组合,而非单点优化Table 1 显示 2×–3× 累积加速,单一技术无法达到
Instance-specific 搜索每种技术针对具体部署实例调优,不追求通用方案不同模型选择不同的 cache 策略(TeaCache vs EasyCache)、不同的量化范围

五、代码实现分析

项目结构

GitHub 仓库: https://github.com/NVlabs/Sol-Video-Inference-Engine

整体实现原则

所有三个模型共享相同的部署接口结构:

  • Dense baseline path:未加速的 SGLang 基线
  • Composed full-opt path:由加速组件组成的优化路径

运行时基于 SGLang,优化路径根据各模型架构和瓶颈选择性替换:cache reuse、sparse/reduced token computation、low-precision kernels、fused operator sequences。

全局实现原则

  • Cache:始终作为 training-free denoising-step reuse policy,但 exact schedule 因模型而异
  • Sparse attention:仅在 attention map 有足够结构时引入,用 piecewise sparse pattern 替换 dense bidirectional attention
  • Token pruning:仅在 intermediate video tokens 有足够冗余时使用
  • Quantization:selective 而非 uniform,数值脆弱阶段保持高精度,stable GEMM-heavy 区域使用低精度
  • Kernel optimization:selective,包括 epilogue fusion、QKV-path fusion、normalization-path fusion、compiler-driven graph fusion

各模型具体管线

Cosmos3-Super (64B, MoT 架构, 4×GPU)

  • Cache: TeaCache-style residual replay,threshold=1.15, start_step=10, max 3 continuous cache hits。测量 generation hidden state 相对 L1 变化
  • Quantization: Step-selective。前 3 和后 3 步保持 dense/high-precision path,中间步骤应用 NVFP4 到 GEMM-heavy generation-path linear layers(FFN gate-up/down projections, attention QKV/output projections)
  • Kernel: GEMM-heavy middle part 优化

LTX-2.3 (22B, Two-stage, 1×GPU)

  • Stage 1 (544×960, 15 steps, res_2s sampler): Fixed-step cache 8of15_last_29calls — 29 次 denoiser calls 中复用最后计算结果于索引 [13,14,16,17,18,19,20,21,22,24,25,26,27]
  • Stage 2 (1088×1920, 3 steps): PISA sparse attention 仅用于 high-resolution refinement transformer,sparsity=0.9, block_size=64, 仅替换 video self-attention
  • Token pruning: 仅限 stage 2,refinement calls 1 和 2 保留 50% video tokens(按 feat_norm saliency score)
  • Quantization: NVFP4 仅用于 video FFN input/output projections
  • Fusion: 多项 lossless fusion flags(block-0 self-attention sharing, guidance-prefix sharing, fused QK+RoPE, fused RMS-AdaLN, fused AdaLN 等)
  • LoRA: distilled LoRA strengths = 0.25 (stage 1), 0.5 (stage 2)

SANA-Video (2B, Linear Attention, 1×GPU)

  • 不使用的技术: sparse attention, token pruning, NVFP4 FFN quantization(因模型已高度优化)
  • Cache: EasyCache,threshold=0.1, warmup=3 steps, spatial subsample stride=8
  • Kernel: BF16 linear attention tensor-core execution(而非 FP32)、self-attention Q/K/V 合并为一个 GEMM(concat projection weights)、torch.compile 编译 DiT block stack
  • 效果: 50 steps 中约 16 个 skipped,剩余加速来自 BF16 linear attention、QKV merge、compile/fusion

六、实验结果

实验设置

  • 硬件: NVIDIA B200 GPUs(Cosmos3-Super 用 4×GPU with sequence parallelism,LTX-2.3 和 SANA-Video 各 1×GPU)
  • 基线: SGLang-based serving stack
  • 主指标: 端到端延迟(end-to-end latency)
  • 质量指标: VBench(visual quality + motion quality)

基准测试

可视化对比

表1:端到端加速结果(NVIDIA B200)

FrameworkCosmos3-Super (64B, 4×GPU)LTX-2.3 (22B)SANA-Video (2B)
Latency (s)SpeedupLatency (s)SpeedupLatency (s)Speedup
Official108.3–118.1–34.2–
SGLang99.61.00×97.81.00×29.41.00×
Sol-Engine43.92.27×41.02.38×10.62.77×

各模型累积加速过程:

Cosmos3-Super: SGLang 99.6s → Cache (TeaCache) 52.4s (1.90×) → Kernel optimization 43.9s (2.27×) LTX-2.3: SGLang 97.8s → Cache 70.3s (1.39×) → Sparse attn + Token prune 58.5s (1.67×) → Kernel + NVFP4 41.0s (2.38×) SANA-Video: SGLang 29.4s → Cache (EasyCache) 19.8s (1.48×) → BF16 LA + QKV merge + compile 10.6s (2.77×)

B300 扩展: 单卡 Cosmos3-Super 在 B300 上从 351.9s 降至 137.6s (2.56×),比 B200 上的 2.46× 更高,因为 Cosmos3-Super 更依赖 NVFP4 执行而 B300 的 NVFP4 能力更强。

表2:VBench 质量评估

ModelMetricBaselineSol-EngineΔ
Cosmos3-SuperAvg Score0.77590.7775+0.21%
Subject Consistency0.96870.9723+0.37%
Background Consistency0.93010.9382+0.87%
Temporal Flicker0.98590.9877+0.18%
Motion Smoothness0.99230.9935+0.12%
Aesthetic Quality0.61340.6197+1.03%
Imaging Quality0.72760.7178-1.35%
Overall Consistency0.21330.2133+0.00%
LTX-2.3Avg Score0.76460.7605-0.54%
Subject Consistency0.90100.9006-0.04%
Background Consistency0.92450.9137-1.17%
Temporal Flicker0.96750.9704+0.30%
Motion Smoothness0.98710.9840-0.31%
Aesthetic Quality0.62340.6104-2.09%
Imaging Quality0.70120.7013+0.01%
Overall Consistency0.24740.2429-1.82%
SANA-VideoAvg Score0.78640.7847-0.21%
Subject Consistency0.97300.9750+0.21%
Background Consistency0.96480.9654+0.06%
Temporal Flicker0.96260.9646+0.21%
Motion Smoothness0.98430.9842-0.01%
Aesthetic Quality0.66500.6624-0.39%
Imaging Quality0.68920.6779-1.64%
Overall Consistency0.26600.2637-0.86%

关键发现:平均分数变化均在 ±0.5% 以内,证明加速确实来自消除冗余/低效操作而非牺牲感知关键计算。

定性对比

Figure 8–10 展示了六个 matched video pairs(每模型两个),upper strip 为未加速 SGLang 结果,lower strip 为 Sol-Engine 结果。加速输出可能在细微视觉细节上有微小差异,但整体视觉质量、运动质量和物理保真度保持良好。

七、相关工作

视频扩散模型

主流开源模型包括 CogVideo/CogVideoX、Wan 系列、HunyuanVideo、Cosmos3-Super。长上下文和高分辨率场景下,LongCat-Video、LTX-2.3、JoyAI-Echo、Pyramid Flow 采用 multi-stage/autoregressive/memory-augmented pipeline。SANA-Video 则通过 linear attention 追求极致效率。尽管架构多样,所有系统面临相同的推理瓶颈。

视频生成加速

  • 算法层:TeaCache、EasyCache、TaylorSeer、PAB 等 cache 方法
  • 模型层:PISA、Sparse VideoGen/2、VSA、SpargeAttention、ToMe、Astraea、TAPE、CoReDiT 等 sparse attention 和 token reduction
  • 内核层:PTQ4DiT、Q-DiT、ViDiT-Q、SVDQuant、FP4 exploration、CUTLASS epilogues、ByteTransformer、CODA

Agentic Workflows

AgentBench、MLAgentBench、SWE-agent、AutoCodeRover、Agentless、OpenHands、AI Harness Engineering、The AI Scientist、CUDA-LLM、CudaForge。Sol 与此方向一致,但 targeting 协调多个加速技能用于视频扩散推理。

八、总结

核心贡献

  1. Problem reformulation:系统分析视频扩散推理的加速空间,将其形式化为 instance-specific tuning problem 而非一次性优化
  2. Full-stack acceleration framework:综合框架,整合 algorithmic 和 system-level 技术(cross-step caching、sparse attention、token pruning、quantization、kernel fusion)
  3. Agent-driven optimization workflow:Agent-native 架构,编排 parallel agents 和 integrator,绕过传统多团队工程需求
  4. Extensive empirical validation:训练免费的框架在多样化 SOTA 模型上实现超过 2× 端到端加速,不损害视觉质量

技术影响

  • 展示了 agent-native 全栈加速可以减少推理成本而人工投入极小
  • 框架不绑定单一 backbone,可泛化到不同规模(2B–64B)和不同架构(MoT、two-stage、linear attention)的视频扩散模型
  • 为未来自动化性能工程提供了范式

局限性

  • 依赖人类判断:最终质量评估仍需人类反馈,PSNR 等自动指标与人类视觉感知不一致
  • 未来方向:learned video preference models、artifact detectors、physics-consistency checks、VLM-based end-to-end quality judgment 可减少人工验证需求,使框架更自主

九、参考资源