-
Notifications
You must be signed in to change notification settings - Fork 79
Add more types to transform.iname #978
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
base: main
Are you sure you want to change the base?
Conversation
4c5c4e1 to
7ee0c81
Compare
loopy/transform/iname.py
Outdated
| # FIXME: parse_match never returns None, so this code is not executed? | ||
| if within is None: | ||
| new_domain = new_domain.project_out(iname_dt, iname_idx, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't even remember what the intent of this was. Delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return find_unused_axis_tag(kernel, "g") | ||
| return [find_unused_axis_tag(kernel, "g")] | ||
| elif tag == "unused.l": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like this was ever hit? It returned a single element instead of a list, from what I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested, undocumented, not functioning? Delete!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be documented at https://documen.tician.de/loopy/ref_kernel.html#iname-implementation-tags, but not used or tested anywhere that I could find. Still remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, from a bit of git blame, they were just forgotten in a recent-ish change: cafc5ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's keep for now then.
loopy/transform/iname.py
Outdated
| knl_inames[sub_iname] = knl_inames[sub_iname].tagged(new_tag) | ||
|
|
||
| return kernel.copy(inames=knl_inames) | ||
| return kernel.copy(inames=constantdict(knl_inames)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the kernel supposed to be more immutable? I added these in a few places, but not sure if it's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, just briefly looked at some failures, and it doesn't seem like it is 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, one fun failure with these things: passed in tuple(domains) in a few places which made it fail some tests because [1, 2, 3] != (1, 2, 3) :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Morally, LoopKernel is supposed to be immutable. But the data structure still isn't, in places. Any step towards that is welcome though, as long as it doesn't break backwards compatbility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might brake compatibility though. Might be better to start with more warnings in __post_init__ or something?
For this, constantdict.copy returns another constantdict, so any places that tries to do that and modify will break. Fortunately constantdict({"a": 1}) == {"a": 1} (for better or worse), so this didn't see too many failures on the CI at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't saying we should do this now. :)
bfe11ea to
a53e22b
Compare
a53e22b to
82f35c2
Compare
inducer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
loopy/transform/iname.py
Outdated
| # FIXME: parse_match never returns None, so this code is not executed? | ||
| if within is None: | ||
| new_domain = new_domain.project_out(iname_dt, iname_idx, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't even remember what the intent of this was. Delete.
loopy/transform/iname.py
Outdated
| | Sequence[tuple[str, _Tags_ish]] | ||
| | str), | ||
| *, | ||
| # FIXME: 'force' is unused? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kill it and see what breaks? Or at least deprecate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a deprecation warning. Seems to have been unused for a long time now: 8734898#diff-a91a39471a27d37ceb2117f72be493a2ab46af1987edc52ff7a432e2c296f2cc.
| return find_unused_axis_tag(kernel, "g") | ||
| return [find_unused_axis_tag(kernel, "g")] | ||
| elif tag == "unused.l": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested, undocumented, not functioning? Delete!
loopy/transform/iname.py
Outdated
| knl_inames[sub_iname] = knl_inames[sub_iname].tagged(new_tag) | ||
|
|
||
| return kernel.copy(inames=knl_inames) | ||
| return kernel.copy(inames=constantdict(knl_inames)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Morally, LoopKernel is supposed to be immutable. But the data structure still isn't, in places. Any step towards that is welcome though, as long as it doesn't break backwards compatbility.
3999c37 to
3d6bc8a
Compare
3d6bc8a to
8228fdb
Compare
|
@inducer Any idea why the grudge CI is unhappy? It seems to pass just fine locally and I can't see any particular changes that should have suddenly broken it.. |
|
News regarding the grudge failures: inducer/grudge#396 |
8228fdb to
ae1f9de
Compare
This also does some cleanup: updates docs a bit, ports to more f-strings, etc.