Skip to content

Conversation

@glou-nes
Copy link
Contributor

@glou-nes glou-nes commented Oct 16, 2025

Extract from #1754, use a custom GPUCompiler infra / ORC JIT to replace OpaqueClosure.

  • Redefine ReactantInterpreter without depending on Enzyme interpreter.
  • Incorporate dynamic call rewrite in the type inference and remove fragile custom inference.

I only test this on 1.11, it probably don't run on 1.10. Now, I mostly want to check if that approach can work at scale. I let all debug stuff atm.


struct ReactantToken end

@kwdef struct ReactantInterpreter <: CC.AbstractInterpreter
Copy link
Member

Choose a reason for hiding this comment

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

it still may be useful to have this inherit from the enzyme interp (but we can still specialize the methods below if set to reactant_abi or w/e).

Is it possible/reasonable to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that possible to elaborate? I don't get what can be used from the enzyme interp.

Copy link
Member

Choose a reason for hiding this comment

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

longer term we need to retain the noinline/etc characteristics from the enzyme custom rules, so its preferable to build off the enzyme interp, and perhap specialize it on these methods for the reactant version (e.g. when we have reactant-specific type parameters)

cc @avik-pal

CC = Core.Compiler

#leak each argument to a global variable
macro lk(args...)
Copy link
Member

Choose a reason for hiding this comment

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

can we rename this leak?

also I don't quite follow why this is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I don't have cleanup my debug stuff. I will remove it.

@wsmoses wsmoses requested a review from gbaraldi October 17, 2025 06:42
@wsmoses
Copy link
Member

wsmoses commented Oct 17, 2025

@gbaraldi can you help review?

@avik-pal avik-pal self-requested a review October 21, 2025 16:32
Copy link
Member

@wsmoses wsmoses left a comment

Choose a reason for hiding this comment

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

bumping here just because code will get stale over time if not merged (relatedly the 1.12 fixes we did not conflict here)

@glou-nes
Copy link
Contributor Author

I got three kinds of issues atm. ccall needs the compiler inside some call_with_reactant; type inference changes leading to MethodError and ccall_deferred symbol unknown. It passes half Enzyme Reactant unit tests, and 2/3 of basics.

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.

3 participants