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
[TKW] Add missing validation and error messages (#432)
This is a collection of small changes adding additional validation or
more verbose error messages to TKW.
Includes:
- More verbose (or any) error messages for existing asserts and
exceptions. Maybe this is too much, but the current messages frequently
don't tell you what's going wrong. I think it's better to err on the
side of too much information. If these get annoying for some reason we
can trim them.
- Transforming some builtin `KeyError` into more specific error messages
with context
- Making the validation if `get_custom` is passed an op an error
instead. I think this more likely than not points to a bug, so it's
better for it to be an error. I can't remember the specific case in
which I hit it.
- Adding earlier validation if there's a type mismatch between a reduce
op init and return types.
- Adding earlier validation if there's an issue when decomposing reduce
ops and the local reduction doesn't match the accumulator reduction.
- Reporting the argument that has an issue if there's a failure in
decomposing reduce ops.
- Printing which node had an issue if there's a failure during codegen
- Validating that reduction and generated for loop have the same number
of arguments. This otherwise results in a failure later on, but we can
give more useful information here. I reported
#384 for the bug that
causes this to fire.
- Validating MMA shapes. `m` has to be in `lhs` and `n` in `rhs`.
Locally, I actually have much more restrictive validation that lhs had
to be `[..., m, k]` and rhs `[..., n, k]`. In theory it looks like Wave
is supposed to figure things out if that isn't the setup, but I never
had a case where it actually worked, so it seems like you need walk some
narrow path. This version is the less restrictive one though.
- Reporting more information if IREE invocation fails.
- Removing assumption that a reduction has users in `get_users`
- Removing some unused variables and arguments
- Adding a `__str__` method for IndexingContext and `__repr__` methods
to `ExpansionInfo` and `ReductionInfo`. Maybe these should be data
classes?
- Adding some missing types to some functions
One note is that I'm not really sure what the convention is for
Exception types in the project, so a lot of these are just RuntimeError.
That's not awesome, but I think it's still a lot more helpful than
nothing. I tried to avoid `raise ... from` as in my experience these
usually result in unhelpfully verbose stacks.
Signed-off-by: nithinsubbiah <[email protected]>
0 commit comments