Repository navigation
Reduce DAEFunction specialization latency - #5057
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Avoid specializing DAEFunction inference and common model-specific keyword values, matching the existing ODEFunction wrapper strategy. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.151.0 Agent-Model: gpt-5.6-sol Agent-Session: 01a059b1-5fa2-76a2-937a-33502aa35de5
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.
Important
Ignore this PR until it has been reviewed by @ChrisRackauckas.
What changed and why
Apply
Base.@nospecializeinferto the ModelingToolkitDAEFunctionwrapper and avoid specializing its model-specificu0,p,analytic, andinitialization_datakeyword values. This matches the existingODEFunctionwrapper strategy and reduces inference work during standard DAE construction without changing the public API or runtime behavior.Compile-latency evidence
I measured a three-state Robertson DAE with default initialization on Julia 1.12.7, one Julia thread, and a fresh Julia process for every sample. Package loading happened before the
@timed DAEProblem(...)interval. Each constructed residual evaluated to[0.0, 0.0, 0.0].e91f13e48ff0a0b8aab2DAEProblemtimeThe individual total-time samples were
9.436, 9.799, 9.738seconds on the parent and9.272, 9.726, 9.501seconds on this PR.An earlier isolated-depot run on the immediately preceding upstream commit showed a larger effect: median constructor time
11.696 -> 9.833seconds and compilation time11.616 -> 9.774seconds (-15.9% for both). Trace-compile timing in that environment reduced the typedDAEFunctionconstructor from 3.49 s to 1.76 s and its model-specific keyword wrapper from 2.12 s to 1.57 s. The exact-current-base result above is the conservative headline measurement.The benchmark script was temporary and was removed after collecting the samples, as required for local development scripts.
Verification
All three commands exited 0 with no output.
GROUP=QAwas also run. It reported 20 passing checks and 1 failing package-wide JET check. The identical command reproduced the same failure on a detached cleanupstream/masterate91f13e48f: JET returned 450 reports. A parallel investigation bisected the QA-lane boundary to 92c27bb and added current reproduction evidence to #4958 (comment). No test was skipped, disabled, allowlisted, or silenced.CI audit
The full PR matrix reached a terminal state with 97 passed checks, 7 failed checks, 2 canceled checks, and 1 skipped check.
julia-downgrade-compat; the separate workflow fix is green at Restore sublibrary project metadata before downgrade QA .github#131.No behavior-specific test was added because this change consists only of compiler specialization annotations; the existing InterfaceI coverage exercises DAE construction, while the fresh-process benchmark is the discriminating performance check.
Not verified locally
GROUP=Everything, GPU, and downstream groups were not run locally.🤖 Generated with Codex CLI 0.151.0 (model: gpt-5.6-sol; session: 01a059b1-5fa2-76a2-937a-33502aa35de5).