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

Skip over uninitialized DenseResourceAttrs in verifiers #3041

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

jorickert
Copy link
Collaborator

Elided elements are uninitialized DenseResourceAttrs.
Without these changes MLIR containing elided DenseResourceAttrs can not be parsed, as the verifiers crash when encountering them.

Elided elements are uninitialized DenseResourceAttrs, without these changes MLIR containing them can not be parsed, as the verifiers crash when encountering them.

Signed-off-by: Rickert, Jonas <[email protected]>
Copy link
Collaborator

@AlexandreEichenberger AlexandreEichenberger left a comment

Choose a reason for hiding this comment

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

Changes make sense. Quick clarification: I see the

if (isElementAttrUninitializedDenseResource(entries)) {
       return success(); // Return success to allow the parsing of MLIR with
                         // elided attributes
     }

in a few places. Is it exhaustive? Or is it where you needed it for a particular test.

Trying to understand the scope of this PR. Thanks

@jorickert
Copy link
Collaborator Author

I do not think that is is exhaustive. I observed one crash in a downstream test in the verifier and did a quick search for .getValues<IntegerAttr>() in the verifiers to find other occurrences. IMO it is likely that there are more code paths in the verifier that do not handle elided attributes

Copy link
Collaborator

@AlexandreEichenberger AlexandreEichenberger left a comment

Choose a reason for hiding this comment

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

Thanks for the assessment. Will apply the suggested code on a need-to basis. If you encounter places where this might happen, feel free to update it too.

LGTM

@jorickert
Copy link
Collaborator Author

@AlexandreEichenberger Hello, could you please clarify what you mean with Will apply the suggested code on a need-to basis ? Is it okay to merge this PR or do you plan to cherry-pick parts of it?

@AlexandreEichenberger
Copy link
Collaborator

@jorickert Its all good, just saying that if we encounter similar situations in the future, we can look at this PR and your solution on how to quickly fix it. Please merge.

@jorickert jorickert merged commit 7b0dd65 into onnx:main Jan 14, 2025
7 checks passed
@jorickert jorickert deleted the jrickert.upstream.DenseResourceAttr branch January 14, 2025 18:13
@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #15141 [push] Skip over uninitialized ... started at 13:31

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #16114 [push] Skip over uninitialized ... started at 13:13

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #16113 [push] Skip over uninitialized ... started at 12:14

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #16113 [push] Skip over uninitialized ... passed after 1 hr 24 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #16114 [push] Skip over uninitialized ... passed after 1 hr 25 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #15141 [push] Skip over uninitialized ... passed after 2 hr 23 min

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.

3 participants