Skip to content

feat: add reversible transformation API#4655

Merged
AayushSabharwal merged 4 commits into
masterfrom
as/reversible-tfs
Jun 25, 2026
Merged

feat: add reversible transformation API#4655
AayushSabharwal merged 4 commits into
masterfrom
as/reversible-tfs

Conversation

@AayushSabharwal

Copy link
Copy Markdown
Member

This allows a generic API for reversible model transformations, since we frequently need to perform such operations and reverse them. Recently, we need to selectively reverse some transformations, and hence this design.

@AayushSabharwal AayushSabharwal force-pushed the as/reversible-tfs branch 2 times, most recently from 9d65bae to 9aa687f Compare June 22, 2026 14:48
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia vlts)

Time benchmarks
master b489560... master / b489560...
ODEProblem 10.2 ± 0.51 ms 11 ± 0.82 ms 0.924 ± 0.083
init 0.083 ± 0.024 ms 0.0745 ± 0.025 ms 1.11 ± 0.49
large_parameter_init/ODEProblem 0.0329 ± 0.0047 s 0.035 ± 0.0049 s 0.939 ± 0.19
large_parameter_init/init 0.101 ± 0.03 ms 0.0973 ± 0.03 ms 1.03 ± 0.44
mtkcompile 11.3 ± 0.76 ms 11.6 ± 1.2 ms 0.971 ± 0.12
sparse_analytical_jacobian/ODEProblem 31.4 ± 2.6 ms 0.0337 ± 0.0023 s 0.932 ± 0.1
sparse_analytical_jacobian/f_iip 0.07 ± 0 μs 0.08 ± 0.01 μs 0.875 ± 0.11
sparse_analytical_jacobian/f_oop 0.385 ± 0.012 ms 0.398 ± 0.017 ms 0.967 ± 0.051
time_to_load 6 ± 0.11 s 5.87 ± 0.1 s 1.02 ± 0.026
Memory benchmarks
master b489560... master / b489560...
ODEProblem 0.0446 M allocs: 2.95 MB 0.0446 M allocs: 2.95 MB 1
init 0.418 k allocs: 0.0701 MB 0.418 k allocs: 0.0701 MB 1
large_parameter_init/ODEProblem 0.339 M allocs: 12.1 MB 0.339 M allocs: 12.1 MB 1
large_parameter_init/init 0.606 k allocs: 0.173 MB 0.606 k allocs: 0.173 MB 1
mtkcompile 0.0599 M allocs: 3.44 MB 0.0598 M allocs: 3.44 MB 1
sparse_analytical_jacobian/ODEProblem 0.208 M allocs: 8.55 MB 0.208 M allocs: 8.55 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.634 k allocs: 19.6 kB 0.634 k allocs: 19.6 kB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master b489560... master / b489560...
ODEProblem 11.1 ± 0.26 ms 10.4 ± 0.26 ms 1.07 ± 0.037
init 0.0494 ± 0.016 ms 0.0557 ± 0.015 ms 0.887 ± 0.36
large_parameter_init/ODEProblem 0.0331 ± 0.0053 s 0.0317 ± 0.0051 s 1.04 ± 0.24
large_parameter_init/init 0.0781 ± 0.035 ms 0.0807 ± 0.04 ms 0.968 ± 0.65
mtkcompile 9.73 ± 0.2 ms 8.79 ± 0.16 ms 1.11 ± 0.03
sparse_analytical_jacobian/ODEProblem 26.5 ± 3.2 ms 26 ± 3 ms 1.02 ± 0.17
sparse_analytical_jacobian/f_iip 0.091 ± 0.01 μs 0.081 ± 0.01 μs 1.12 ± 0.19
sparse_analytical_jacobian/f_oop 0.118 ± 0.012 ms 0.118 ± 0.012 ms 0.995 ± 0.15
time_to_load 5.58 ± 0.028 s 5.62 ± 0.028 s 0.993 ± 0.007
Memory benchmarks
master b489560... master / b489560...
ODEProblem 0.0501 M allocs: 2.96 MB 0.0501 M allocs: 2.96 MB 1
init 0.366 k allocs: 0.0457 MB 0.366 k allocs: 0.0457 MB 1
large_parameter_init/ODEProblem 0.36 M allocs: 13.5 MB 0.354 M allocs: 13.3 MB 1.02
large_parameter_init/init 0.8 k allocs: 0.152 MB 0.8 k allocs: 0.152 MB 1
mtkcompile 0.056 M allocs: 2.75 MB 0.056 M allocs: 2.75 MB 1
sparse_analytical_jacobian/ODEProblem 0.2 M allocs: 7.62 MB 0.2 M allocs: 7.62 MB 1
sparse_analytical_jacobian/f_iip 0 allocs: 0 B 0 allocs: 0 B
sparse_analytical_jacobian/f_oop 0.848 k allocs: 27 kB 0.848 k allocs: 27 kB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@AayushSabharwal

Copy link
Copy Markdown
Member Author

The enzyme failure in SciMLSensitivity/Core8 does not reproduce locally, despite reproducing across two CI runs. It will be investigated locally and marked as broken in the meantime.

@AayushSabharwal AayushSabharwal merged commit 6fe09b7 into master Jun 25, 2026
89 of 110 checks passed
@AayushSabharwal AayushSabharwal deleted the as/reversible-tfs branch June 25, 2026 05:42
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.

1 participant