Add netket.tools.info to help debug issues with NetKet
Created by: PhilipVinc
PR on top of #671 and #672
In the spirit of #671, adds a tool that can be run like python -m netket.tools.info
to provide a lot of information about the stack below netket.
In particular it tries to collect some informations about the system and prints them before importing any netket/jax-related library to help debug issues like #667 (closed):
- It prints NetKet version without importing netket itself
- It prints the python version/interpreter being used
- It prints some informations about the host, such as operating system, architecture (#666 (closed) issues) and, mainly, if AVX is supported or not by the CPU. Only at this point it will try to load most netket dependencies in order and print their versions
- Print all jax backends in case someone wants to use gpus but ain't detected. Prints whever Mpi4jax supports gpus, the same mpi4py informations as @femtobit tool, but a bit more verbose
- also tries to detect the global mpi environment (Very rudimentary) by running
which mpicc
andwhich mpirun
to diagnose mpi mismatches.
My idea is to add a GitHub issue template asking people to post the output of this tool when opening an issue, if they think it's relevant.
➜ python -m netket.tools.info
====================================================
== NetKet Diagnostic Informations ==
====================================================
NetKet version : 3.0b1.post9.dev4+g753a7f2a.d20210501
# Python
- implementation : CPython
- version : 3.8.2
- distribution : Clang 12.0.0 (clang-1200.0.32.29)
- path : /Users/filippovicentini/Documents/pythonenvs/netket_env/bin/python
# Host informations
- System : macOS-11.2.3-x86_64-i386-64bit
- Architecture : x86_64
- AVX : True
- AVX2 : False
- Cores : 6
# NetKet dependencies
- numpy : 1.20.2
- jaxlib : 0.1.65
- jax : 0.2.12
- flax : 0.3.3
- optax : 0.0.6
- numba : 0.53.1
- mpi4py : 3.0.3
- mpi4jax : 0.2.18
- netket : 3.0b1.post9.dev4+g753a7f2a.d20210501
# Jax
- backends : ['cpu']
- cpu : [CpuDevice(id=0)]
# MPI4JAX
- HAS_GPU_EXT : False
# MPI
- mpi4py
- MPICC : /usr/local/bin/mpicc
- MPI link flags : ['-L/usr/local/opt/libevent/lib', '-L/usr/local/Cellar/open-mpi/4.1.0/lib']
- MPI version : (3, 1)
- MPI library_version : Open MPI v4.1.0, package: Open MPI brew@BigSur Distribution, ident: 4.1.0, repo rev: v4.1.0, Dec 18, 2020
- global
- MPICC : /usr/local/bin/mpicc
- MPI link flags : ['-L/usr/local/opt/libevent/lib', '-L/usr/local/Cellar/open-mpi/4.1.0/lib']