-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add CLI to install dependencies #104
Conversation
Some optimum-tpu dependencies are not indexed on pypi, so a cli is povided to install those.
Use the python CLI script instead of the shell script.
Ubuntu latest image comes with Python 12, that is not compatible with torch xla yet.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for looking into see, can really make a big difference for the end user.
2 small nits otherwise 👌
@@ -15,7 +15,7 @@ concurrency: | |||
|
|||
jobs: | |||
build_documentation: | |||
runs-on: ubuntu-latest | |||
runs-on: ubuntu-22.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 24.04
not supported yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we had the same problem last week on optimum, see here. Ubuntu latest comes with python 12, not supported by torch xla yet.
import typer | ||
|
||
|
||
TORCH_VER = "2.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you source the version from torch
directly? Seems very error prone / easy forgettable in the long run isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually thinking in the long run I will try to remove the dependency altogether, so users could install optimum-tpu
and then install torch cpu using this CLI: this will allow to avoid installing the cuda dependencies of the default torch package.
What does this PR do?
Working with TPU requires installing some dependencies that are as simple to install as adding a pip dependency in the main package. This is even more evident for Jetstream Pytorch, that needs to be installed from a git repository.
Previously I had run the actions manually, added a target on Makefile and a script for it.
@mfuntowicz suggested that might not be practical for someone having the
optimum-tpu
package but not the sources:#99 (comment)
As a result, I added a script and integrated it as the
optimum-tpu
CLI to provide a simple command to install Jetstream Pytorch:Note that I also added an option to install pytorch xla. This is because in the future I might remove this dependency from
optimum-tpu
, since it is not required for inference when using Jetstream.Before submitting