Skip to content
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

[TE][Fix] Comparison of the output tensor #9829

Merged
merged 4 commits into from
Feb 20, 2022
Merged

Conversation

leeexyz
Copy link
Contributor

@leeexyz leeexyz commented Jan 4, 2022

Hi All,

I encountered an issue that the comparison between the output tensor and itself.

  1. Rank-0 Tensor. Do not support comparison even if compare to the tensor itself. There is a use case that tensorize a no keep-dims reduction compute to an HW intrinsic, and it is will be failed in the buffer bind step.
  2. Other Tensor. Every time when invoking tensor.op.output(i), the address of the tensor is charged, it is a little bit confusing. The result is that we cannot simply use same_as to check a tensor.

So I added the outputs member in class Operation, and recorded the output tensors on the first invocation of Operation::output. This is a minor change and would be the simplest way to fix it. :)

What is more, I did not modify the functions output_dtype and output_shape accordingly.

@junrushao
Copy link
Member

CC @Hzfengsy would you like to take a look? Thanks!

@Hzfengsy
Copy link
Member

Could you please rebase it and make CI green?

@leeexyz
Copy link
Contributor Author

leeexyz commented Feb 14, 2022

@Hzfengsy It seems this modification impacts the hybrid op, which needs a different output tensor every time.

@leeexyz leeexyz force-pushed the te_fix branch 2 times, most recently from 0fcbee2 to a96e47d Compare February 17, 2022 16:44
@leeexyz
Copy link
Contributor Author

leeexyz commented Feb 19, 2022

@Hzfengsy Would you mind taking a look? I fixed the Hybrid Op issue. :)

@Hzfengsy Hzfengsy merged commit 73cf51b into apache:main Feb 20, 2022
@AndrewZhaoLuo
Copy link
Contributor

There appears to be a memory leak from this when tuning some models on gpu. I'm taking a look at this rn

@AndrewZhaoLuo
Copy link
Contributor

Please review #10540

AndrewZhaoLuo added a commit that referenced this pull request Mar 9, 2022
@leeexyz leeexyz deleted the te_fix branch March 9, 2022 06:56
masahi pushed a commit that referenced this pull request Mar 9, 2022
ziqiangxu8457 pushed a commit to ziqiangxu8457/tvm that referenced this pull request Mar 9, 2022
ziqiangxu8457 pushed a commit to ziqiangxu8457/tvm that referenced this pull request Mar 12, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
* [TE][Fix] Comparison of the output tensor

* fix hybrid op issue

* fix tensor replacement in schedule ops

* fix compute inline
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants