Skip to content

Commit b19fa25

Browse files
chunnienccopybara-github
authored andcommitted
update torch-xla related in READMEs
PiperOrigin-RevId: 706022336
1 parent 50c43a3 commit b19fa25

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,6 @@ Alternately, the nightly version can be installed with:
102102
pip install ai-edge-torch-nightly
103103
```
104104

105-
### Update LD_LIBRARY_PATH if necessary
106-
107-
Torch XLA builds a shared library, `_XLAC.so` that needs to link to the version of Python
108-
it was built with (currently 3.10 or 3.11). In order to ensure that `import _XLAC` can succeed,
109-
update the LD_LIBRARY_PATH to the lib directory of your Python environment:
110-
111-
```bash
112-
export LD_LIBRARY_PATH=<path to Python installation>/lib:$LD_LIBRARY_PATH
113-
```
114-
115105

116106
* The list of versioned releases can be seen [here](https://github.com/google-ai-edge/ai-edge-torch/releases).
117107
* The full list of PyPi releases (including nightly builds) can be seen [here](https://pypi.org/project/ai-edge-torch/#history).

docs/pytorch_converter/README.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
* [Error during torch.export.export](#error-during-torchexportexport)
1414
* [Error during ExportedProgram to edge model lowering](#error-during-exportedprogram-to-edge-model-lowering)
1515
* [Visualization](#visualization)
16-
* [Use ODML Torch Conversion Backend (Experimental)](#use-odml-torch-conversion-backend-experimental)
16+
* [Use Torch XLA Conversion Backend (Legacy)](#use-torch-xla-conversion-backend-legacy)
17+
* [Update LD_LIBRARY_PATH if necessary](#update-ld_library_path-if-necessary)
1718

1819
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
19-
<!-- Added by: cnchan, at: Wed Jul 24 09:51:17 PM PDT 2024 -->
2020

2121
<!--te-->
2222

@@ -327,19 +327,26 @@ pip install ai-edge-model-explorer
327327
model-explorer 'resnet.tflite'
328328
```
329329

330-
# Use ODML Torch Conversion Backend (Experimental)
330+
# Use Torch XLA Conversion Backend (Legacy)
331331

332-
ODML Torch is an experimental conversion backend for AI Edge Torch, which enables
333-
conversion on macOS and generates TFLite Flatbuffer with higher quality and better
334-
performance. To use AI Edge Torch with ODML Torch, setup your environment these
335-
commands:
332+
AI Edge Torch has been switched to a modern conversion backend for better
333+
on-device compatibility and performance. However, if you encounter compatibility
334+
issues, you can optionally switch to the legacy Torch XLA backend:
336335

337336
```bash
338-
# Install ODML Torch backend dependencies
339-
pip install -r https://raw.githubusercontent.com/google-ai-edge/ai-edge-torch/main/odmltorch-requirements.txt
340-
# Install ai-edge-torch with no default backend (Torch XLA) dependencies
341-
pip install ai-edge-torch-nightly --no-deps
342-
343-
# Disable default AI Edge Torch backend (Torch XLA)
344-
export USE_TORCH_XLA=0
345-
```
337+
# Install ai-edge-torch with torch-xla dependency
338+
pip install ai-edge-torch-nightly[torch-xla]
339+
340+
# Enable torch-xla as the AI Edge Torch backend
341+
export USE_TORCH_XLA=1
342+
```
343+
344+
## Update LD_LIBRARY_PATH if necessary
345+
346+
Torch XLA builds a shared library, `_XLAC.so` that needs to link to the version of Python
347+
it was built with (currently 3.10 or 3.11). In order to ensure that `import _XLAC` can succeed,
348+
update the LD_LIBRARY_PATH to the lib directory of your Python environment:
349+
350+
```bash
351+
export LD_LIBRARY_PATH=<path to Python installation>/lib:$LD_LIBRARY_PATH
352+
```

0 commit comments

Comments
 (0)