Commit 4bc2a79
Sync convolve and matmul convention (#13)
* sync SparseDiffEngine and adapt dense matmul bindings
Bump SparseDiffEngine submodule to origin/main (45f88d0), which pulls in
the new convolve atom plus dance858's cleanup of the dense matmul
constructor data-pointer convention.
new_left_matmul_dense / new_right_matmul_dense now require exactly one
of param_node / data to be non-NULL (constants: (NULL, data); parameters:
(capsule, NULL)) — the engine fprintf/exit(1)s otherwise. Update the
dense branches of make_left_matmul and make_right_matmul bindings to
match: drop the PARAM_FIXED wrapper we were building for the constant
case, and forward data=NULL when a real parameter capsule is supplied.
DNLP's helpers.py still hands in A.flatten() in both cases; the binding
absorbs the new convention so no DNLP-side change is needed.
Verified: SparseDiffEngine ctest (267/267), DNLP nlp_tests (217 passed,
77 skipped), DNLP test_convolution + test_atoms (119 passed).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* trim comments on dense matmul bindings
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4d16086 commit 4bc2a79
3 files changed
Lines changed: 25 additions & 50 deletions
Submodule SparseDiffEngine updated 17 files
- CMakeLists.txt+2-2
- include/atoms/affine.h+22-6
- include/subexpr.h+15
- include/utils/dense_matrix.h+2-1
- include/utils/mini_numpy.h+11
- src/atoms/affine/convolve.c+194
- src/atoms/affine/left_matmul.c+23-3
- src/atoms/affine/right_matmul.c+19-11
- src/atoms/other/quad_form.c+3-3
- src/utils/dense_matrix.c+4-1
- src/utils/mini_numpy.c+28
- tests/all_tests.c+14
- tests/forward_pass/affine/test_convolve.h+77
- tests/jacobian_tests/affine/test_convolve.h+68
- tests/problem/test_param_broadcast.h+144
- tests/problem/test_param_prob.h+104-21
- tests/wsum_hess/affine/test_convolve.h+57
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 132 | + | |
141 | 133 | | |
142 | 134 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
146 | 138 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 139 | | |
151 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
152 | 144 | | |
153 | 145 | | |
154 | 146 | | |
155 | | - | |
156 | | - | |
| 147 | + | |
| 148 | + | |
157 | 149 | | |
158 | 150 | | |
159 | | - | |
160 | 151 | | |
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
| 155 | + | |
164 | 156 | | |
165 | 157 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 158 | | |
171 | 159 | | |
172 | | - | |
173 | 160 | | |
174 | 161 | | |
175 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 128 | + | |
136 | 129 | | |
137 | 130 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
141 | 134 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | 135 | | |
146 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
147 | 140 | | |
148 | 141 | | |
149 | 142 | | |
150 | | - | |
151 | | - | |
| 143 | + | |
| 144 | + | |
152 | 145 | | |
153 | 146 | | |
154 | | - | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
158 | 150 | | |
| 151 | + | |
159 | 152 | | |
160 | 153 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 154 | | |
166 | 155 | | |
167 | | - | |
168 | 156 | | |
169 | 157 | | |
170 | 158 | | |
| |||
0 commit comments