Repository navigation
add THREADING_LAYER_PRIORITY & NUMBA_THREADING_LAYER_PRIORITY - #7234
Conversation
|
@ickc thank you for your submission and welcome to the Numba project! I have labeled your pull-request as "ready for review" and added it to the backlog. I have also labeled it as being a short review effort since the changes appear to be fairly straightforward. Note however, that we are currently in a release candidate phase (RC2 was published 19.07.2021) and so we are currently focused on any release critical bugs. This means it may potentially be some time until we can review it. We thank you in advance for you patience and understanding! |
|
@ickc do you want me to remove the "ready for review" label again? |
|
@esc, do you think a test is needed? It seems that it should be residing in I also want to test it locally first to make sure it is doing as claimed so may be removing the "ready for review" for now. Thanks. |
You got it! 👍 |
Yes a test would be good. Also a test for the failure case and parsing the error message would be suitable. Not sure about the statefulness however. |
in TestThreadingLayerPriority where parallel is not supported in 32-bit systems
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the PR. This is a good start and it's great to see this functionality added. I've given this an initial review, most comments are small things but there's a couple of more involved things in relation to testing. If anything is not clear please do ask :) Thanks again for working on this.
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
to mention setting numba.config.THREADING_LAYER_PRIORITY
|
@stuartarchibald, ready for a 2nd round review. |
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the update, few minor things to resolve else looks good.
| print(' '.join(numba.config.THREADING_LAYER_PRIORITY)) | ||
| print("@%s@" % numba.threading_layer(), file=sys.stderr) |
There was a problem hiding this comment.
Instead of using stdout/stderr, perhaps just make these into assertions such that the process will exit non-zero if there's a problem. The use of stdout/stderr relies on these streams never having unexpected things written to them (e.g. a deprecation warning) which makes their use more fragile.
There was a problem hiding this comment.
The stdout should be safe. The stderr pattern @%s@ is actually copied from other tests in Numba (if you search this string in the same file there are 2 other such uses.) So I was just following whatever is practicing in Numba already...
There was a problem hiding this comment.
The stdout should be safe. The stderr pattern
@%s@is actually copied from other tests in Numba (if you search this string in the same file there are 2 other such uses.) So I was just following whatever is practicing in Numba already...
This is one of the things the code base has been moving away from as it's a little error prone. As it's variables that are ending up as strings to test, having an assert on the actual variables is cheap and reduces maintenance burden. In the interests of getting this feature merged and pre-existing use of this pattern I'm included to leave it. I'll make a note of this pattern as something to refactor generally.
| @@ -306,6 +306,11 @@ def avx_default(): | |||
| DISABLE_JIT = _readenv("NUMBA_DISABLE_JIT", int, 0) | |||
|
|
|||
| # choose parallel backend to use | |||
There was a problem hiding this comment.
This comment does not match this variable, it belongs to THREADING_LAYER.
There was a problem hiding this comment.
But shouldn't both THREADING_LAYER_PRIORITY and THREADING_LAYER are part of the "choose parallel backend to use" process?
There was a problem hiding this comment.
I think that the THREADING_LAYER, if prescribed, will act as the choice for the parallel backend in use, whereas the THREADING_LAYER_PRIORITY sets preference for use of threading layers in the case that no explicit choice is prescribed?
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
|
@stuartarchibald, thanks for the review. I resolved some trivial ones. For the 2 remaining open ones, I commented them and see if you agree with it. |
stuartarchibald
left a comment
There was a problem hiding this comment.
Thanks for the patch and fixes.
Reference an existing issue
Close #4486.