| commit | 72b75fe5b2f34765892b6ae3ba8709bad318b7bd | [log] [tgz] |
|---|---|---|
| author | Eric Lunderberg <Lunderberg@users.noreply.github.com> | Wed Sep 11 08:34:17 2024 -0500 |
| committer | GitHub <noreply@github.com> | Wed Sep 11 08:34:17 2024 -0500 |
| tree | 31de57952cc699b19dcdec83c2f4664c70d987dd | |
| parent | f52143e6c822b04791961bcdfbf965f5eb1674d2 [diff] |
[Relax] Validate StructInfo of variable bindings (#17332)
* [Relax] Validate StructInfo of variable bindings
In Relax, both the variable and the expression in a `VarBinding` may
contain `StructInfo` annotations. Prior to this commit, these
`StructInfo` annotations could be inconsistent, assigning an
expression to a variable of incompatible type.
This commit updates the Relax well-formed checker to verify that the
`StructInfo` of Relax variables accurately describes their contents.
* Fix unit tests
* [Relax][Bugfix] LCA of PrimStructInfo must check known values
The `StructInfoLCA` determines the lowest common ancestor between two
`StructInfo` annotations. This is primarily used in Relax to
determine the appropriate `StructInfo` annotation for a `relax::If`
node, given the `StructInfo` of each branch. Prior to this commit,
when determining the LCA of two `PrimStructInfo` annotations, the
`StructInfoLCA` function only inspected the datatype of
`PrimStructInfo` annotations, and did not check for known values. For
example, the LCA of `R.Prim(value=T.int64(128))` and
`R.Prim(value=T.int64(64))` is `R.Prim("int64")`, but was incorrectly
determined as `R.Prim(value=T.int64(128))` by the `StructInfoLCA`
function.
This commit updates `StructInfoLCA` to inspect the known values of a
`PrimStructInfo`, as well as the datatype.Documentation | Contributors | Community | Release Notes
Apache TVM is a compiler stack for deep learning systems. It is designed to close the gap between the productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends. TVM works with deep learning frameworks to provide end to end compilation to different backends.
TVM is licensed under the Apache-2.0 license.
Check out the TVM Documentation site for installation instructions, tutorials, examples, and more. The Getting Started with TVM tutorial is a great place to start.
TVM adopts apache committer model, we aim to create an open source project that is maintained and owned by the community. Check out the Contributor Guide.
We learned a lot from the following projects when building TVM.