You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't validate output/input parameters in RT at all. We should add checks before each op execution which validates input tensor against expected input. We also need to do this when setting the output tensor in RT.
The text was updated successfully, but these errors were encountered:
mtopalovicTT
changed the title
Missing assert for output tensor shape in runtime
Add asserts for each operation in RT and also add check for setting the output
Nov 19, 2024
@mtopalovicTT We didn't do it previously because the compiler-generated tensor descriptors were immature (it's much better now, but still has some issue). Some common issues that come to mind include:
Wrong data type. Compiler assumes that ops can implicitly typecast a tensor data type (which some ops can, but some ops can't), and therefore there will sometimes be data type mismatches on output tensors
Invalid layout. Previously the tile shapes were not correctly updated in the tensors when we force tile/row_major layout. Currently for the decomposed ops we still lack granular layout updates.
Some ops auto-shard, auto-move to host (I think we saw this in conv), and we sometimes have workarounds in runtime to pre-shard. Compiler cannot capture this and therefore all downstream layouts will mismatch.
These runtime checks have performance hits. If we add these we should add them as debug asserts, and probably update CI to also run runtime in debug build.
Overall though I'm definitely on-board of adding such checks to runtime. Currently there's no way to ensure alignment between runtime and compiler-generated descriptors.
We don't validate output/input parameters in RT at all. We should add checks before each op execution which validates input tensor against expected input. We also need to do this when setting the output tensor in RT.
The text was updated successfully, but these errors were encountered: