Skip to content

Torch installation instructions for different platforms #7859

@chitralverma

Description

@chitralverma

Hi, coming from poetry, I am trying out uv due to poetry's super slow resolutions and bulk.

Our workflow is as follows,

  • Devs develop a project on their Macs with dependency sentence-transformers which pulls in torch as well.
  • Macs do not have GPU, so by default, we'd like to run all development and even deployment on CPU only
  • For the final product env, where GPUs are available, we would like to have an extras flag in the project, let's say 'cuda' which pulls in GPU dependencies.

In short, we'd like to use uv to create a project in which the project source code remains the same, it is developed on Mac and only pulls in CPU dependencies by default. But for the target deployment environment where GPUs are available, we should be able to deploy the same project with an extra flag that pulls in the torch's GPU dependencies as well.

In poetry, we were following something like this, any suggestions on how to do this uv/ rye as we are very new with this?

Also referencing, pytorch/pytorch#136275

Dev Env Details:
uv == latest, 0.4.18
python >= 3.8
platform: mac, sequoia, cpu-only env

Prod Env Details:
uv == latest, 0.4.18
python >= 3.8
platform: linux, gpu env

cc @charliermarsh @mitsuhiko

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsquestionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions