Python3-torch / rocm

Hi all,

I just tried to upgrade from Fedora 40 to Fedora 41 and found that python3-torch now pulls in a huge amount of rocm-related packages so I will need like 25 GiB of extra space.

IMHO this is a lot, especially when not even having an AMD GPU installed (I’m using nvidia).

Is there a way to, like, “unbundle” rocm from pytorch in Fedora 41 or do I have to live with such a waste of space?

At the moment, I don’t see anything that could be done, other than pinning pytorch. I suggest opening a Fedora bug report requesting that the pytorch maintainer split it up a bit so that you can only install the dependencies you need.

You might be able to do it using RPM rather than DNF.

You can download python3-torch from https://pkgs.org/download/python3-torch(x86-64)

Than use rpm to install it with --nodeps flag

sudo rpm -i --nodeps python3-torch-2.4.0-7.fc41.x86_64.rpm

Will it work and how to use it? That is something you can tell me :slight_smile:

probably not, because

  1. this will skip all other (needed) dependencies as well and
  2. when doing a dnf update rocm will be installed unless python3-torch is versionlocked.

You can do a rpm2cpio python3-torch*.rpm | cpio -id to circumvent (2) but this is nuts.

I ended up creating a bug report and installing pytorch using pip install --user torch.

1 Like