Skip to content

Conversation

fangfangssj
Copy link
Contributor

@fangfangssj fangfangssj commented Aug 24, 2025

PR Category

Feature Enhancement

Description

为test_compiler添加tensorrt后端
samples里面提取的计算图有GPU和CPU上的两种类型,为test_compiler添加根据当前设备来加载计算图,而不是使用计算图中信息,避免tensorrt后端无法编译加载到cpu上的计算图和纯cpu设备上无法加载GPU提取的计算图。

直接使用torch.compile(m, backend="tensorrt")来添加tensorrt后端,使用TORCH_LOGS='all'来捕捉日志
samples下的所有类别的计算图,随机抽取十个计算图进行测试,百分之百的成功率,在看log的时候,大部分模型Dynamo会直接跟踪一个完整的计算图,交给后端编译,但跟踪部分计算图时被打断为子图,每一个都子图交给后端编译,(timm系列比较严重,参考#238)

前端使用Dynamo来跟踪前向传播,后端使用tensorrt编译,黄色框里为测试log输出
image
image

下面为提取一个模型时的原始log信息
out.txt

Copy link

paddle-bot bot commented Aug 24, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Aug 24, 2025
@fangfangssj fangfangssj changed the title [Feature Enhancement]Add tensorrt backend for compiler 【Hackathon 9th No.99】[Feature Enhancement]Add tensorrt backend for compiler Aug 24, 2025
@lixinqi lixinqi merged commit 7a018c5 into PaddlePaddle:develop Aug 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants