Repository navigation
Add precompilation workloads for OrdinaryDiffEqSDIRK - #3099
Merged
ChrisRackauckas merged 1 commit intoMar 1, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
OrdinaryDiffEqSDIRK had no @compile_workload, causing significant TTFX overhead when using SDIRK methods like TRBDF2 and KenCarp4. This adds PrecompileTools workloads for TRBDF2 and KenCarp4 following the same pattern used by OrdinaryDiffEqBDF and OrdinaryDiffEqRosenbrock, with preference-controlled specialization modes. Ref: SciML/DifferentialEquations.jl#1125 Co-Authored-By: Chris Rackauckas <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PrecompileTools.@compile_workloadtoOrdinaryDiffEqSDIRKforTRBDF2()andKenCarp4(), following the same pattern used by OrdinaryDiffEqBDF and OrdinaryDiffEqRosenbrockPrecompileToolsandPreferencesas dependencies in Project.tomlPreferences.@load_preference(DefaultSpecialize enabled by default, Auto/FunctionWrapper/NoSpecialize opt-in)OrdinaryDiffEqSDIRK was the only major solver package with zero precompilation workloads, causing unnecessary TTFX overhead for widely-used methods like TRBDF2.
Before (no precompilation)
When a second SDIRK solver is called after the first already paid shared infrastructure costs:
After (with precompilation)
Note: the first solver called in a session still pays ~2.5s for shared OrdinaryDiffEqCore/LinearSolve infrastructure compilation.
--trace-compileanalysis confirms this is from broadcast fusion specialization for user-specific function bodies (especially ForwardDiff dual number types), not from solver method recompilation. The solver-specific precompilation added here IS effective.Ref: SciML/DifferentialEquations.jl#1125
Test plan
Pkg.precompile()succeeds (17.5s precompilation time = workload executing)Pkg.test()passes (JET + Aqua tests)🤖 Generated with Claude Code