Skip to content

Differentiate NoSpecialize functions with chunk size 1 - #4676

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:nospecialize-chunk-size
Sep 28, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:nospecialize-chunk-size

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

NoSpecialize problems are differentiated with ForwardDiff chunk size 1 when no chunk size is given, as AutoSpecialize problems already are, so the Jacobian's dual type, and with it the integrator type, no longer changes with the problem.
_prepare_ADType_fwd in alg_utils.jl fixed the chunk only for functions wrapped by AutoSpecialize/AutoDespecialize, so a NoSpecialize function took pickchunksize of the state length or color count, and FBDF's cache type differed between 8 and 12 states. On a banded Rodas5P problem the first solve at a new color count took 1.6 s under NoSpecialize and 0.0 s with this change or under AutoSpecialize.
The cost is Jacobian passes: that 15-color problem now takes 15 passes of one lane per Jacobian instead of 2 of 8, the trade-off Chris accepted in #diffeq-bridged when he suggested this, and AutoForwardDiff(chunksize = 8) still gives 2 passes of 8. NoSpecialize DAEs (DFBDF) and DDEs (MethodOfSteps) take the same path and solve to the same values as FullSpecialize.
The new testset fails on master and Differentiation's qa.jl passes. The Core lane stops at scalar_operator_massmatrix_tests.jl, which fails on master too and is fixed by #4582; with that file skipped the rest of the group passes.
AI Disclosure: Claude assisted with this change.

@ChrisRackauckas
ChrisRackauckas merged commit a329b3b into SciML:master Sep 28, 2026
183 of 192 checks passed
@singhharsh1708
singhharsh1708 deleted the nospecialize-chunk-size branch September 28, 2026 15:38
ChrisRackauckas referenced this pull request Sep 29, 2026
* Bump DiffEqBase to 7.21.3

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqBDF to 2.4.12

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSDIRK to 2.9.7

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqRosenbrock to 2.7.5

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqLowOrderRK to 2.2.6

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqTsit5 to 2.1.5

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqVerner to 2.4.2

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSymplecticRK to 2.2.3

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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