thu-ml / thu-ml/TurboDiffusion

请求新增 RTX 5090 平台 FP8 推理优化分支

Open
#131 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.7k
Forks
277
Avg merge
2h 57m
Merged PRs (30d)
2

Description

你好,非常感谢你们出色的工作。

我们在 RTX 5090 平台上测试并应用 TurboWan2.1-T2V-14B-720P-quant 模型时,充分感受到了该模型在视频生成效果和推理速度方面的突出表现。生成视频质量优秀、视觉效果稳定,同时推理速度非常快,在实际应用中展现出了很强的实时生成能力。

目前,我们已经基于该项目完成了一些面向 RTX 5090 平台的 FP8 推理优化工作,希望能够通过新增一个独立分支的方式提交相关改动,方便你们 review、测试和后续合并。

已完成的优化内容
1. Wan2.1-14B FP8 推理优化

建议新增 5090_WAN2.1 分支,面向 TurboWan2.1-T2V-14B-480P/720P 在 RTX 5090 上的 FP8 推理场景。

本次优化主要引入了以下内容:

  • 引入 FP8 Linear / FFN 相关算子
  • 支持 FP8 row-wise quant 与预量化输入 Linear
  • 融合 GELU + FP8 quant 计算路径
  • Norm / RoPE / transpose 等融合路径

这些改动主要用于提升 Wan2.1-14B 在 RTX 5090 平台上的 FP8 推理效率,降低推理开销,并进一步提升实际部署场景下的视频生成速度。

2. DiT 模块修复与加速

针对 Wan2.1 DiT 模块的热路径进行了修复和加速优化,主要包括:

  • 支持 Q / K / V FP8 量化复用;
  • 支持 SageSLA 预转置 Q / K;
  • 融合 attention 输出阶段的 add + transpose + FP8 quant;
  • 支持 FFN FP8 up / down projection;
  • 融合 residual-scale 路径;
  • modify_model.py 中新增 --quant_linear_fp8 模型转换支持;
  • 降低模块替换阶段的显存峰值。

这些优化主要面向 DiT 推理过程中的高频计算路径,能够减少不必要的数据搬运和中间显存占用,从而进一步提升整体推理性能。

3. 测试验证

已补充 TurboWan2.1-T2V-14B FP8 转换与推理说明,采样步数统一设置为:

--num_steps 3
--attention_type sagesla
--sla_topk 0.1
模型 | DiT 模块 FP8 推理耗时
--     |    --
Wan-2.1-T2V-14B-480P-fp8 | 7.5s
Wan-2.1-T2V-14B-720P-fp8 | 18.1s
4. 请求事项

希望你们可以帮忙 review 远程分支:

5090_WAN2.1

并评估这些 RTX 5090 FP8 推理优化是否适合合入当前项目。

如果当前提交方式、分支命名或 commit 组织方式不符合项目规范,我也可以按照你们的要求进行调整,例如:

重新整理 commit;
修改分支命名;
补充测试说明;
提供 patch / diff 文件;
按指定方式重新提交代码。

再次感谢你们优秀的工作。期待这些优化能够进一步提升 TurboWan2.1-T2V-14B-480P/720P 在 RTX 5090 平台上的 FP8 推理性能和实时视频生成能力

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed 5090_WAN2.1 branch and the model-conversion entry point in modify_model.py. Run the documented TurboWan2.1-T2V-14B FP8 conversion and inference commands with --num_steps 3, --attention_type sagesla, and --sla_topk 0.1. Done requires maintainer review, reproducible 480P/720P results, and agreement on branch and commit organization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai-infra-agents, machine-learning, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.