Skip to content

Conversation

@lightzhan-intellif
Copy link
Contributor

Hi,
This is a bug fix discussed here. Any further suggestion is welcome.

cc @junrushao

@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 4, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: bugfix, tvmscript See #10317 for details

Generated by tvm-bot

@github-actions github-actions bot requested a review from junrushao January 4, 2023 02:28
@lightzhan-intellif lightzhan-intellif changed the title [BugFix][TVMScript] Fix the roundtripability of pow intrinsic. [BugFix][TVMScript] Fix the roundtripability of pow intrinsic Jan 4, 2023
@lightzhan-intellif lightzhan-intellif changed the title [BugFix][TVMScript] Fix the roundtripability of pow intrinsic [BugFix][TVMScript] Fix the roundtripability of intrinsic pow Jan 4, 2023
@lightzhan-intellif
Copy link
Contributor Author

@tvm-bot rerun

assert "-> None" not in script


def test_pow_roundtripable():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use the ir_generator to make tests consistent in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please address comments from @Hzfengsy

@junrushao
Copy link
Member

BTW, there are some existing logics that depend on the python API tir.power, so please keep a copy as it is for backward compatibility

@lightzhan-intellif
Copy link
Contributor Author

Do you mean that users can use both tir.pow and tir.power? I think it looks like a little bit confusing and redundant. How about we do not make any change to tir.power?

nextafter = _op_wrapper(_tir_op.nextafter)
popcount = _op_wrapper(_tir_op.popcount)
power = _op_wrapper(_tir_op.power)
pow = _op_wrapper(_tir_op.power) # pylint: disable=redefined-builtin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking if we could add a pow method to tvm/tir/op.py so that it could be consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Hzfengsy Hzfengsy merged commit 048028b into apache:main Jan 5, 2023
fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
…#13692)

* Fix the roundtripability of pow intrinsic.

* fix the lint.

* Fix the lint.

* add tir.pow to make it consistent.

Co-authored-by: lightzhan-intellif <[email protected]>
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