Skip to content

Errors when building Pytorch patch and plugin #42

Open
@fengkeyleaf

Description

@fengkeyleaf

When I built the pytorch patchand plugin, I got the following errors but no errors reported before them:

Error message when building the patch:

(base) sora@fengkeyleaf-rog:~/pytorch$ git apply ~/switchml/dev_root/build/switchml_pytorch.patch
/home/sora/switchml/dev_root/build/switchml_pytorch.patch:50: trailing whitespace.
#The following lines should be filled automatically using the pytorch patch makefile to
error: patch failed: torch/csrc/distributed/c10d/init.cpp:1
error: torch/csrc/distributed/c10d/init.cpp: patch does not apply
error: patch failed: torch/lib/c10d/CMakeLists.txt:1
error: torch/lib/c10d/CMakeLists.txt: patch does not apply
error: patch failed: torch/lib/c10d/ProcessGroupGloo.cpp:1
error: torch/lib/c10d/ProcessGroupGloo.cpp: patch does not apply

Error message when building the plugin:

(/home/sora/switchml/dev_root/frameworks_integration/pytorch_plugin/path_to_env) sora@fengkeyleaf-rog:~/switchml/dev_root/frameworks_integration/pytorch_plugin$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 37, in
from torch.utils import cpp_extension
File "/home/sora/switchml/dev_root/frameworks_integration/pytorch_plugin/path_to_env/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 23, in
from pkg_resources import packaging # type: ignore[attr-defined]
ImportError: cannot import name 'packaging' from 'pkg_resources' (/home/sora/switchml/dev_root/frameworks_integration/pytorch_plugin/path_to_env/lib/python3.8/site-packages/pkg_resources/init.py)

I wonder if there are some ways to solve the problem or anyone else has the same error before? By the way, my OS info:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal

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