Unverified Commit cac0c44a authored by q.yao's avatar q.yao Committed by GitHub
Browse files

temporarily disable mps ops for torch2.1.0 (#2958)

parent ea53ed02
......@@ -384,9 +384,11 @@ def get_extensions():
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'))
......
......@@ -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)
......@@ -56,7 +57,9 @@ class TestBBox:
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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment