Skip to content
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

ENH: Added display modes for show_runtime #26255

Draft
wants to merge 3 commits into
base: main
Choose a base branch
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/

@@ -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"

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.

None yet

2 participants