ENH: Use threadpoolctl in show_runtime (a new function)#21468
ENH: Use threadpoolctl in show_runtime (a new function)#21468mattip merged 5 commits intonumpy:mainfrom
threadpoolctl in show_runtime (a new function)#21468Conversation
|
Thanks for working on this @ganesh-k13! Note that gh-14492 is also very much related. I think we'd like |
threadpoolctlthreadpoolctl in show_config
|
@rgommers Out of curiosity, can the build time information be obtained from meson? |
There's always a way:) It has sane configure-time output, which may make sense to store in full: DetailsIt contains |
|
I would be fine with fixing |
|
Hey @mattip, I see two enhancements based on various discussions,
Which do you think is apt for this PR, I can work on that. |
numpy/distutils/misc_util.py
Outdated
| directories, include directories, etc.) in the system on which | ||
| NumPy was built. | ||
| Print information about various resources in the system | ||
| on which NumPy was built. |
There was a problem hiding this comment.
The information presented no longer is the build-time information.
| on which NumPy was built. | |
| including available intrinsic support and BLAS/LAPACK library | |
| in use |
numpy/distutils/misc_util.py
Outdated
| 'threading_layer': 'pthreads', | ||
| 'user_api': 'blas', | ||
| 'version': '0.3.20'}] | ||
|
|
There was a problem hiding this comment.
Where is the example of the SIMD information?
There was a problem hiding this comment.
Didn't want to clutter the docstring, but yeah makes sense to add it as it'll always be displayed
|
I think this change would be more appropriate as a new |
|
Oh yeah that's a good point, we can make |
02043a2 to
49ed995
Compare
threadpoolctl in show_configthreadpoolctl in show_runtime (a new function)
49ed995 to
77198c9
Compare
|
I see you updated the PR description to show the new function output. It looks good to me. This is failing since it adds a new function to the namespace. It should probably hit the mailing list in parallel with fixing the test to allow the addition. When you post, please add the output. |
|
Thanks Matti, fixing the tests now. I've posted to the mailing list today: https://mail.python.org/archives/list/[email protected]/thread/A3Q2WXBRFK3MKHOSEX3RUVRJRKCFGWKX/ |
|
I don't think this needs to be part of the generated |
99e25bc to
4da4044
Compare
|
Thanks for the review Matti! I have moved it to lib/utils.py and also added a release note. |
4da4044 to
73e2245
Compare
mattip
left a comment
There was a problem hiding this comment.
LGTM. Just some documentation tweaks.
| A new function ``np.show_runtime`` has been added to display the runtime | ||
| information of the machine in addition to ``np.show_config`` which displays | ||
| the build-related information. | ||
| This function returns a list of dictionaries as follows:: |
There was a problem hiding this comment.
I think everything from here down should be removed. show_runtime should be added to the documentation here
numpy.show_runtime, and numpy.show_config (with single back-ticks), and they would be turned into links.
| in use | ||
| See Also |
There was a problem hiding this comment.
Blank line needed
| in use | |
| See Also | |
| in use | |
| See Also |
numpy/lib/utils.py
Outdated
| show_config : Show libraries in the system on which | ||
| NumPy was built. | ||
| Notes |
There was a problem hiding this comment.
Blank line, reformat
| show_config : Show libraries in the system on which | |
| NumPy was built. | |
| Notes | |
| show_config : Show libraries in the system on which NumPy was built. | |
| Notes |
numpy/lib/utils.py
Outdated
| `__cpu_baseline__` and `__cpu_dispatch__` | ||
| Examples |
There was a problem hiding this comment.
Blank line needed
| `__cpu_baseline__` and `__cpu_dispatch__` | |
| Examples | |
| `__cpu_baseline__` and `__cpu_dispatch__` | |
| Examples |
numpy/lib/utils.py
Outdated
| 2. In case `threadpoolctl` is not installed, a message is | ||
| displayed with help on how to install it. |
1. Information is derived with the help of `threadpoolctl` library. 2. In case `threadpoolctl` is not installed, a message is displayed with help on how to install it. 3. SIMD related information is derived from `__cpu_features__`, `__cpu_baseline__` and `__cpu_dispatch__`
73e2245 to
c806a0a
Compare
| New function `np.show_runtime` | ||
| ------------------------------ | ||
|
|
||
| A new function `np.show_runtime` has been added to display the runtime | ||
| information of the machine in addition to `np.show_config` which displays | ||
| the build-related information. |
There was a problem hiding this comment.
Double back-ticks for np.* to format as code. If you want a link, you need to use numpy.* with single back-ticks. We tried telling sphinx that np is an alias for numpy, but couldn't get the links to work.
| New function `np.show_runtime` | |
| ------------------------------ | |
| A new function `np.show_runtime` has been added to display the runtime | |
| information of the machine in addition to `np.show_config` which displays | |
| the build-related information. | |
| New function ``np.show_runtime`` | |
| -------------------------------- | |
| A new function `numpy.show_runtime` has been added to display the runtime | |
| information of the machine in addition to `numpy.show_config` which displays | |
| the build-related information. |
There was a problem hiding this comment.
Thanks for the info! Learning Sphinx on the way :). Fixed via 3d2fe4e
numpy/lib/utils.py
Outdated
| 2. SIMD related information is derived from `__cpu_features__`, | ||
| `__cpu_baseline__` and `__cpu_dispatch__` |
There was a problem hiding this comment.
Double back-ticks to format as code. Single back-ticks for links. I don't think we have links for those attributes.
| 2. SIMD related information is derived from `__cpu_features__`, | |
| `__cpu_baseline__` and `__cpu_dispatch__` | |
| 2. SIMD related information is derived from ``__cpu_features__``, | |
| ``__cpu_baseline__`` and ``__cpu_dispatch__`` |
numpy/lib/utils.py
Outdated
|
|
||
| Notes | ||
| ----- | ||
| 1. Information is derived with the help of `threadpoolctl` |
There was a problem hiding this comment.
If you want this to be a link, you have to provide the url. Otherwise use double back-ticks.
There was a problem hiding this comment.
Thanks yeah it renders now: https://output.circle-artifacts.com/output/job/79c7902f-6c77-4b35-8f43-d55ceaee6ff5/artifacts/0/doc/build/html/reference/generated/numpy.show_runtime.html, all though it will give flake8 errors, I'm not sure why adding new line like this did not work:
Lines 1846 to 1847 in 17d730a
b5d1e93 to
ab63e3f
Compare
ab63e3f to
c8ed74e
Compare
c8ed74e to
3d2fe4e
Compare
|
Thanks @ganesh-k13 this will be helpful going forward |
ENH: Use
threadpoolctlthreadpoolctlatnp.show_confignp.show_runtimeSample output
or
resolves: #21340
related: #20939