Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Jul 30, 2025

Unify OSS and internal logging libraries.

This removes the duplicated implementation of LOG, VLOG and CHECK macros
and relies directly on the implementation provided by Abseil.

TSL logging is not consistently used in XLA. Sometime the Abseil logging headers are included instead. This is not a problem internally because TSL logging aliases Abseil logging. However in OSS, TSL logging is a custom logging library. Abseil logging doesn't recognise the TF_CPP_MAX_VLOG_LEVEL and TF_CPP_VMODULE environment variables while OSS TSL logging doesn't recognise the --vmodule and --v flags.

To preserve backward compatibility in OSS, we run static initialisation logic that initialises Abseil logging from the TF_CPP_MIN_LOG_LEVEL/TF_CPP_MAX_VLOG_LEVEL/TF_CPP_VMODULE env variables.

@copybara-service copybara-service bot force-pushed the test_780164601 branch 13 times, most recently from 397ad88 to 5fada6a Compare August 4, 2025 18:17
@copybara-service copybara-service bot force-pushed the test_780164601 branch 5 times, most recently from df84bbe to 993b51b Compare August 11, 2025 08:43
@copybara-service copybara-service bot force-pushed the test_780164601 branch 5 times, most recently from fa911c6 to 16119a7 Compare August 26, 2025 18:45
This removes the duplicated implementation of `LOG`, `VLOG` and `CHECK` macros
and relies directly on the implementation provided by Abseil.

TSL logging is not consistently used in XLA. Sometime the Abseil logging headers are included instead. This is not a problem internally because TSL logging aliases Abseil logging. However in OSS, TSL logging is a custom logging library. Abseil logging doesn't recognise the `TF_CPP_MAX_VLOG_LEVEL` and `TF_CPP_VMODULE` environment variables while OSS TSL logging doesn't recognise the `--vmodule` and `--v` flags.

To preserve backward compatibility in OSS, we run static initialisation logic that initialises Abseil logging from the `TF_CPP_MIN_LOG_LEVEL`/`TF_CPP_MAX_VLOG_LEVEL`/`TF_CPP_VMODULE` env variables.

PiperOrigin-RevId: 799665233
@copybara-service copybara-service bot merged commit 07a3afe into main Aug 26, 2025
@copybara-service copybara-service bot deleted the test_780164601 branch August 26, 2025 19:26
bhavya01 added a commit to pytorch/xla that referenced this pull request Oct 6, 2025
This PR updates the following pins:

- PyTorch:
pytorch/pytorch@928ac57
to
pytorch/pytorch@21fec65
(v2.9.0-rc5)
- OpenXLA:
openxla/xla@92f7b59
to
openxla/xla@9a9aa0e
- `libtpu`: 0.0.21 to 0.0.24
- JAX (and `jaxlib`): 0.7.1 to 0.8.0

**Key Changes:**

- `@python` was replaced by `@rules_python` at `BUILD` file (ref:
[jax-ml/jax#31709](jax-ml/jax#31709))
- `TF_ATTRIBUTE_NORETURN` was removed in favor of abseil (ref:
[openxla/xla#31699](openxla/xla#31699))
- Replaced include of `xla/pjrt/tfrt_cpu_pjrt_client.h` file by
`xla/pjrt/cpu/cpu_client.h` in `pjrt_registry.cpp`
([openxla/xla#30936](openxla/xla#30936))
- Moved the old `xla/tsl/platform/default/logging.*` to
`torch_xla/csrc/runtime/tsl_platform_logging.*`
- They were removed in
[openxla/xla#29477](openxla/xla#29477)
- Copied them here, temporarily. They should be removed once we update
our error throwing macros.
- Commented out a few macro definitions, avoiding macro re-definitions

**Update (Oct 3):**
- Add an OpenXLA patch for fixing `static_assert(false)` for GCC < 13
([ref](https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9944ca17c0766623bce260684edc614def7ea761))
- Removed the `flax` pin, since it does not overwrite `jax` anymore
- Removed `TPU*` prefix of `jax.experimental.pallas.tpu` components
(ref: [jax-ml/jax#29115](jax-ml/jax#29115))

---------

Co-authored-by: Bhavya Bahl <bbahl@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants