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

[Relay]Disable InferType if it was done and no changes after previous pass #17585

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

elvin-n
Copy link
Contributor

@elvin-n elvin-n commented Jan 8, 2025

This optimization allows to speedup PatternRewriter transformations by reusing of previous type inferred expression instead of perform InferType multiple times

The test_pass_simplify_expr.py tests on my machine started to pass for 40 seconds vs 116 seconds main branch state

@elvin-n elvin-n changed the title Disable InferType if it was done and no changes after previous pass [Relay]Disable InferType if it was done and no changes after previous pass Jan 8, 2025
Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@elvin-n elvin-n force-pushed the amalyshe/dataflow_matcher_opt branch from e522684 to bd02406 Compare January 13, 2025 08:03
@echuraev
Copy link
Contributor

@tvm-bot rerun

2 similar comments
@yongwww
Copy link
Member

yongwww commented Jan 15, 2025

@tvm-bot rerun

@tqchen
Copy link
Member

tqchen commented Jan 19, 2025

@tvm-bot rerun

@tqchen
Copy link
Member

tqchen commented Jan 19, 2025

a minor note, we are moving towards phasing out relay and use relax

@echuraev
Copy link
Contributor

@tvm-bot rerun

@elvin-n
Copy link
Contributor Author

elvin-n commented Jan 23, 2025

a minor note, we are moving towards phasing out relay and use relax

It is true, and we must switch to relax and we are moving toward it. At the same time legacy relay flow sometimes has deeper and wider support. Do we know if relax flow covered all frontend capabilities which were covered by relay? Do we know which backed switched and have same support from performance point of view?

This optimizatin allows to speedup PatternRewriter transformations by
reusing of preious type inferred expression instead of perform
InferType multiple times
@elvin-n elvin-n force-pushed the amalyshe/dataflow_matcher_opt branch from bd02406 to 01ccffc Compare January 27, 2025 06:38
@echuraev echuraev merged commit 050b23f into apache:main Jan 27, 2025
18 checks passed
@tqchen
Copy link
Member

tqchen commented Jan 27, 2025

As of now relax flow covers most of the onnx flows and rightfully the development focuses on the latest use-cases. So there might be delta on some legacy use-cases. However, as we move toward relax, hopefully these deltas can be closed and improved

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