Commit 12e6b06
committed
Route callback Mooncake cache through get_cb_paramjac_config
Mirror the ReactantVJP layout: `src/callback_tracking.jl` now calls
`get_cb_paramjac_config(MooncakeLoaded(), autojacvec, raw_affect,
event_idx, y, _p, _t, mode)` with `mode = :state` / `:param`, and the
MooncakeVJP branch collapses to the same shape as the ReactantVJP
branch (just the two config/diffcache constructions, no inline closure
building or SciMLStructures handling in the hot path).
The actual Mooncake pullback-cache assembly — hoisting `raw_affect`,
building the flat `(out, u, p, t)` closure that bakes it in, and sizing
the `dy_mem` / `λ_mem` buffers to state-sized (for :state) or
parameter-sized (for :param) — now lives in a dedicated
`get_cb_paramjac_config(::MooncakeLoaded, ::MooncakeVJP, ...)` method
in `ext/SciMLSensitivityMooncakeExt.jl`, with a matching fallback in
`src/adjoint_common.jl` next to the ReactantVJP fallback.
This also reverts the `out_sample` kwarg added to
`get_paramjac_config(::MooncakeLoaded, ::MooncakeVJP, ...)` in the
previous commits — the wp-sizing concern is now handled inside
`get_cb_paramjac_config` where it belongs, rather than by overloading
the ODE-path entry point with a callback-specific knob.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>1 parent 7a5e90d commit 12e6b06
3 files changed
Lines changed: 94 additions & 95 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
| |||
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
45 | 101 | | |
46 | 102 | | |
47 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
| 558 | + | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
669 | 675 | | |
670 | 676 | | |
671 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
619 | 619 | | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | 620 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
690 | 624 | | |
691 | | - | |
692 | 625 | | |
693 | | - | |
694 | | - | |
| 626 | + | |
| 627 | + | |
695 | 628 | | |
696 | 629 | | |
697 | 630 | | |
698 | 631 | | |
699 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
700 | 637 | | |
701 | | - | |
702 | | - | |
| 638 | + | |
| 639 | + | |
703 | 640 | | |
704 | 641 | | |
705 | 642 | | |
| |||
0 commit comments