-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Optional constraints for Input<Func> and Output<Func> #3361
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
This is a sketch of a possible way to address Issue #3306: `Input<Func>` and `Output<Func>` have a new method, `dimensions_and_alignment()`, which returns a struct that lets you get/set the min/extent/stride/host-alignment; these values are entirely ignored if the given Input/Output isn't AOT-compiled as a Buffer. This works fine and I feel it's robust, but I'm not sure if this API is one I'm happy to support forever. That said, it would make it a lot easier to make composable Generators per the details in the issue.
|
Attn @inazarenko |
|
Any comments on this at all? |
|
Can we not just support output.dim(2).set_stride(...) and co. on |
No, because the |
|
Why can't output.dim(1).set_stride mean the same thing as output.dimensions_and_alignment().dim(1).set_stride? I.e. it gets ignored if there's no realization. |
The thing I'm concerned about is that it's easy to use |
|
Maybe a bit pie in the sky, but I'd love to try to reduce/eliminate the inconsistency between internal and output stages in general, which might implicitly make this problem better. For example, it seems like we should be able to use Basically, I think it would be awesome to get rid of set_min/extent_stride completely, and use reorder_storage, align_bounds, and bound on output stages instead. |
|
+1 |
SGTM. (Do we have the ability to fully replicate everything we need already, or do we need to enrich the scheduling language a bit?) That said: will all of these work on |
In particular, Funcs wrapped around buffers in the implementation of |
This is a sketch of a possible way to address Issue #3306:
Input<Func>andOutput<Func>have a new method,dimensions_and_alignment(), which returns a struct that lets you get/set the min/extent/stride/host-alignment; these values are entirely ignored if the given Input/Output isn't AOT-compiled as a Buffer.This works fine and I feel it's robust, but I'm not sure if this API is one I'm happy to support forever. That said, it would make it a lot easier to make composable Generators per the details in the issue.