doc and impl of RewriteArrayExprs are inconsistent
See original GitHub issuedef test_single_array_expr():
def _test_impl(array):
ret = array >= 0.1
return ret
jitted = numba.jit()(_test_impl)
arr = np.random.rand(10)
jit_ret = jitted(arr)
Code above will be rewritten by RewriteArrayExprs Pass. But array >= 0.1 only has one operator. Is it necessary to rewrite this expression, since loop fusion and shortcut deforestation optimizations don’t seem to work?
And in numba developer doc, it wrote (https://numba.readthedocs.io/en/latest/developer/rewrites.html):
RewriteArrayExprs.match(): The rewrite pass looks for two or more array operations that form an array expression.
Is it inconsistent between doc and impl?
If this can be confirmed as a real inconsistency, I would like to contribute some code to fix it.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Release Notes — Numba 0.56.4+0.g288a38bbd.dirty-py3.7 ...
Version 0.56.4 (3 November, 2022) . This is a bugfix release to fix a regression in the CUDA target in relation to...
Read more >目录 - Gitee
Historically inconsistent support by major hardware vendors (compiler bugs, ... Random impl in Numba follows CPython rather than NumPy, which makes it hard ......
Read more >Analysis Report numba-0.48.0-cp37-cp37m-win_amd64.whl
Those CPython APIs are private and can change in incompatible ways at. ... The implementation of the hash table (_Numba_hashtable_t) is based on...
Read more >numba - bytemeta
doc and impl of RewriteArrayExprs are inconsistent. PABannier. PABannier OPEN · Updated 6 months ago · `Jitclass` decorator removes the method signatures of ......
Read more >transfer of primordials package - Nodejs/Security-Wg - IssueHint
To document the transfer and finish it, this issue is created by me. ... doc and impl of RewriteArrayExprs are inconsistent, 10, 2022-04-07,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

My first guess is that the doc is wrong and
arrayexpris needed to map array operations to ufunc. But the code was written years ago and I need to look at it to confirm.IR is not in SSA form, but SSA IR is in SSA form. For example, if you have:
Then the dumps are:
The IR is not SSA form because there are multiple assignments to
a- in the SSA form, the second assignment is to a new variable,a.1. The introductory paragraphs of the Wikipedia article provide a reasonable summary: https://en.wikipedia.org/wiki/Static_single_assignment_form