Skip to content
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

Allow more flexibility in cost of functions #294

Open
ricardoV94 opened this issue Nov 21, 2023 · 2 comments · May be fixed by #355
Open

Allow more flexibility in cost of functions #294

ricardoV94 opened this issue Nov 21, 2023 · 2 comments · May be fixed by #355

Comments

@ricardoV94
Copy link

AFAICT costs must be constant, which limits the ability to reason about optimization.

One thing that would be interesting would be to parametrize cost based on the function inputs. For example the cost of an array elementwise addition operation could depend on the shapes of the inputs (with a default if these are not known). This could allow preferring programs were reductions are done before elementwise operations.

Interval reasoning on costs would also be nice. Even if we don't know the shape of an input, it should always be smaller after a reduction than before, and hence the cost of operating elemwise on it smaller afterwards (ignoring detail like memory layout)

@ricardoV94
Copy link
Author

Possibly related to #256

@saulshanabrook
Copy link
Member

saulshanabrook commented Oct 25, 2024

There is an in progress PR which attempts to address this #355 Any feedback on it would be appreciated (if it would help your use case or not).

@saulshanabrook saulshanabrook linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants