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

[TKW] set_symbol and apply_expr ops #382

Merged
merged 12 commits into from
Jan 15, 2025
Merged

Conversation

Hardcode84
Copy link
Contributor

@Hardcode84 Hardcode84 commented Jan 11, 2025

  • set_symbol op to set specific symbol to some dynamic value (i.e. read from memory) during codegen, this is mostly a hack until we have a proper support for slices/reductions with dynamic sizes/tilesizes.
  • apply_expr op to allow nontrivial index calculations.

@Hardcode84 Hardcode84 requested a review from harsh-nod January 11, 2025 00:23
@harsh-nod
Copy link
Contributor

@harsh-nod codegen still fails as I'm not sure how to construct dispatch op

I think you can leave the dispatch codegen as is for now and just pass in a dummy value since it will not be used in the kernel.

@Hardcode84 Hardcode84 changed the title [TKW] Dyn symbols [TKW] set_symbol and apply_expr ops Jan 15, 2025
@Hardcode84 Hardcode84 marked this pull request as ready for review January 15, 2025 16:37
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
Copy link
Contributor

@harsh-nod harsh-nod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! Thanks!

@dataclass
class SetSymbol(CustomOp):
symbol: IndexExpr
register_: fx.Proxy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering why mark these as type fx.Proxy instead of fx.Node?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half of the ops are using fx.Proxy intead fx.Node, we should probably align all of them.

@Hardcode84 Hardcode84 merged commit 24794f5 into iree-org:main Jan 15, 2025
10 checks passed
@Hardcode84 Hardcode84 deleted the dyn-symbols branch January 15, 2025 21:06
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 this pull request may close these issues.

2 participants