heroku-buildpack-python icon indicating copy to clipboard operation
heroku-buildpack-python copied to clipboard

Add warning when using the `torch` GPU package instead of the CPU variant

Open edmorley opened this issue 10 months ago • 0 comments

Similar to #1343, but for PyTorch.

We should add a warning when we see that an app has installed the torch package from PyPI, which includes all of the GPU packages (that won't actually be used on Heroku) and results in a multi-gigabyte slug size.

PyTorch does have a CPU-only package variant, but it needs the correct package index to be specified. See: https://pytorch.org/get-started/locally/

eg something like:

torch==<version>+cpu --index-url https://download.pytorch.org/whl/cpu

As seen in:

  • https://heroku.support/1527398
  • https://heroku.support/1531439
  • https://heroku.support/1531634

GUS-W-19247065.

edmorley avatar Feb 17 '25 13:02 edmorley