The `libtpu` library is a low-level runtime component that provides the interface for Python-based machine learning frameworks (such as JAX and PyTorch/XLA) to communicate with Google Cloud TPUs. It is primarily a dependency managed by these high-level frameworks rather than a library intended for direct user application development. The current version is 0.0.39 and it requires Python >= 3.11. It has no strict release cadence, with updates typically coinciding with changes in underlying TPU infrastructure or integrations with ML frameworks.
pip install libtpuVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to verify the presence and configuration of TPU devices using JAX, which is the most common way users interact with the capabilities provided by `libtpu`. Running this code on a Google Cloud TPU instance with `jax[tpu]` installed will confirm `libtpu`'s operational status.
Focus on setting up your ML framework (e.g., JAX) correctly for TPU usage; avoid trying to directly manipulate `libtpu`'s internal APIs unless you have a highly specialized use case.
Deploy your application to a Google Cloud TPU VM or environment to utilize `libtpu`'s functionality.
Always follow the official installation instructions for JAX or PyTorch/XLA on TPU, which typically bundle or specify compatible `libtpu` versions. Avoid arbitrary `pip install libtpu` if you are using a framework.
Ensure your environment is running Python 3.11 or a later compatible version.
Consult Google Cloud's official documentation for JAX/PyTorch on TPU to ensure all necessary environment configurations are in place. When troubleshooting, verify these variables if other solutions fail.
Ensure `libtpu.so` is correctly installed, the `LD_LIBRARY_PATH` environment variable includes its directory, and the library's architecture matches the system. Explicitly setting `TPU_LIBRARY_PATH` to the full path of `libtpu.so` may also resolve the issue.
Verify that `libtpu` and the correct TPU-enabled version of `jaxlib` (or `tensorflow-tpu`) are installed and compatible with each other and your Python version. This often requires using specific `pip install` commands provided in the framework's documentation, which include `--find-links` arguments to the correct wheel repositories.
Identify and terminate any other process that might be using the TPU (e.g., using `sudo lsof -w /dev/accel0` to find the process ID) or ensure that only one process attempts to access the TPU at a time. A manual reset of the TPU server might also be required.
Ensure that the versions of your machine learning framework (JAX or TensorFlow) and `libtpu` are compatible. This often requires installing specific, matching versions, potentially by downgrading the framework to a version known to be compatible with your `libtpu` installation.
No dependency data recorded yet.