Add PrecompileTools workload for improved startup time#185
Merged
ChrisRackauckas merged 1 commit intoDec 30, 2025
Merged
Conversation
Adds PrecompileTools precompilation workloads to significantly reduce time-to-first-execution (TTFX) for common operations. ## Changes - Added PrecompileTools as a dependency - Added src/precompilation.jl with @compile_workload for: - DEQ model construction with Dense layers and SSRootfind solver - Lux.setup() for parameter/state initialization - DeepEquilibriumSolution constructor - Common utility functions (flatten, flatten_vcat, split_and_reshape) - check_unrolled_mode for both regular and fixed-depth modes ## Performance Improvements Before: - Package load: ~13.3s - Model construction + setup: ~2.3s After: - Package load: ~11.0s (17% improvement) - Model construction + setup: ~0.017s (135x improvement!) The forward pass TTFX depends on the specific solver used (NonlinearSolve, OrdinaryDiffEq) which are optional dependencies - users should expect solver-specific compilation on first use. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
"1"src/precompilation.jlwith@compile_workloadfor core operationsPerformance Improvements
What's Precompiled
The workload precompiles the most common user operations:
DeepEquilibriumNetworkconstruction withDenselayers andSSRootfindsolverLux.setup()for parameter/state initializationDeepEquilibriumSolutionconstructorflatten,flatten_vcat,split_and_reshape,check_unrolled_mode,zeros_init)Notes
Test plan
cc @ChrisRackauckas
🤖 Generated with Claude Code