Repository navigation
Re-enable the PrecompileTools workload to cut cold discretize latency - #727
Open
xtalax-droid wants to merge 1 commit into
Open
xtalax-droid wants to merge 1 commit into
xtalax-droid wants to merge 1 commit into
Conversation
The workload was disabled behind if false during the compat update, so every first discretize/mtkcompile/ODEProblem paid ~40-60 s of inference. It now covers 1D Dirichlet/Neumann, periodic upwind and WENO, and a 2D periodic system, each through discretize, symbolic_discretize, mtkcompile and ODEProblem. Periodic systems pass should_transform=false so precompilation does not warn about interface boundaries. Agent-Harness: Claude Code 2.1.309 Agent-Model: claude-sonnet-5-5 Agent-Session: 47ff55ef-8952-4078-8e4e-77c72c85d6c4 Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
This branch has not been deployed
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.
Problem
The PrecompileTools workload in
src/precompile.jlhas been disabled (if false) since the compat update, so every fresh Julia process paid roughly 40-60 s of compilation on the firstdiscretizecall, plus 8-13 s formtkcompileand 5-27 s forODEProblem. Warm calls take milliseconds, so this is almost entirely inference and codegen. A SnoopCompile profile showed the time spread over hundreds of Base, SymbolicUtils and ModelingToolkit specializations rather than any single MOL hot spot, so re-enabling the workload was preferred over targeted edits.Fix
The workload is rewritten and re-enabled. It runs
discretize,symbolic_discretize,mtkcompileandODEProblemon:UpwindSchemeandWENOScheme.Periodic systems use
should_transform = falseso precompilation stays quiet (periodic boundaries are interfaces, so the transformation is skipped for them regardless). No new dependencies; PrecompileTools was already in[deps]and[compat].Results
Cold = first call in a fresh process. Median of 3 fresh processes, Julia 1.12.1, 32-core box with some load from other jobs.
Cost: package precompile goes from about 9 s to about 87 s wall, and the MethodOfLines cache from 4.5 MB to 139 MB. If that is too much, the 2D case is the first thing to drop (about 4 s of brusselator discretize).
What remains is compile time of the generated RHS (
ODEProblemand first solve). That lives in ModelingToolkit, RuntimeGeneratedFunctions and OrdinaryDiffEq and is not addressed here.Tests
GROUP=ComponentsandGROUP=QA(21/21) pass on the final commit; Runic is clean.Review notes
using MethodOfLines, not just a test.🤖 Posted by an AI agent · harness: Claude Code 2.1.309 · model: claude-sonnet-5-5
Review: unreviewed
Session: 47ff55ef-8952-4078-8e4e-77c72c85d6c4