-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorder block traversal order for correct hoisting. #9397
base: main
Are you sure you want to change the base?
Conversation
…able types in parfor lowering.
Please suggest a testing strategy. The original example is quite complex and it isn't even clear how to simplify it. I think the original bug generates a race condition and too many simplifications may cause the bug not to manifest. Alternatively, we could try to look at the diagnostics and see if any build_lists are being hoisted. |
Hi @DrTodd13 . |
…calls to getattrs come after those getattrs.
The prior code was actually okay but requires the blocks to be processed in the right order. The critical thing is that if there is a getattr on an object and then a call of that getattr, the getattr has to precede the call for the code that detects multiple writes to an object to detect this scenario as a second write. My attempt at copying the offending code into a Numba test didn't work because the block order there was one that didn't manifest the problem. Any test you could write now that used normal code I suppose you'd have no guarantee that the block order would continue to manifest the problem with any change later. |
@sklam Do you think these test failures are related to the PR? Seems unrelated to me. |
/azurepipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azurepipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@sklam , would you be able to review this PR? The issue is still there. |
might be related to #9582 but I'm not sure to be honest. |
#9532 fixes #9379 I am trying to understand what remaining cases are fixed by this PR uniquely. The original problem in #9379 seems to come from func([<listcomp>], *args) where the res = func([data[start_idx:end_idx, ...] for data in dataargs], *funcargs) to res = func([data[start_idx:end_idx, ...] for data in dataargs]) and confirmed that the bug goes away. I am unable to find a case that depends on the block traversal order. I believe such a case may appear from Numba internal changes; e.g. changes to inline-closure, changes to parfors details. I think this patch will prevent non-deterministic bug that may be introduced from randomized block insertion from other passes or changes to internal details. Since it seems unlikely for users to create such a case, and I am slightly concerned that the reordering may expose some unforeseen bugs, I suggest we merge it for 0.61 milestone. |
Resolves #9379