The current behavior of -enzyme-auto-sparsity=1 is to error out when the resulting Jacobian is null with the message:
Found no stores for sparsification
This is technically correct, but it leaves some automation on the table.
In GridKit, e.g. PR 364, we are having to specialize some Jacobian evaluations for models where we know which terms are null. However, this requires the adequate selection of the the specializations by the developers with some understanding of the equations implemented. This approach will not be sustainable long term as the complexity of the equations increases and the multivariate dependencies get less obvious. it would be great if Enzyme could return without error in those cases (perhaps with a warning).
Essentially, I would like the following to be able to compile __enzyme_fwddiff for the null $\frac{\partial f}{\partial y}$ with -enzyme-auto-sparsity=1
void residual(size_t n, double* x, double* y, double * f)
{
for (size_t i = 0; i < n; ++i)
{
f[i] = some_sparse_expression(x); // no dependency on y
}
}
cc @pelesh @wsmoses
The current behavior of
-enzyme-auto-sparsity=1is to error out when the resulting Jacobian is null with the message:This is technically correct, but it leaves some automation on the table.
In GridKit, e.g. PR 364, we are having to specialize some Jacobian evaluations for models where we know which terms are null. However, this requires the adequate selection of the the specializations by the developers with some understanding of the equations implemented. This approach will not be sustainable long term as the complexity of the equations increases and the multivariate dependencies get less obvious. it would be great if Enzyme could return without error in those cases (perhaps with a warning).
Essentially, I would like the following to be able to compile$\frac{\partial f}{\partial y}$ with
__enzyme_fwddifffor the null-enzyme-auto-sparsity=1cc @pelesh @wsmoses