-
Notifications
You must be signed in to change notification settings - Fork 41
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
[TKW] Add missing validation and error messages #432
base: main
Are you sure you want to change the base?
Conversation
This is a bad PR in the sense that it does a bunch of different things. This is a collection of changes I made, mostly around improving debugging with more verbose and specific error messages. But there's also some other stuff in here. Most of these don't really seem sufficiently important to break out into their own PR, but it seemed a shame to just throw away things that seemed like improvements. I did try to clean things up a bit to make them actually upstreamable. 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.
Sorry, should've run tests after doing cleanup, obviously.... |
I know it can get quite long, but would be lovely if we have the list of fixes on the PR message |
There's still something suspicious going on with the index for reduction ops, but my change causes breakage, so reverting it.
This requires changing too many tests to be part of this PR. Will try to submit separately.
I'm not sure that this is correct. I hit some weird thing here, but this may not be the fix.
I removed some of the more substantive changes, fixed the test failures, and wrote down more detail about the changes. |
I added these while debugging the test failures from this PR
Ping on this? |
Can you break this into individual commits and we can start landing those |
Sure, it was mostly one PR so that I could send it all before I went on vacation. I'll look into breaking it up a bit |
Make the callable passed to `CapturedTrace.walk` optional. If omitted, `walk` just returns all the nodes.
I've extracted a few PRs. I think what will remain here actually has a coherent single purpose of adding missing validation and error messages. |
I think this is now sufficiently narrow to be a reasonable PR. It still has a few extraneous things like adding some missing return types to some functions, but that doesn't seem like something that's worth breaking off into its own PR and it also seems a bit silly to just delete them. |
The big diff in iree/turbine/kernel/wave/codegen/emitter.py is due to windows newlines, which I'm removing in #544 |
Signed-off-by: Ivan Butygin <[email protected]>
This test is failing pretty frequently at head and breaking all presumbits.
Whoops, I accidentally merged #548 into all my PRs. Will revert once the CI runs finish |
This is a collection of small changes adding additional validation or more verbose error messages to TKW.
Includes:
KeyError
into more specific error messages with contextget_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.m
has to be inlhs
andn
inrhs
. 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.get_users
__str__
method for IndexingContext and__repr__
methods toExpansionInfo
andReductionInfo
. Maybe these should be data classes?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.