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

Adding JAX_LOGGING_LEVEL configuration option #23468

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

rdyro
Copy link
Collaborator

@rdyro rdyro commented Sep 6, 2024

For example, setting JAX_LOGGING_LEVEL=DEBUG for

jax.jit(lambda x: x)(jnp.ones((10,)))

gives

DEBUG:2024-09-16 10:11:49,929:jax._src.path:45: etils.epath was not found. Using pathlib for file I/O.                                                            
DEBUG:2024-09-16 10:11:50,045:jax._src.dispatch:178: Finished tracing + transforming convert_element_type for pjit in 0.000222683 sec                             
DEBUG:2024-09-16 10:11:50,048:jax._src.xla_bridge:579: Discovered path based JAX plugin: jax_plugins.cuda                                                         
DEBUG:2024-09-16 10:11:50,048:jax._src.xla_bridge:579: Discovered path based JAX plugin: jax_plugins.rocm                                                         
DEBUG:2024-09-16 10:11:50,054:jax._src.xla_bridge:594: Loading plugin module jax_plugins.rocm                                                                     
DEBUG:2024-09-16 10:11:50,055:jax._src.xla_bridge:594: Loading plugin module jax_plugins.cuda                                                                     
DEBUG:2024-09-16 10:11:50,055:jax._src.xla_bridge:970: Initializing backend 'cpu'                                                                                 
DEBUG:2024-09-16 10:11:50,057:jax._src.xla_bridge:982: Backend 'cpu' initialized                                                                                  
DEBUG:2024-09-16 10:11:50,057:jax._src.xla_bridge:970: Initializing backend 'rocm'                                                                                
INFO:2024-09-16 10:11:50,057:jax._src.xla_bridge:895: Unable to initialize backend 'rocm': module 'jaxlib.xla_extension' has no attribute 'GpuAllocatorConfig'    
DEBUG:2024-09-16 10:11:50,057:jax._src.xla_bridge:970: Initializing backend 'tpu'                                                                                 
INFO:2024-09-16 10:11:50,058:jax._src.xla_bridge:895: Unable to initialize backend 'tpu': INTERNAL: Failed to open libtpu.so: libtpu.so: cannot open shared object
 file: No such file or directory                                                                                                                                  
DEBUG:2024-09-16 10:11:50,059:jax._src.interpreters.pxla:1903: Compiling convert_element_type with global shapes and types [ShapedArray(float32[])]. Argument mapp
ing: (UnspecifiedValue,).                                                                                                                                         
DEBUG:2024-09-16 10:11:50,066:jax._src.dispatch:178: Finished jaxpr to MLIR module conversion jit(convert_element_type) in 0.007055998 sec                        
DEBUG:2024-09-16 10:11:50,066:jax._src.compiler:168: get_compile_options: num_replicas=1 num_partitions=1 device_assignment=[[CpuDevice(id=0)]]                   
DEBUG:2024-09-16 10:11:50,067:jax._src.compiler:227: get_compile_options XLA-AutoFDO profile: using XLA-AutoFDO profile version -1                                
DEBUG:2024-09-16 10:11:50,067:jax._src.cache_key:120: get_cache_key hash of serialized computation: 96f6c2c849611cb65ca14596725417384a55335a17aaf471c2f18031b69bb7
36                                                                                                                                                                
DEBUG:2024-09-16 10:11:50,067:jax._src.cache_key:126: get_cache_key hash after serializing computation: 96f6c2c849611cb65ca14596725417384a55335a17aaf471c2f18031b69bb736
DEBUG:2024-09-16 10:11:50,067:jax._src.cache_key:120: get_cache_key hash of serialized jax_lib version: 5f45bbcdc1f605c0aa3cce55583a208fba43af4faefecfdf157d982dac286c25
DEBUG:2024-09-16 10:11:50,067:jax._src.cache_key:126: get_cache_key hash after serializing jax_lib version: 321fe1b73386c60fa57bb696231a28dbda25a62a329efc2c26d72fee523ea5fd
...

in the formatting style of already existing JAX module debugging: jax_debug_log_modules option.

@rdyro rdyro force-pushed the rdyro-add-logging-env branch 4 times, most recently from bc55b7e to d6f30ab Compare September 6, 2024 17:59
@rdyro rdyro requested a review from skye September 6, 2024 18:15
Copy link
Member

@skye skye left a comment

Choose a reason for hiding this comment

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

I need to review the test more carefully still but some initial comments.

jax/_src/config.py Outdated Show resolved Hide resolved
jax/_src/config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/config.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
@skye
Copy link
Member

skye commented Sep 11, 2024

Also can you provide example command + output in the PR description?

@rdyro rdyro force-pushed the rdyro-add-logging-env branch 2 times, most recently from 9850fa8 to c1d920c Compare September 13, 2024 18:21
@rdyro rdyro added the pull ready Ready for copybara import and testing label Sep 27, 2024
@rdyro rdyro force-pushed the rdyro-add-logging-env branch 6 times, most recently from bddedd5 to c58d7ad Compare October 7, 2024 17:35
tests/logging_test.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
tests/logging_test.py Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
tests/logging_test.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Outdated Show resolved Hide resolved
jax/_src/logging_config.py Show resolved Hide resolved
@rdyro rdyro force-pushed the rdyro-add-logging-env branch 2 times, most recently from 3f07429 to 0d19948 Compare October 21, 2024 16:27
@rdyro rdyro force-pushed the rdyro-add-logging-env branch 3 times, most recently from ada7554 to 2decbf3 Compare November 4, 2024 17:09
@copybara-service copybara-service bot merged commit 497a5a3 into jax-ml:main Nov 5, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants