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

[Relax] Validate StructInfo annotations in well-formed check #17331

Merged

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the Relax well-formed checker verified that each expression had a non-null StructInfo annotation, but did not perform any validation on the contents of the StructInfo annotation.

This commit updates the Relax well-formed check to verify that the StructInfo annotations are accurate by comparing against the StructInfo that would be inferred for an expression. (This only requires that the information is accurate, not that it is complete. For example, an expression that is inferred to be R.Tensor(shape=[128,8], dtype="float32") may have annotation of R.Tensor(ndim=2, dtype="float32", but may not have an annotation of R.Tensor(shape=[128,8], dtype="int32").)

@Lunderberg Lunderberg force-pushed the relax_well_formed_validate_sinfo_of_expr branch from 23e6cf2 to c3fdc0a Compare September 10, 2024 15:06
Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

lgtm

@Lunderberg Lunderberg force-pushed the relax_well_formed_validate_sinfo_of_expr branch from b8fa328 to a0b8e94 Compare September 11, 2024 16:32
Prior to this commit, the Relax well-formed checker verified that each
expression had a non-null `StructInfo` annotation, but did not perform
any validation on the contents of the `StructInfo` annotation.

This commit updates the Relax well-formed check to verify that the
`StructInfo` annotations are accurate by comparing against the
`StructInfo` that would be inferred for an expression.  (This only
requires that the information is accurate, not that it is complete.
For example, an expression that is inferred to be
`R.Tensor(shape=[128,8], dtype="float32")` may have annotation of
`R.Tensor(ndim=2, dtype="float32"`, but may not have an annotation of
`R.Tensor(shape=[128,8], dtype="int32")`.)
@Lunderberg Lunderberg force-pushed the relax_well_formed_validate_sinfo_of_expr branch from 84e2036 to 842b092 Compare September 16, 2024 13:16
@yongwww yongwww merged commit 36e3c12 into apache:main Sep 19, 2024
17 of 18 checks passed
@Lunderberg Lunderberg deleted the relax_well_formed_validate_sinfo_of_expr branch September 19, 2024 19:23
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