【Hackathon 9th No.97】[Feature Enhancement] Add Tvm Backend for test_compiler #245
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
添加tvm后端,使用tvm中relax前端和compile后端来进行处理,(relay前端在新版本中被去掉了)
测试使用tvm版本为0.22.0
tvm使用cuda需要从源码编译安装,参考https://github.com/apache/tvm/blob/main/docs/install/from_source.rst
tvm的性能依赖于pass,按照文档中基础的pass会性能很差,不如torch原生的前向推理,如果使用自动调优的话,性能上会好一些,但是一个简单的模型要花费数小时来进行优化,编译很慢
tvm的dynamo来加载计算图时,大部分大模型的embedding层它无法识别,也没办法使用
(tvm官网的文档是我看过最烂的文档,没有一个示例能正常运行,9.2文档官网还乱码了,点着点着就到0.12版本去了)