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

Optimize more kinds of copies #306

Open
dsharlet opened this issue May 13, 2024 · 1 comment
Open

Optimize more kinds of copies #306

dsharlet opened this issue May 13, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers work ready This task is ready to be worked on

Comments

@dsharlet
Copy link
Owner

Currently, we understand and optimize a few kinds of copies by expressing the copy as a buffer metadata manipulation like setting the stride. This is supported by this helper:

bool is_copy(var src, expr src_x, int src_d, var dst, var dst_x, int dst_d, expr& at, dim_expr& src_dim) {

To be more specific, the copies we support now are of the form:

  • broadcasts: f(x) = g(C) where C is not a function of x.
  • copies: f(x) = g(x + C)

We could support additional kinds of copies, like:

  • downsamples: f(x) = g(x * C), by multiplying the stride by C. Interestingly, we can't support upsamples, because dividing the stride is not right.
  • "modular broadcasting": f(x) = g(x % C), we can only do this if we know that g doesn't already have a fold factor, so we can set the fold factor to C.
@dsharlet dsharlet added enhancement New feature or request good first issue Good for newcomers work ready This task is ready to be worked on labels May 13, 2024
@Aelphy Aelphy self-assigned this May 15, 2024
dsharlet pushed a commit that referenced this issue May 17, 2024
@Aelphy
Copy link
Collaborator

Aelphy commented May 24, 2024

#343 seems to be stalled until fold factor + loop split issue is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers work ready This task is ready to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants