Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporarily disable mps ops for torch2.1.0 #2958

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ def get_mluops_version(file_path):
extra_compile_args['cxx'] += ['-ObjC++']
# src
op_files = glob.glob('./mmcv/ops/csrc/pytorch/*.cpp') + \
glob.glob('./mmcv/ops/csrc/pytorch/cpu/*.cpp') + \
glob.glob('./mmcv/ops/csrc/common/mps/*.mm') + \
glob.glob('./mmcv/ops/csrc/pytorch/mps/*.mm')
glob.glob('./mmcv/ops/csrc/pytorch/cpu/*.cpp')
# TODO: support mps ops on torch>=2.1.0
if parse_version(torch.__version__) < parse_version('2.1.0'):
op_files += glob.glob('./mmcv/ops/csrc/common/mps/*.mm') + \
glob.glob('./mmcv/ops/csrc/pytorch/mps/*.mm')
extension = CppExtension
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common'))
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common/mps'))
Expand Down
5 changes: 4 additions & 1 deletion tests/test_ops/test_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import numpy as np
import pytest
import torch
from mmengine.utils import digit_version

from mmcv.utils import (IS_CUDA_AVAILABLE, IS_MLU_AVAILABLE, IS_MPS_AVAILABLE,
IS_NPU_AVAILABLE)
Expand Down Expand Up @@ -56,7 +57,9 @@ def _test_bbox_overlaps(self, device='cpu', dtype=torch.float):
pytest.param(
'mps',
marks=pytest.mark.skipif(
not IS_MPS_AVAILABLE, reason='requires MPS support')),
not IS_MPS_AVAILABLE
or digit_version(torch.__version__) >= digit_version('2.1.0'),
reason='requires MPS support')),
pytest.param(
'npu',
marks=pytest.mark.skipif(
Expand Down
Loading