Torch Compile Settings
节点功能:用于配置 PyTorch 的 torch.compile 编译参数,用于 FramePack 视频模型加载时对其指定的模块进行 JIT 编译,以优化推理速度Torch Compile
节点中英文对比
Torch Compile Settings
backend
fullgraph
mode
dynamic
dynamo_cache_size_limit
compile_single_blocks
compile_double_blocks
Torch Compile Settings
backend
fullgraph
mode
dynamic
dynamo_cache_size_limit
compile_single_blocks
compile_double_blocks
Torch Compile Settings - 参数说明
输出参数
torch_compile_args
Torch 编译配置参数集合,用于模型加载器。
控件参数
backend
指定 torch.compile 使用的后端优化引擎。inductor 是最常用的 JIT 编译后端,推荐使用;cudagraphs 更适合静态图。需根据硬件和模型选择。
fullgraph
是否启用完整图模式。若为 True,则要求模型是完整图结构,优化幅度更大,但对动态模型不友好。建议默认关闭。
mode
torch 编译模式,控制优化策略。
优化策略。 - default: 默认配置;
- max-autotune: 最大性能自动调优;
- max-autotune-no-cudagraphs: 禁用 cudagraphs 的最大调优版本;
- reduce-overhead: 优化启动性能,适用于短模型。建议从 default 开始测试。
dynamic
是否启用动态形状支持。如果模型输入尺寸会变,建议启用。否则可关闭以获得更高性能。
dynamo_cache_size_limit
设置 Torch Dynamo 的缓存大小上限。
compile_single_blocks
是否对单层 block 进行编译。推荐开启,可以减少显存压力,提高模块复用。
compile_double_blocks
是否对双层 block(Transformer 结构)进行编译。推荐开启,对大型模型如 Transformer 特别有效。
暂无节点说明