Skip to content

Support forward Jacobians inside Reactant kernels - #3484

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
EnzymeAD:mainfrom
ChrisRackauckas-Claude:fix/reactant-jacobian
Closed

ChrisRackauckas-Claude wants to merge 1 commit into
EnzymeAD:mainfrom
ChrisRackauckas-Claude:fix/reactant-jacobian

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Closed by @wsmoses in favor of implementing the traced-array dispatches in Reactant: EnzymeAD/Reactant.jl#1882.

If this PR is revisited, please ignore it until it has been reviewed by @ChrisRackauckas.

Closed head

At the retained PR head d4c34bc9, forward-mode Enzyme.jacobian assembled array-valued derivatives with a tupstack method restricted to ordinary Arrays. The PR added an AbstractArray fallback using stack and reshape, while preserving the optimized Array specialization.

The exact new test failed against upstream a865b354 and passed on Julia 1.10.12, 1.11.9, and 1.12.6. The focused sugar suite passed 226 non-broken assertions, and the ordinary-array benchmark retained 8,984-byte allocation counts.

Follow-up investigation

The Enzyme-only follow-up at ChrisRackauckas-Claude@b270a2d is on the fork branch but is not part of this closed PR. It additionally makes chunked forward Jacobians traceable without changing ordinary-array performance. With unmodified DifferentiationInterface main, its out-of-place AutoEnzyme Jacobian passes inside Reactant; DI's generic in-place Jacobian still constructs basis arrays with scalar indexing, so the current NonlinearSolve work retains its direct-pushforward wrapper for that case.

No replacement Enzyme PR was opened because the maintainer explicitly selected the Reactant-side solution.

Links

🤖 Generated with Claude Code

https://chatgpt.com/codex/tasks/01a03a07-4f58-7d73-90d2-5e7aa3ba9fd7

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://chatgpt.com/codex/tasks/01a03a07-4f58-7d73-90d2-5e7aa3ba9fd7
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

CI audit (2026-08-27): GitHub created the CI, Integration, Documentation, Downgrade, and benchmark workflows, but each is currently action_required pending maintainer approval for this fork. No workflow test has failed. The Format workflow is skipped by its repository configuration.

Local evidence is in the PR body: the exact test fails against upstream a865b354, passes on Julia 1.10.12, 1.11.9, and 1.12.6 with this branch, and the focused sugar suite passes 226/226 non-broken assertions. Ordinary-array performance and allocation counts are unchanged within measurement noise.

@wsmoses

wsmoses commented Aug 27, 2026

Copy link
Copy Markdown
Member

resolution is in reactant, e.g. EnzymeAD/Reactant.jl#1882

@wsmoses wsmoses closed this Aug 27, 2026
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