From b40fe72e2ff18862d0964134f7412f289fdb58b9 Mon Sep 17 00:00:00 2001 From: 6V <49866079+6Vvv@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:57:19 +0800 Subject: [PATCH] [Fix] Delete version verification of CANN on Ascend NPU (#232) --- mim/commands/install.py | 4 ---- mim/utils/utils.py | 2 +- tests/test_utils.py | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/mim/commands/install.py b/mim/commands/install.py index 717a8a3..b4951cf 100644 --- a/mim/commands/install.py +++ b/mim/commands/install.py @@ -170,10 +170,6 @@ def get_mmcv_full_find_link(mmcv_base_url: str) -> str: if device == 'cuda' and device_v.isdigit(): device_link = f'cu{device_v}' elif device == 'ascend': - if not device_v.isdigit(): - exit_with_error('Unable to install OpenMMLab projects via mim ' - 'on the current Ascend NPU, ' - 'please compile from source code to install.') device_link = f'ascend{device_v}' else: device_link = 'cpu' diff --git a/mim/utils/utils.py b/mim/utils/utils.py index f62c32f..f8c41e1 100644 --- a/mim/utils/utils.py +++ b/mim/utils/utils.py @@ -353,7 +353,7 @@ def get_npu_version() -> str: 'installing OpenMMLab projects on Ascend NPU.' "Please run 'source set_env.sh' in the CANN installation path." )) - npu_version = torch_npu.get_cann_version(ascend_home_path) + npu_version = torch_npu.get_cann_version(ascend_home_path).lower() return npu_version diff --git a/tests/test_utils.py b/tests/test_utils.py index a30b1f9..88a749c 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -45,7 +45,6 @@ def test_get_torch_device_version(): assert torch_v.replace('.', '').isdigit() if is_npu_available(): assert device == 'ascend' - assert device_v.replace('.', '').isdigit() def teardown_module():