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

[rewriter] Create a "why_not_applied" API #1812

Open
justinchuby opened this issue Aug 15, 2024 · 1 comment
Open

[rewriter] Create a "why_not_applied" API #1812

justinchuby opened this issue Aug 15, 2024 · 1 comment
Labels
contribution welcome We welcome code contributions for this enhancement New feature or request topic: rewriter

Comments

@justinchuby
Copy link
Collaborator

justinchuby commented Aug 15, 2024

Call why_not_applied(rule, graph, node: Optional[Node]) and it will print out the reasons why a pattern was not applied.

cc @gramalingam

@justinchuby justinchuby added enhancement New feature or request topic: rewriter contribution welcome We welcome code contributions for this labels Aug 15, 2024
@gramalingam
Copy link
Collaborator

Just adding some thoughts here:

  • The reasons should be from the pattern-matching algorithm ... I don't think we want to have a duplicate algorithm for debugging.
  • So, the first step would be to make sure that the pattern-matching algorithm logs the reason in some fashion (how it is presented to the user can be done separately, if desired).
  • There are places where the algorithm doesn't record any information for efficiency/pragmatism reasons ... eg., for the first node, if the optype doesn't even match (this is a case where user is unlikely to care even for debugging, and efficiency reasons might override).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome We welcome code contributions for this enhancement New feature or request topic: rewriter
Projects
None yet
Development

No branches or pull requests

2 participants