-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add pass to process input and output alias hint info #1273
Conversation
c1f44bb
to
df62261
Compare
1a7294b
to
d967f6d
Compare
2bb882f
to
ba0e392
Compare
tao_compiler/mlir/disc/BUILD
Outdated
":pass_details", | ||
":placement_utils", | ||
":rng_uniform_custom_call", | ||
":topk_custom_call", |
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.
please polish the dependencies, this target do not need qconv_custom_call
at least.
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.
Fixed.
0ca06f4
to
7560544
Compare
d95d788
to
c534ad5
Compare
c534ad5
to
657f6f7
Compare
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.
LGTM
In this pr, we provide a mechanism to do memory buffer reuse optimization between module inputs and outputs. Frontend of DISC needs to provide information as module attribute in the form of
input_output_alias_params
andinput_output_alias_outputs
. For example, if you want to reuse the 3rd output tensor and 14th input tensor, 4th output tensor and 2nd input tensor of main module function, you need to provide these two attributes like:DISC will parse this information and try to do buffer reuse.
It should be noted that DISC's handling of input_output_alias information adopts a try-best strategy, which means that it does not guarantee the successful execution of all input-output aliases, but this does not affect the correctness of end-to-end execution. And this pr has no side-effect for other passes.