Skip to content

Update Enzyme to 56b02e7e for OffsetViewInterface - #3373

Merged
wsmoses merged 3 commits into
mainfrom
vim/update-enzyme-offset-view
Oct 6, 2026
Merged

wsmoses merged 3 commits into
mainfrom
vim/update-enzyme-offset-view

Conversation

@vimarsh6739

@vimarsh6739 vimarsh6739 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Update Enzyme from 3cd66b79ce224b8dc35cfac0e37038ed186b2013 to 56b02e7e94265e7af38fe95e9fbf9818ef1d09c0, the merged commit from EnzymeAD/Enzyme#3420. This provides OffsetViewInterface and pointer analysis through view interfaces for #2744 and #3350.

The new Enzyme version exposes isCaptured(). Enzyme-JAX's local copy makes the calls in mayWriteTo() and mayReadFrom() ambiguous. Remove the local isCaptured() and getBase() functions. Use enzyme::oputils::isCaptured() and enzyme::oputils::getBaseObject() in both places. These checks need the underlying allocation, so getBaseObject() uses its default offsetAllowed=true.

The current JAX pin already selects LLVM 018a9e4a74ba5d383351bda907a8b116bc5d8c47, which Enzyme's property assembly migration in EnzymeAD/Enzyme#3411 supports. The JAX update in #3368 selects the same LLVM revision.

Validation: Clang-format 16 and whitespace checks pass for the changed code. Enzyme #3420 passed upstream MLIR debug and release CI. The full Enzyme-JAX build was not run locally; PR CI will compile and test the updated integration.

Update the Enzyme pin to include OffsetViewInterface and shared view-based
pointer analysis from EnzymeAD/Enzyme#3420.

Assisted-By: OpenAI Codex
@wsmoses

wsmoses commented Oct 6, 2026

Copy link
Copy Markdown
Member

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
src/enzyme_ad/jax/Utils.cpp:510:33: error: call to 'isCaptured' is ambiguous
  510 |     if (isStackAlloca(base) && !isCaptured(base, op, &seenuse) && !seenuse) {
      |                                 ^~~~~~~~~~
external/enzyme/Enzyme/MLIR/Interfaces/Utils.h:25:6: note: candidate function
   25 | bool isCaptured(Value v, Operation *potentialUser = nullptr,
      |      ^
src/enzyme_ad/jax/Utils.cpp:353:6: note: candidate function
  353 | bool isCaptured(Value v, Operation *potentialUser = nullptr,
      |      ^
src/enzyme_ad/jax/Utils.cpp:1412:33: error: call to 'isCaptured' is ambiguous
 1412 |     if (isStackAlloca(base) && !isCaptured(base, op, &seenuse) && !seenuse) {
      |                                 ^~~~~~~~~~
external/enzyme/Enzyme/MLIR/Interfaces/Utils.h:25:6: note: candidate function
   25 | bool isCaptured(Value v, Operation *potentialUser = nullptr,
      |      ^
src/enzyme_ad/jax/Utils.cpp:353:6: note: candidate function
  353 | bool isCaptured(Value v, Operation *potentialUser = nullptr,

@vimarsh6739 you need to do the adapt at the same time

Pin Enzyme to 56b02e7e94265e7af38fe95e9fbf9818ef1d09c0 from EnzymeAD/Enzyme#3420.
Remove the duplicate local isCaptured implementation. Call Enzyme's helper
explicitly in memory read and write checks to avoid ambiguous calls.

Assisted-By: OpenAI Codex
@vimarsh6739 vimarsh6739 changed the title Update Enzyme to c67b3afe for OffsetViewInterface Update Enzyme to 56b02e7e for OffsetViewInterface Oct 6, 2026
@vimarsh6739
vimarsh6739 requested a review from wsmoses October 6, 2026 00:19
Comment thread src/enzyme_ad/jax/Utils.cpp Outdated
return false;
}

Value getBase(Value v) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

also replace getBase?

Remove the local getBase function and use enzyme::oputils::getBaseObject
in mayWriteTo and mayReadFrom. Both checks need the underlying allocation.

Assisted-By: OpenAI Codex
@wsmoses
wsmoses merged commit 35f52f0 into main Oct 6, 2026
21 of 30 checks passed
@wsmoses
wsmoses deleted the vim/update-enzyme-offset-view branch October 6, 2026 00:50
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.61%. Comparing base (58fe151) to head (7e814f9).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3373      +/-   ##
==========================================
- Coverage   29.61%   29.61%   -0.01%     
==========================================
  Files         239      240       +1     
  Lines       48403    48460      +57     
==========================================
+ Hits        14336    14351      +15     
- Misses      34067    34109      +42     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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