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

Test for compile of compile (and compile of existing compiled thunk) #726

Open
wsmoses opened this issue Feb 11, 2025 · 2 comments
Open

Comments

@wsmoses
Copy link
Member

wsmoses commented Feb 11, 2025

Down the line I imagine making sure this works properly to be critical.

For example suppose one uses Reactant inside of scimlsensitivity to compile the function. For a generic code this is fine. However, suppose someone has a lux NN inside of their function, using Reactant (cc @avik-pal). Now they may have a compile of a compile as a result.

@mofeing
Copy link
Collaborator

mofeing commented Feb 11, 2025

This is a common problem our users encounter. Note that we already cache the Expr of a Thunk, but we don't yet cache the MLIR after the tracing, which we probably need to make this work.

@wsmoses
Copy link
Member Author

wsmoses commented Feb 11, 2025

yeah Enzyme itself does a similar trick where it saves the IR in a map of "generated fn pointer -> corresponding IR", and then it replaces a call to the fn pointer with injecting that IR.

We'd presumably need something somewhat similar but for thunks and mlir

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

No branches or pull requests

2 participants