Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ENH: Added display modes for show_runtime #26255

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
Loading
from

Conversation

ganesh-k13
Copy link
Member

@ganesh-k13 ganesh-k13 commented Apr 10, 2024

Changes

  • ENH: Added display modes for show_runtime

Allowed modes are same as show_config

`dicts` mode
In [2]: np.show_runtime(mode='dicts')
Out[2]:   
[{'numpy_version': '2.1.0.dev0+git20240410.6e3b392',
  'python': '3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]',
  'uname': {'machine': 'x86_64',
   'node': 'ganesh-MS-7B86',
   'processor': 'x86_64',
   'release': '5.15.0-100-generic',
   'system': 'Linux',
   'version': '#110-Ubuntu SMP Wed Feb 7 13:27:48 UTC 2024'}},
 {'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
   'found': ['SSSE3',
    'SSE41', 
    'POPCNT', 
    'SSE42',    
    'AVX',      
    'F16C',     
    'FMA3',     
    'AVX2'],    
   'not_found': ['AVX512F',
    'AVX512CD',    
    'AVX512_KNL',                                                                                
    'AVX512_KNM',       
    'AVX512_SKX',
    'AVX512_CLX',    
    'AVX512_CNL',          
    'AVX512_ICL']}},
 {'user_api': 'blas',
  'internal_api': 'openblas',
  'num_threads': 12,
  'prefix': 'libopenblas',
  'filepath': '/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so',
  'version': '0.3.20',
  'threading_layer': 'pthreads',
  'architecture': 'Zen'}]

`stdout` mode (default)
In [3]: np.show_runtime()
- numpy_version: 2.1.0.dev0+git20240410.6e3b392
  python: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
  uname:
    machine: x86_64
    node: ganesh-MS-7B86
    processor: x86_64
    release: 5.15.0-100-generic
    system: Linux
    version: '#110-Ubuntu SMP Wed Feb 7 13:27:48 UTC 2024'
- simd_extensions:
    baseline:
    - SSE
    - SSE2
    - SSE3
    found:
    - SSSE3
    - SSE41
    - POPCNT
    - SSE42
    - AVX
    - F16C
    - FMA3
    - AVX2
    not_found:
    - AVX512F
    - AVX512CD
    - AVX512_KNL
    - AVX512_KNM
    - AVX512_SKX
    - AVX512_CLX
    - AVX512_CNL
    - AVX512_ICL
- architecture: Zen
  filepath: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so
  internal_api: openblas
  num_threads: 12
  prefix: libopenblas
  threading_layer: pthreads
  user_api: blas
  version: 0.3.20

ToDo

  • Typing changes
  • Release notes

Notes

resolves: https://mail.python.org/archives/list/numpy-discussion@python.org/thread/NF7ET6O5ELCLXGEIN7P2AUO5S4MESMSK/

@ganesh-k13 ganesh-k13 requested a review from rgommers April 10, 2024 13:51
@ganesh-k13 ganesh-k13 self-assigned this Apr 10, 2024
ganesh-k13 added a commit to ganesh-k13/numpy that referenced this pull request Apr 10, 2024
ganesh-k13 added a commit to ganesh-k13/numpy that referenced this pull request Apr 10, 2024
ganesh-k13 added a commit to ganesh-k13/numpy that referenced this pull request Apr 10, 2024
@@ -633,7 +634,7 @@ test: PytestTester
#
# Placeholders for classes

def show_config() -> None: ...
def show_config(mode: ConfigDisplayModes) -> None | dict: ...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BvB93 / @mattip / @rgommers , just curious, how did the UT not catch this? I went over the typing UT but didn't quite get how it's not failing. Should we add some tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add some tests?

The answer to that question is pretty much always "yes, if they are not slow and complicated"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take this up in a following PR. It's a bit hard to navigate the typing tests.

@mattip
Copy link
Member

mattip commented Jul 3, 2024

@ganesh-k13 will you be continuing with this?

@ganesh-k13
Copy link
Member Author

@mattip , I'll pick it up this weekend. Got a bit busy lately.

Additionally created a util file for common functions between
`show_config` and `show_runtime`
@ganesh-k13 ganesh-k13 force-pushed the show_runtime_modes branch from 52f335a to 525373d Compare July 5, 2024 10:53
@ganesh-k13 ganesh-k13 marked this pull request as ready for review July 5, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.