Skip to content

Add verbose support in single-output pattern-matcher #1555

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

Merged
merged 20 commits into from
May 20, 2024
Merged

Conversation

gramalingam
Copy link
Collaborator

@gramalingam gramalingam commented May 17, 2024

Next step in unifying the two pattern-matchers:

  • Refactor the pattern-matching algorithm out of the pattern-IR classes
  • Add support for verbose-flag: will print info about status during algorithm
  • Unify the constructors for rewrite-rule

Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 77.51%. Comparing base (69ae7f4) to head (0308f09).

Files Patch % Lines
onnxscript/rewriter/pattern.py 82.56% 14 Missing and 5 partials ⚠️
onnxscript/rewriter/generic_pattern.py 66.66% 1 Missing ⚠️
onnxscript/rewriter/generic_pattern_test.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
- Coverage   77.56%   77.51%   -0.05%     
==========================================
  Files         214      214              
  Lines       23186    23235      +49     
  Branches     3975     3990      +15     
==========================================
+ Hits        17984    18011      +27     
- Misses       4433     4457      +24     
+ Partials      769      767       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented May 17, 2024

Test Results

     29 files  ±     0       29 suites  ±0   3h 10m 39s ⏱️ + 4m 29s
  9 629 tests  -  2 144    8 140 ✅  - 1 736    1 488 💤  -    407  1 ❌  - 1 
578 952 runs  +18 125  118 161 ✅ +2 680  460 790 💤 +15 446  1 ❌  - 1 

For more details on these failures, see this check.

Results for commit 0308f09. ± Comparison against base commit 69ae7f4.

This pull request removes 2144 tests.
onnxscript._internal.analysis_test.TestAssignedVarAnalysis ‑ test_basic_defs
onnxscript._internal.analysis_test.TestAssignedVarAnalysis ‑ test_doc_string
onnxscript._internal.analysis_test.TestAssignedVarAnalysis ‑ test_if_defs
onnxscript._internal.analysis_test.TestAssignedVarAnalysis ‑ test_if_loop_defs
onnxscript._internal.analysis_test.TestAssignedVarAnalysis ‑ test_loop_defs
onnxscript._internal.analysis_test.TestExposedUses ‑ test_basic
onnxscript._internal.analysis_test.TestExposedUses ‑ test_called_function
onnxscript._internal.analysis_test.TestExposedUses ‑ test_doc_string
onnxscript._internal.analysis_test.TestExposedUses ‑ test_for_loop
onnxscript._internal.analysis_test.TestExposedUses ‑ test_if
…

♻️ This comment has been updated with latest results.

@classmethod
def FAIL(cls):
return cls(False)
def fail(self, reason: str = "") -> MatchResult:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way to include source/pass information too, or is that handle by a higher level entity?

if subgraph replacement happens. But subsequent DCE will remove the constant
node if it is not used elsewhere.
"""
value = _ir_utils.propagate_const_value(value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would add a comment to remove these two lines when we sort this out

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I understand. It serves as documentation, in case a reader starts wondering about this. If we change this design, then we would need to change both the code and documentation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean value = _ir_utils.propagate_const_value(value) is temporary and we should remove _ir_utils usage when ready

@gramalingam gramalingam merged commit a5ed079 into main May 20, 2024
40 of 43 checks passed
@gramalingam gramalingam deleted the rama/unify3 branch May 20, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants