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

[FxImporter] Add InputInfo to Resolve Literal Hook #3688

Conversation

chrsmcgrr
Copy link
Contributor

Fixes iree-org/iree-turbine#85

iree-turbine uses the FxImporter hooks to materialize buffers as global constants. In this particular use case we have a buffer that is modified which requires the mutable modifier.

However, this information is not available in the current API as the InputInfo structure is not passed to the literal resolution.

The following change passes the information to the literal API of the FxImporterHook.

Copy link
Collaborator

@stellaraccident stellaraccident left a comment

Choose a reason for hiding this comment

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

Thanks. Since this will be an API break, we'll need to do an interlocked update of iree-turbine. I'll land I change there today which accepts this argument as optional so we have an easier compatibility window (so that the people who upgrade iree next aren't in a break the world situation).

@penguin-wwy penguin-wwy merged commit b790061 into llvm:main Sep 5, 2024
3 checks passed
stellaraccident added a commit to iree-org/iree-turbine that referenced this pull request Sep 5, 2024
In the upstream FxImporter, an `info` arg was added to resolve_literal.
Adding it to the hooks here (without use) so that iree-turbine is
forward/backward compatible with respect to this change.

See llvm/torch-mlir#3688

Signed-off-by: Stella Laurenzo <stellaraccident@gmail.com>
stellaraccident pushed a commit to iree-org/iree-turbine that referenced this pull request Sep 24, 2024
Fixes #85

PR based on the work of @maxbartel 

Requires changes in torch-mlir:
[llvm/torch-mlir/#3688](llvm/torch-mlir#3688)

Adds the mutable modifier to a global buffer and lifts said buffer to a
global if there is a store-producer node associated with it.

Signed-off-by: Christopher McGirr <mcgirr@roofline.ai>
Co-authored-by: Maximilian Bartel <bartel@roofline.ai>
IanNod pushed a commit to IanNod/iree-turbine that referenced this pull request Sep 30, 2024
Fixes iree-org#85

PR based on the work of @maxbartel 

Requires changes in torch-mlir:
[llvm/torch-mlir/#3688](llvm/torch-mlir#3688)

Adds the mutable modifier to a global buffer and lifts said buffer to a
global if there is a store-producer node associated with it.

Signed-off-by: Christopher McGirr <mcgirr@roofline.ai>
Co-authored-by: Maximilian Bartel <bartel@roofline.ai>
IanNod pushed a commit to IanNod/iree-turbine that referenced this pull request Sep 30, 2024
Fixes iree-org#85

PR based on the work of @maxbartel

Requires changes in torch-mlir:
[llvm/torch-mlir/#3688](llvm/torch-mlir#3688)

Adds the mutable modifier to a global buffer and lifts said buffer to a
global if there is a store-producer node associated with it.

Signed-off-by: Christopher McGirr <mcgirr@roofline.ai>
Co-authored-by: Maximilian Bartel <bartel@roofline.ai>
Signed-off-by: Ian <ian.nordeng@amd.com>
IanNod pushed a commit to IanNod/iree-turbine that referenced this pull request Sep 30, 2024
Fixes iree-org#85

PR based on the work of @maxbartel

Requires changes in torch-mlir:
[llvm/torch-mlir/#3688](llvm/torch-mlir#3688)

Adds the mutable modifier to a global buffer and lifts said buffer to a
global if there is a store-producer node associated with it.

Signed-off-by: Christopher McGirr <mcgirr@roofline.ai>
Co-authored-by: Maximilian Bartel <bartel@roofline.ai>
Signed-off-by: Ian <ian.nordeng@amd.com>
stellaraccident pushed a commit to iree-org/iree-turbine that referenced this pull request Oct 13, 2024
Fixes #85

PR based on the work of @maxbartel 

Requires changes in torch-mlir:
[llvm/torch-mlir/#3688](llvm/torch-mlir#3688)

Adds the mutable modifier to a global buffer and lifts said buffer to a
global if there is a store-producer node associated with it.

Signed-off-by: Christopher McGirr <mcgirr@roofline.ai>
Co-authored-by: Maximilian Bartel <bartel@roofline.ai>
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.

Fail to compile simple kv_cache
3 participants