-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement basic cache and support resnet in tvm backend #76
base: main
Are you sure you want to change the base?
Conversation
目前已经可以实现 ResNet 的端到端推理(tvm后端),目前速度比 paddle动态图慢了很多,大概耗时是20倍,不优化的 tvm.tir 看起来速度非常慢 |
对比速度的脚本是哪个呀,我可以看一看。 |
我对比速度现在是用的viztracer直接把每行代码的速度都追踪一下,然后大概看的时间 |
|
||
|
||
class TVMCompiler(CompilerBase): | ||
def gen_compiled_func(self, symbol_table: SymbolTable[te.Tensor, paddle.Tensor]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于tvm,不知道有没有可能利用现有的tvm的这个API:tvm.relay.frontend.from_paddle。
也就是, 先把捕获到的子图,转成paddle的静态图,然后用tvm.relay.frontend.from_paddle
给加载进来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这几天尝试一下,看起来是可以的。不过这样的话就感觉主要工作量都在动转静和tvm的tvm.relay.frontend.from_paddle这个接口的适配了,看起来 paddlefx 的内容很少
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,可以探索看看。好处是,可以复用现有的tvm里已有的,成熟的,paddle IR到tvm IR的转换,理论上,能很快实现较多的模型,lower到tvm来运行。
如果从头做fx graph到tvm IR的转换的话,感觉工作量是不少的。
本 PR 包含以下内容: