Skip to content

Conversation

@DhairyaLGandhi
Copy link
Member

@DhairyaLGandhi DhairyaLGandhi commented Jan 19, 2026

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Adds SymbolicCompilerPasses as a dep to allow passing optimization levels for array functions during symbolic code generation. The passes are an opt-in for now, and can be passed via the optimize kwarg to ODEProblem since JuliaSymbolics/Symbolics.jl#1755.

Add any other context about the problem here.

@DhairyaLGandhi
Copy link
Member Author

The API can now work as:

resolve_optimize_option(0) == resolve_optimize_option(false) == resolve_optimize_option(:none) == nothing # no optimization
resolve_optimize_option(1) == resolve_optimize_option(true) == resolve_optimize_option(:basic) == SCP_BASIC
resolve_optimize_option(2) == resolve_optimize_option(:aggressive) == SCP_AGGRESSIVE

So users can pass

ODEProblem(...;
    optimize = 0/1/2,
              true/false,
              :basic/:aggressive/:none,
              MTK.SCP_BASIC/AGGRESSIVE/ vector of rules)

@DhairyaLGandhi
Copy link
Member Author

Bump

@DhairyaLGandhi
Copy link
Member Author

Bikeshedding: What should the keyword be called? Code gets optimized regardless based on Julia's optimization levels etc, so a more appropriate name might be array_optimizations

@AayushSabharwal AayushSabharwal marked this pull request as ready for review January 28, 2026 14:11
@AayushSabharwal AayushSabharwal merged commit 5faf961 into SciML:master Jan 29, 2026
28 of 68 checks passed
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