compiler: Introduce SparseLocalSum - #3028
Conversation
783e226 to
4d2e2b8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3028 +/- ##
==========================================
+ Coverage 83.67% 83.84% +0.17%
==========================================
Files 257 258 +1
Lines 55079 55281 +202
Branches 4710 4719 +9
==========================================
+ Hits 46087 46353 +266
+ Misses 8174 8112 -62
+ Partials 818 816 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
97d58e4 to
a099376
Compare
| obj = sympy.Expr.__new__(cls, expr) | ||
| obj._expr = expr | ||
| obj._cdims = as_tuple(cdims) | ||
| obj._dtype = np.dtype(dtype).type |
There was a problem hiding this comment.
fixed, leftover
| return symbols - self.bound_symbols | ||
|
|
||
| def _evaluate(self, **kwargs): | ||
| return self._rebuild(Evaluable._evaluate_maybe_nested(self.expr, **kwargs)) |
There was a problem hiding this comment.
why not just self.expr._evaluate?
| def _evaluate(self, **kwargs): | ||
| return self._rebuild(Evaluable._evaluate_maybe_nested(self.expr, **kwargs)) | ||
|
|
||
| def _xreplace(self, rule): |
There was a problem hiding this comment.
Seems weird to need that here
a099376 to
c3b939a
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| processed.extend([init, update]) | ||
| subs[reduction] = value | ||
|
|
||
| expr = e.apply(partial(uxreplace, rule=subs)) |
There was a problem hiding this comment.
that's a weird one, why not just uxreplace(e, subs) ?
There was a problem hiding this comment.
fixed, it was a leftover indeed, good catch
| """ | ||
| Construct the private initializer and guarded accumulation for one sum. | ||
| """ | ||
| value = Temp(name=sregistry.make_name(prefix='sum'), dtype=cluster.dtype) |
There was a problem hiding this comment.
this should use the reduction.dtype, not cluster.dtype
There was a problem hiding this comment.
good catch, fixed
... for graceful lowering
this allows specialisation in PRO