question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate away from absl logging.

See original GitHub issue

I would suggest a small change. It seems like Jax’s logging facilities rely on Abseil like tensorflow, which is an interesting google product. But, is it really necessary to use though? Python already provides a logging mechanism, would it be easy to migrate to that? It seems to be used in

  1. jaxlib/tpu_client.py
  2. jaxlib/xla_client.py
  3. jax/experimental/host_callback.py
  4. jax/interpreters/pxla.py
  5. jax/interpreters/sharded_jit.py
  6. jax/interpreters/xla.py
  7. jax/lib/xla_bridge.py

Using abseil can confuse users who are trying to silence warnings and assume jax is using python’s warning systems. For example, the famous

 WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
nicholasjngcommented, Jul 6, 2022

Ideally we could still use absl optionally but hide that behind a Python logging interface. What do you think of the following?

1. Introduce a `jax.config.jax_use_absl_logging` flag, off by default.

2. Set up a module (say, `jax.logging`) that offers the interface of Python's `logging`. Have this forward to Python `logging` by default, or delegate to `absl.logging` where applicable if the config flag says to do that instead.

3. Change jax internals to use `jax.logging` across the codebase. This will require e.g. moving away from calls to absl's `vlog` and instead directly calling `jax.logging.debug` etc.

I made an attempt at implementing this solution in #10968, and would be happy about some feedback/guidance 😃

1reaction
froystigcommented, Apr 20, 2022

Ideally we could still use absl optionally but hide that behind a Python logging interface. What do you think of the following?

  1. Introduce a jax.config.jax_use_absl_logging flag, off by default.
  2. Set up a module (say, jax.logging) that offers the interface of Python’s logging. Have this forward to Python logging by default, or delegate to absl.logging where applicable if the config flag says to do that instead.
  3. Change jax internals to use jax.logging across the codebase. This will require e.g. moving away from calls to absl’s vlog and instead directly calling jax.logging.debug etc.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging - Abseil
Abseil has its own library for logging in Python. It is implemented on top of the standard logging module in Python (described ......
Read more >
Kiosk Mode: Access to chrome.enterprise.deviceAttributes API
Currently, we're using a Kiosk App which is distributed on the Chrome Web Store. This app reads the DirectoryDevice ID via getDirectoryDeviceId ...
Read more >
254.xml - SAP Community
... 0.1 https://answers.sap.com/questions/13027572/unable-to-move-away-from- ... /ibp-data-integration-job-log.html 2020-04-22T00:00:00+00:00 monthly 0.1 ...
Read more >
Log - HEAD - chromium/src/media/midi - Git at Google
... 94dc01f Migrate base::{size,empty,data} to STL equivalents in //media. by ... 476333e media, mojo: Replace base::Optional with absl::optional by Anton ...
Read more >
ABSL - Animal Biosafety Level (1-4) (See Biosafety Level below)
proper acquisition, use, storage, transfer, and disposal of biological materials. For laboratories operating at Biosafety Level (BSL) 3, an additional ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found