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.
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
[Hackathon NO.74] 为 Paddle-TRT 添加 grid_sampler 算子 #50934
[Hackathon NO.74] 为 Paddle-TRT 添加 grid_sampler 算子 #50934
Changes from 1 commit
84e9632
a017a1d
27ec5ad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
这个类在trt 8.5以下会有编译问题,可以参考one_hot处理方式
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.
已增加宏,防止编译出错
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.
PR-CI-Coverage,没有过,这个CI无法点击重新运行,应该怎么重新跑呢
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.
这个ci Coverage问题,由于单测环境没有trt 8.5,可以在本地用trt8.5验证下
python python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_grid_sampler.py
。并附上正确结果截图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.
本地验证单测通过,"in in in"为grid_sampler.cc中的验证打印信息,可见成功进入grid_sampler.cc中进行TRT layer的转换,在PR describe中也补充了一下。
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.
单测可能需要补全,支持
align_corners
、mode
、padding_mode
属性组合,另外输入会有[N, C, D, H, W]输入形式。定义见https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/functional/grid_sample_cn.html#grid-sample,实现可参考https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/cpu/grid_sample_kernel.ccThere 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.
已补充,所有属性的四维和五维的单侧通过。
另外TRT8.5中,gird_sampler layer只支持四维,在op_teller中加入了判断,如果input和grid不为四维,就return false,通过通用plugin的方式,通用plugin的grid_sampler中还有一个小bug,一起修改了。