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

[PatternLang][Bugfix] Ensure CallNode attrs are not undefined before checking #7278

Merged
merged 2 commits into from
Jan 14, 2021

Conversation

slyubomirsky
Copy link
Contributor

@slyubomirsky slyubomirsky commented Jan 14, 2021

Currently, using a dataflow pattern to attempt to match attributes on a call node (for calls to ordinary Relay functions, not operators) results in a segmentation fault due to attempting to access an AttrsNode that is not present. This PR checks if the attributes node exists first to prevent the segfault and adds unit tests for this case.

Please review @jroesch @mbrookhart

Copy link
Contributor

@mbrookhart mbrookhart 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 for catching this. I assume you hit this calling a Function?

@slyubomirsky
Copy link
Contributor Author

I'm experimenting with some BYOC patterns that rely on matching custom annotations on call nodes -- I got a segfault when I passed it an ordinary function call

@mbrookhart
Copy link
Contributor

Yep, this needed a null check. Sorry for the segfault, thank you for fixing it!

@mbrookhart mbrookhart merged commit 1677bb2 into apache:main Jan 14, 2021
@mbrookhart
Copy link
Contributor

Thanks @slyubomirsky!

masahi pushed a commit to masahi/tvm that referenced this pull request Jan 18, 2021
…checking (apache#7278)

* Correct handling of call node attrs to handle non-operator calls (attrs may be undefined)

* Linting fix
TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
…checking (apache#7278)

* Correct handling of call node attrs to handle non-operator calls (attrs may be undefined)

* Linting fix
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
…checking (apache#7278)

* Correct handling of call node attrs to handle non-operator calls (attrs may be undefined)

* Linting fix
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
…checking (apache#7278)

* Correct handling of call node attrs to handle non-operator calls (attrs may be undefined)

* Linting fix
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.

2 participants