Skip to content

Commit

Permalink
Npu dev (#2306)
Browse files Browse the repository at this point in the history
* fix autocast bugs on npu
* using scatter_kwargs in mmcv.device.scatter_gather
  • Loading branch information
wangjiangben-hw authored Sep 29, 2022
1 parent 9b0133c commit a043541
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 88 deletions.
25 changes: 0 additions & 25 deletions mmcv/device/npu/_functions.py

This file was deleted.

4 changes: 2 additions & 2 deletions mmcv/device/npu/data_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import torch

from mmcv.device.scatter_gather import scatter_kwargs
from mmcv.parallel import MMDataParallel
from .scatter_gather import scatter_kwargs


def _check_balance(*args, **kwargs):
Expand All @@ -19,7 +19,7 @@ def _check_balance(*args, **kwargs):
# _check_balance function in DataParallel to make initialization pass.
for m in sys.modules:
if m.startswith('torch') or 'mmcv' in m:
if getattr(sys.modules[m], '_check_balance', None) is not None:
if hasattr(sys.modules[m], '_check_balance'):
setattr(sys.modules[m], '_check_balance', _check_balance)


Expand Down
2 changes: 1 addition & 1 deletion mmcv/device/npu/distributed.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) OpenMMLab. All rights reserved.

from mmcv.device.scatter_gather import scatter_kwargs
from mmcv.parallel import MMDistributedDataParallel
from .scatter_gather import scatter_kwargs


class NPUDistributedDataParallel(MMDistributedDataParallel):
Expand Down
60 changes: 0 additions & 60 deletions mmcv/device/npu/scatter_gather.py

This file was deleted.

0 comments on commit a043541

Please sign in to comment.