Draft
Conversation
Add get_param_offsets static method to InverseData and use it in build_parameter_dict to compute parameter offsets. Register parameter nodes (parameter, param_scalar_mult, param_vector_mult, left_param_matmul) with the C problem and support updating parameter values without rebuilding the expression tree. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces DiffEngineParamConeProg, which replaces the tensor-based ParamConeProg with a C expression tree that evaluates A, b, q, d (and P for QPs) via the diff engine's automatic differentiation. Uses the evaluate-at-zero trick: since all expressions are affine in x after DCP2Cone, the Jacobian gives A and the gradient gives q directly. Also adds SymbolicQuadForm and DivExpression converters to the diff engine, updates ConicSolver/QpSolver to accept the new program type, and includes comprehensive comparison tests against the SCIPY backend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve canon_backend=None to DEFAULT_CANON_BACKEND in construct_solving_chain so that changing the default actually propagates through all code paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DIFF_ENGINE doesn't yet support all atoms, so keep CPP as default. The matrix_stuffing benchmarks now use ASV parameterized benchmarks to compare both backends side-by-side. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
n_params was only used for a size validation check and can be computed from n_param_nodes + each node's size. This simplifies the API by removing one argument from problem_register_params and one field to maintain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dimensions are now read directly from param_node->d1/d2 inside the C implementation, so the Python binding and caller no longer need to pass them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Precompute total parameter size when parameters are registered instead of recomputing it on every update_params call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document why these use generic make_index rather than custom C nodes: hot-path cost is dominated by Jacobian memcpy, not index lookup, and the Hessian sparsity limitation is identical either way. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # CLAUDE.md # cvxpy/reductions/solvers/nlp_solvers/diff_engine/_bindings/bindings.c # cvxpy/reductions/solvers/solving_chain.py # diff_engine_core
The import used `import _diffengine` directly, which isn't available. Updated to `from sparsediffpy import _sparsediffengine as _diffengine` to match the rest of the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inherit from ParamProb so DiffEngineParamConeProg is no longer a duck-typed stand-in: move split_solution to the base class, simplify isinstance checks to use ParamProb, deduplicate format_constraints by delegating to _build_restruct_operator, and fix PowConeND ndim==1 bug in the shared operator builder. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…aths Update _convert_matmul to use the unified make_left_matmul binding which accepts (param_or_none, child, csr_data, csr_indices, csr_indptr, m, n). For updatable parameters, build a dense CSR so all entries can change between solves via refresh_param_values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use value_sparse.toarray() for parameters with sparse_idx to avoid the deprecation warning from .value on sparse CVXPY expressions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace _has_parameters helper with direct isinstance(arg, cp.Parameter) checks. Use value_sparse for sparse parameters to avoid deprecation warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… PR) Co-Authored-By: Claude Opus 4.6 <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.
Description
Please include a short summary of the change.
Issue link (if applicable):
Type of change
Contribution checklist