Skip to content

[Target][Lowering] Update Op Intrinsic Lowering Mechanism And Intrinsic Lowering Pass - #7809

Merged
junrushao merged 41 commits into
apache:mainfrom
zxybazh:lower
Apr 24, 2021
Merged

[Target][Lowering] Update Op Intrinsic Lowering Mechanism And Intrinsic Lowering Pass#7809
junrushao merged 41 commits into
apache:mainfrom
zxybazh:lower

Conversation

@zxybazh

@zxybazh zxybazh commented Apr 8, 2021

Copy link
Copy Markdown
Member

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.

@zxybazh

zxybazh commented Apr 12, 2021

Copy link
Copy Markdown
Member Author

Python side op lowering function has been changed from register_func to register_op.

@junrushao junrushao self-assigned this Apr 13, 2021
@junrushao

junrushao commented Apr 13, 2021

Copy link
Copy Markdown
Member

Thanks for the contribution! A few high-level comments:

  1. Do not add any C API - we can use packed func to expose the interface. Op is a compile-time concept so please move the registration logic out of the runtime :-)
  2. Please change register_op to some name like register_intrin_lowering, and consider accepting a target kind like default/llvm/cuda

@zxybazh

zxybazh commented Apr 13, 2021

Copy link
Copy Markdown
Member Author

Thanks for the advice! I have changed the name of function in python-side to register_op_intrin_lowering and removed change to C API. Instead, I utilized the global function registration and packedfunc to register op intrinsic lowering function.

@zxybazh zxybazh changed the title [WIP][Target][Lowering] Update Op Intrinsic Lowering Mechanism And Intrinsic Lowering Pass [Target][Lowering] Update Op Intrinsic Lowering Mechanism And Intrinsic Lowering Pass Apr 13, 2021
@zxybazh

zxybazh commented Apr 15, 2021

Copy link
Copy Markdown
Member Author

@junrushao1994 Please review, thanks!

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution!

Comment thread include/tvm/tir/op_attr_types.h
Comment thread include/tvm/tir/op_attr_types.h Outdated
Comment thread include/tvm/tir/op_attr_types.h Outdated

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please find some further comments :-)

Comment thread python/tvm/ir/op.py Outdated
Comment thread src/ir/op.cc Outdated
Comment thread src/ir/op.cc
Comment thread python/tvm/ir/op.py Outdated
Comment thread src/target/intrin_rule.cc
@tqchen

tqchen commented Apr 20, 2021

Copy link
Copy Markdown
Member

note, please do not checkin vta-hw submodule change(do a git submodule update)

@zxybazh
zxybazh force-pushed the lower branch 5 times, most recently from 5521ac6 to a04f2c2 Compare April 20, 2021 17:19

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't have other comments :-) Thanks for the contribution!

@junrushao

Copy link
Copy Markdown
Member

CC: @comaniac @yzhliu @icemelon9

@junrushao

Copy link
Copy Markdown
Member

@tqchen would you like to take a second look? If there is other comments, I will get it merged the other day

@tqchen tqchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

two minor nits mainly on the api and use TypedPackedFunc over PackedFunc. Overall LGTM!

Comment thread include/tvm/ir/op.h Outdated
Comment thread src/target/llvm/intrin_rule_hexagon.cc Outdated
Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
@junrushao
junrushao requested a review from tqchen April 23, 2021 03:54

@tqchen tqchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for keep improving the PR! Taking a close look this time. I think we can merge once the current set of comments are addressed

Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
Comment thread src/target/llvm/intrin_rule_llvm.cc Outdated
Comment thread src/tir/transforms/lower_intrin.cc Outdated

@tqchen tqchen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LTGM! Thanks @zxybazh !

@junrushao
junrushao merged commit 251f571 into apache:main Apr 24, 2021
@junrushao

Copy link
Copy Markdown
Member

Thanks @zxybazh @tqchen!

@zxybazh
zxybazh deleted the lower branch April 24, 2021 18:13
echuraev pushed a commit to echuraev/tvm that referenced this pull request Apr 29, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
umangyadav pushed a commit to umangyadav/tvm that referenced this pull request May 5, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
…ic Lowering Pass (apache#7809)

This PR updated the intrinsic lowering pass to support the new op registry and avoid overloading the global tvm registry. Meanwhile, it kept the fallback mechanism to find the most suitable lower intrinsic function, e.g., llvm.FLowerIntrinsic vs. default.FLowerIntrinsic. All previous op registration are ported to new functions, and some missing ops would be added in separate PR.
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.

3 participants