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

libtpu not installed with nightly build #7731

Closed
davidaknowles opened this issue Jul 23, 2024 · 4 comments · Fixed by #7737
Closed

libtpu not installed with nightly build #7731

davidaknowles opened this issue Jul 23, 2024 · 4 comments · Fixed by #7737

Comments

@davidaknowles
Copy link

❓ Questions and Help

Hi - I followed the instructions for the nightly build install (on a v4-8), i.e.

pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl

which ran successfully (pip claims), but this isn't giving me access to the TPU. When I try to run the test code from the Troubleshooting page I get an error that libtpu wasn't found. Am I missing an installation step?

@JackCaoG
Copy link
Collaborator

suspect this is a pip issue, if you do

root@t1v-n-bafa368c-w-0:/ansible# python
Python 3.10.14 (main, Apr 24 2024, 12:45:30) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import libtpu
>>> libtpu.__file__
'/usr/local/lib/python3.10/site-packages/libtpu/__init__.py'

what would you see?

@davidaknowles
Copy link
Author

davidaknowles commented Jul 24, 2024

daknowles@t1v-n-57a06759-w-0:~$ python
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import libtpu
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'libtpu'
>>> 

That "CPU" in the first command for the installation isn't a typo right?

@JackCaoG
Copy link
Collaborator

cpu part is for the torchvision, it actually has nothing to do with the libtpu. To install the libtpu you can run

pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html

Let me move this up in our README, it is mentioned in https://github.com/pytorch/xla#python-packages but it is hard to find. I will fix it tmr.

@davidaknowles
Copy link
Author

OK yup that fixed it, thanks! I saw that line in the README but assumed that would install stable not nightly.

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 a pull request may close this issue.

2 participants