Skip to content

IR serialization and deserialization #291

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

Open
Roger-luo opened this issue Feb 27, 2025 · 0 comments
Open

IR serialization and deserialization #291

Roger-luo opened this issue Feb 27, 2025 · 0 comments
Assignees
Labels
dialect general dialect framework related issues enhancement New feature or request interpreter interpreter related issues IR node issue related to IR data structure

Comments

@Roger-luo
Copy link
Member

We are still missing IR serialization/deserialization. The main obstable here is because we mainly consider a single kernel function, by default the IR of a kernel function is a func.Function or something similar. As a result this will not store the entire call chain in a module but instead embedded in the IR as a Python object, e.g

func.invoke foo(%a, %b)

foo will be an actual ir.Method object. For serialization and deserialization, and possibly codegen to an actual static compiled language (e.g LLVM) we need to dump the functions in the call chain as well and link them as modules. This means instead of a single function, we should have an mlir-like ModuleOp, however, because our scope is more about kernel function this can be more special - we can define a module dialect where ModuleOp has a callable region which is the region inside the entry function.

This leads to another change is to let dialect group own an interpreter so that interpreter can load module/function definitions at construction time, so that we can load the symbol table correctly.

@Roger-luo Roger-luo added dialect general dialect framework related issues enhancement New feature or request interpreter interpreter related issues IR node issue related to IR data structure labels Feb 27, 2025
@Roger-luo Roger-luo self-assigned this Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect general dialect framework related issues enhancement New feature or request interpreter interpreter related issues IR node issue related to IR data structure
Projects
None yet
Development

No branches or pull requests

1 participant