【Hackathon 9th No.99】[Feature Enhancement]Add tensorrt backend for compiler #237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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输出


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