Skip to content

mpi4torch may be built against a different pytorch version than present in the venv #7

Open
@d1saster

Description

@d1saster

Related to #5: pip seems to utilize its own installation of pytorch to build mpi4torch, no matter which version is present in the virtual environment.

This has the sideeffect that installing heat==1.2.0, which requires torch<=1.11.0 and then installing mpi4torch leads to unresolved symbols, once one tries to load mpi4torch, since pip will pull a newer version of torch to build mpi4torch.

Steps to reproduce in a fresh virtual environment:

pip install torch==1.11.0
pip install -v mpi4torch # this will at the moment also fetch an instance of torch==1.12.1 and use that to build mpi4torch
python -c 'import mpi4torch'

The latter will result (with torch=1.12.1 being used for the build) in:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/xyz/Test/2022-09-03_mpi4torch_bug/venv/lib/python3.9/site-packages/mpi4torch/__init__.py", line 2, in <module>
    from ._mpi import *
ImportError: /home/xyz/Test/2022-09-03_mpi4torch_bug/venv/lib/python3.9/site-packages/mpi4torch/_mpi.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN3c1022getCustomClassTypeImplERKSt10type_index

which is reasonable since this was changed between 1.11 and 1.12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions