Skip to content

Allow transformed calls through the parameter barrier - #4290

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/autodespecialize-concrete-barrier
Closed

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/autodespecialize-concrete-barrier

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed

Allow ParameterDespecializationWrapper to invoke its noinline call barrier when an AD transform has already unwrapped the parameter argument. The wrapper still unwraps one DespecializedParameters argument itself and still rejects calls containing more than one wrapper.

This is required by the Enzyme/Mooncake paths reached by ModelingToolkit's AutoDespecialize support in SciML/ModelingToolkit.jl#4919.

Ignore this PR until reviewed by @ChrisRackauckas.

Failing before / passing after

The focused call used an already-unwrapped parameter vector with ParameterDespecializationWrapper.

Before:

ERROR: a parameter-despecialization barrier requires exactly one parameter wrapper

After, using the identical call:

unwrapped_barrier_call=pass

The owner regression also covers the normal wrapped call. Its four testsets pass with 17 + 3 + 3 + 23 = 46 assertions.

Verification

GROUP=Core julia +1.12 --startup-file=no --project=lib/DiffEqBase -e 'using Pkg; Pkg.test()'
Despecialized-p Hook | 46 / 46
Testing DiffEqBase tests passed

GROUP=QA julia +1.12 --startup-file=no --project=lib/DiffEqBase -e 'using Pkg; Pkg.test()'
Aqua | 9 / 9
Testing DiffEqBase tests passed

The exact SciMLSensitivity Core8 downstream environment from SciML/ModelingToolkit.jl#4919 was also run with this patch and the matching SciMLSensitivity owner patch:

before: Core 8 | 35 pass | 5 error | 5 broken
after:  Core 8 | 45 pass | 5 broken | 50 total | 108m24.9s
Testing SciMLSensitivity tests passed

Runic 1.8, added-line typos, and git diff --check pass.

Not verified

GPU and allowed-to-fail prerelease jobs were not run locally. No public API or documentation changed, so no docs build was required.

Copy link
Copy Markdown
Member Author

A fresh SciMLBase integration run on current dependency heads reproduces the same SciMLSensitivity Core8 regression:

  • Core 8 | 35 pass | 5 error | 5 broken
  • repeated a parameter-despecialization barrier requires exactly one parameter wrapper
  • adjoint parameter conversions involving DespecializedParameters

This is independent current-CI evidence for the paired owner fixes here and in SciML/SciMLSensitivity.jl#1601.

CI job: https://github.com/SciML/SciMLBase.jl/actions/runs/32365988822/job/96415492868

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