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

[RFC] add device abstraction to allow other device than CUDA be used #2221

Merged
merged 86 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
0a849d5
[device abstraction] add device abstraction to allow other device tha…
delock Aug 16, 2022
e4f40f0
Merge branch '202208-base' into 202208
delock Aug 24, 2022
4a216ea
[rebase-202208] additional changes needed when rebase to 202208
delock Aug 24, 2022
2137642
Merge branch '20220824-base' into 20220824
delock Aug 24, 2022
089657e
[rebase] cleanup direct cuda usage after merge
delock Aug 24, 2022
d5a8424
[precommit] fix pre-commit issues
delock Aug 25, 2022
96d0765
Merge branch 'master' into gma/device-abstraction
tjruwase Aug 30, 2022
ac64c7a
[pin_memory] make pin_memory select device type
delock Sep 1, 2022
02c3a57
Merge branch 'master' into gma/device-abstraction
delock Sep 8, 2022
522b24b
[downstream] merge from xpu support downstream
delock Sep 9, 2022
a3b1e02
Merge branch 'master' into gma/device-abstraction
tjruwase Sep 12, 2022
4557c33
Merge branch 'master' into gma/device-abstraction
tjruwase Sep 13, 2022
2ef7d6c
Merge branch 'up-master' into gma/merge-upstream-20220921
delock Sep 21, 2022
9656321
[device] port cuda device to literal_device() in new tests
delock Sep 21, 2022
65729e3
[accel_runtime] add pin_memory to accelerator runtime interface.
delock Sep 22, 2022
f94d53e
[accelerator abstraction] merge from #2320
delock Sep 26, 2022
6005abe
Merge branch 'up-master' into gma/device-abstraction
delock Sep 26, 2022
31c0997
change call site of literal_device, on_accel_device and accel_runtime…
delock Oct 12, 2022
1785c26
add new interface definition from olruwase/accelerator_abstraction
delock Oct 12, 2022
17203a4
[accelerator abstraction] remove name() from interface, device_name()…
delock Oct 14, 2022
e8daea6
merge with master (ec13da6ba7cabc44bb4745a64a208b8580792954)
delock Oct 14, 2022
cfd23ed
Merge branch 'up-master' into gma/device-abstraction
delock Oct 14, 2022
13bbbdf
[OpBuilder] Add op builder abstraction
delock Oct 23, 2022
06e39a5
Merge branch 'up-master' into gma/device-abstraction
delock Oct 23, 2022
257490f
convert op builder usage in merged code
delock Oct 23, 2022
c93b999
[OpBuilder] add create_op_builder interface in abstract_accelerator.py
delock Oct 23, 2022
9858d42
[OpBuilder] fix op builder usage in tests
delock Oct 23, 2022
68ce006
[OpBuilder] fix <op builder>.NAME usage in tests to follow op builder…
delock Oct 23, 2022
4b62dab
import get_accelerator from deepspeed.accelerator directly
delock Oct 23, 2022
c5b2070
[OpBuilder] remove unused function and sync with main
delock Oct 23, 2022
9532843
add missing get_accelerator import
delock Oct 25, 2022
0729695
fix obsolete name in CPU Adam which should be create_op_builder
delock Oct 25, 2022
be517d8
fix create_op_builder calls
delock Oct 25, 2022
3af870f
fix misuse of new accelerator abstraction interface in tests
delock Oct 25, 2022
8fa64b9
Merge from downstream for bug fixing
delock Oct 28, 2022
4873538
merge from downstream
delock Nov 3, 2022
61b10b0
remove SYCL_KERNEL specific code
delock Nov 4, 2022
457d281
Merge branch 'up-master(9cfcf7431a02a)' into gma/device-abstraction
delock Nov 8, 2022
fea4604
Merge branch 'up-master(6f77da1bae506)' into gma/device-abstraction
delock Nov 10, 2022
f80a907
Merge branch 'up-master(3ca9878d8e92a)' into gma/device-abstraction
delock Nov 10, 2022
3b0b14c
merge from downstream for bugs fixes
delock Nov 10, 2022
b375e46
Merge branch 'up-master(be5ec506bd5219a)' into gma/device-abstraction
delock Nov 11, 2022
18b3c95
fix torch.cuda in new files
delock Nov 11, 2022
97695f5
use OpBuilder name symbol, improve env_report, fix typo, fix get_acce…
delock Nov 13, 2022
93e157b
Merge branch 'master' into gma/device-abstraction
tjruwase Nov 13, 2022
b1c5384
fix missing () in get_accelerator for ds_attention.py
delock Nov 14, 2022
91fb948
import deepspeed.accelerator.get_accelerator only when torch_availabl…
delock Nov 14, 2022
8f89c2b
Merge branch 'up-master' into gma/device-abstraction
delock Dec 1, 2022
26e628d
Change reference of InferenceSpecializedBuilder to name string, Infer…
delock Dec 1, 2022
91f5cb2
convert new code with CUDA references
delock Dec 1, 2022
5a1ae0e
remove unneeded get_accelerator import in op_builder/__init__.py
delock Dec 1, 2022
05842b6
[setup] fix build error when pytorch is not installed in environment
delock Dec 1, 2022
24d2b38
Handle the case when torch is not installed during deepspeed installa…
delock Dec 1, 2022
c26e5d4
Merge branch 'master' into gma/device-abstraction
tjruwase Dec 2, 2022
4116ba5
Merge branch 'up-master' into gma/device-abstraction
delock Jan 8, 2023
bea648f
port new cuda specific code
delock Jan 8, 2023
94253d4
revert changes in __init__.py since new mechanism no longer requires …
delock Jan 8, 2023
2acad48
Merge branch 'up-master' into gma/device-abstraction
delock Jan 27, 2023
77af66a
use old op builder interface
delock Jan 27, 2023
8ec0905
Merge branch 'up-master' into gma/device-abstraction
delock Jan 27, 2023
bd9d275
remove bypass code in set_accelerator_visible
delock Jan 27, 2023
f1e75ff
revert changes in quantizer according to latest op builder interface
delock Jan 27, 2023
9860282
Merge branch 'master' into gma/device-abstraction
delock Jan 30, 2023
c26da46
port additional torch.cuda code in deepspeed
delock Jan 27, 2023
cb46cf4
Merge branch 'master' into gma/device-abstraction
delock Jan 31, 2023
b74a47c
Merge branch 'master' into gma/device-abstraction
delock Feb 3, 2023
6e55729
Merge branch 'master' into gma/device-abstraction
delock Feb 6, 2023
3c186d2
Merge branch 'master' into gma/device-abstraction
delock Feb 7, 2023
667c878
follow comments
delock Feb 9, 2023
d693dad
Merge branch 'up-master' into gma/device-abstraction
delock Feb 9, 2023
7a9e7ea
fix format
delock Feb 9, 2023
538148b
fix new code with cuda specific code
delock Feb 9, 2023
af8cee2
Merge branch 'master' into gma/device-abstraction
delock Feb 11, 2023
3dd816c
Merge branch 'master' into gma/device-abstraction
delock Feb 15, 2023
abf31b6
Merge branch 'master' into gma/device-abstraction
delock Feb 17, 2023
9539def
Merge branch 'master' into gma/device-abstraction
delock Feb 20, 2023
6ac4de4
Merge branch 'master' into gma/device-abstraction
delock Feb 22, 2023
b551304
Merge branch 'master' into gma/device-abstraction
delock Feb 22, 2023
238dc1e
port cuda specific code in module injection
delock Feb 23, 2023
da254d7
Merge branch 'master' into gma/device-abstraction
delock Feb 24, 2023
33ace54
Merge branch 'master' into gma/device-abstraction
delock Feb 26, 2023
3d572bb
Merge branch 'up-master' into gma/device-abstraction
delock Mar 1, 2023
4f9f6c2
add licensing message
delock Mar 1, 2023
e92fd92
Merge branch 'master' into gma/device-abstraction
delock Mar 2, 2023
136ba27
Merge branch 'master' into gma/device-abstraction
tjruwase Mar 7, 2023
9569b46
Merge branch 'master' into gma/device-abstraction
jeffra Mar 7, 2023
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
Prev Previous commit
Next Next commit
import get_accelerator from deepspeed.accelerator directly
  • Loading branch information
delock committed Oct 23, 2022
commit 4b62dab1e2a6f9e6916e41ca094ead8b7345b769
2 changes: 1 addition & 1 deletion benchmarks/communication/all_gather.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

import time

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/all_reduce.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

import time

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/all_to_all.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

import time

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/broadcast.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import torch
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

import time

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

DEFAULT_WARMUPS = 5
DEFAULT_TRIALS = 50
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/pt2pt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

import time

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/communication/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import math
import argparse
from benchmarks.communication.constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

global dist

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/inference/bert-bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import deepspeed
import argparse
from transformers import pipeline
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

parser = argparse.ArgumentParser()
parser.add_argument("--model", "-m", type=str, help="hf model name")
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/inference/gpt-bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import deepspeed
import argparse
from transformers import pipeline
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

parser = argparse.ArgumentParser()
parser.add_argument("--model", "-m", type=str, help="hf model name")
Expand Down
2 changes: 1 addition & 1 deletion csrc/aio/py_test/aio_bench_perf_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from test_ds_aio_utils import refine_integer_value
from perf_sweep_utils import READ_OP_DESC, WRITE_OP_DESC, BENCH_LOG_DIR, \
READ_IO_DIR, WRITE_IO_DIR, READ_LOG_DIR, WRITE_LOG_DIR
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

OTHER_OPTIONS = '--handle'
PERF_SCRIPT = 'test_ds_aio.py'
Expand Down
2 changes: 1 addition & 1 deletion csrc/aio/py_test/ds_aio_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import time
from multiprocessing import Pool, Barrier
from test_ds_aio_utils import report_results, task_log, task_barrier
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


def pre_basic(args, tid, read_op):
Expand Down
2 changes: 1 addition & 1 deletion csrc/aio/py_test/ds_aio_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import time
from multiprocessing import Pool, Barrier
from test_ds_aio_utils import report_results, task_log, task_barrier
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


def pre_handle(args, tid, read_op):
Expand Down
2 changes: 1 addition & 1 deletion csrc/aio/py_test/validate_async_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
assert get_accelerator().create_op_builder("AsyncIOBuilder").is_compatible()
4 changes: 2 additions & 2 deletions deepspeed/accelerator/real_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def set_accelerator(accel_obj):

'''
-----------[code] test_get.py -----------
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
my_accelerator = get_accelerator()
print(f'{my_accelerator._name=}')
print(f'{my_accelerator._communication_backend=}')
Expand All @@ -58,7 +58,7 @@ def set_accelerator(accel_obj):
from deepspeed.accelerator.cuda_accelerator import CUDA_Accelerator
cu_accel = CUDA_Accelerator()
print(f'{id(cu_accel)=}')
from deepspeed.accelerator.real_accelerator import set_accelerator, get_accelerator
from deepspeed.accelerator import set_accelerator, get_accelerator
set_accelerator(cu_accel)

my_accelerator = get_accelerator()
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/autotuning/autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .scheduler import ResourceManager
from .tuner import GridSearchTuner, RandomTuner, ModelBasedTuner
from .utils import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

try:
from tabulate import tabulate
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/comm/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT, default_pg_timeout
from .constants import *
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class ReduceOp(Enum):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/env_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import argparse
from .ops.op_builder import ALL_OPS
from .git_version_info import installed_ops, torch_info
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

GREEN = '\033[92m'
RED = '\033[91m'
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/inference/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ..moe.utils import has_moe_layers
from ..runtime.zero import GatheredParameters
from ..module_inject import LinearAllreduce, LinearLayer, Normalize, ReplaceWithTensorSlicing
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from ..module_inject.replace_policy import DSPolicy

DS_INFERENCE_ENABLED = False
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/launcher/multinode_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import warnings
from shlex import split
from abc import ABC, abstractmethod
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from ..utils import logger
from .constants import PDSH_MAX_FAN_OUT, MVAPICH_TMP_HOSTFILE

Expand Down
2 changes: 1 addition & 1 deletion deepspeed/launcher/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ..utils import logger

from ..autotuning import Autotuner
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

DLTS_HOSTFILE = "/job/hostfile"
EXPORT_ENVS = ['NCCL', 'PYTHON', 'MV2', 'UCX']
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/module_inject/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright 2022 The Microsoft DeepSpeed Team
'''
import torch
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class DSClipEncoder(torch.nn.Module):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/module_inject/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torch.nn import functional as F

from torch.nn.parameter import Parameter
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class LinearAllreduce(nn.Module):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/module_inject/load_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .layers import LinearLayer, Normalize, EmbeddingLayer
import torch
import gc
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


def load_model_with_checkpoint(r_module,
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/module_inject/replace_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tqdm
import deepspeed
import deepspeed.ops.transformer as transformer_inference
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from .replace_policy import HFBertLayerPolicy, HFGPT2LayerPolicy, BLOOMLayerPolicy
from .replace_policy import replace_policies, generic_policies
#from ..runtime.weight_quantizer import WeightQuantization
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/adagrad/cpu_adagrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''

import torch
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from deepspeed.utils.logging import should_log_le


Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/adam/fused_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .multi_tensor_apply import MultiTensorApply

multi_tensor_applier = MultiTensorApply(2048 * 32)
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class FusedAdam(torch.optim.Optimizer):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/lamb/fused_lamb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'''
import types
import torch
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class FusedLamb(torch.optim.Optimizer):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/quantizer/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
import torch

from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

# Cuda modules will be imported if needed
quantizer_cuda_module = None
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/sparse_attention/matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import triton
import triton.language as tl
import triton._C.libtriton as libtriton
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


@triton.jit
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/transformer/inference/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import torch.nn as nn
from packaging import version as pkg_version
from deepspeed.utils.logging import log_dist
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

# Cuda modules will be imported if needed
inference_cuda_module = None
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/transformer/inference/moe_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .transformer_inference import DeepSpeedSelfAttention, DeepSpeedInferenceConfig
from ....moe.sharded_moe import TopKGate
from deepspeed import comm as dist
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class DeepSpeedMoEInferenceConfig(DeepSpeedInferenceConfig):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import torch.nn as nn
from deepspeed import comm as dist
from deepspeed.utils.logging import log_dist
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from deepspeed.utils.types import ActivationFuncType

# Cuda modules will be imported if needed
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/ops/transformer/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch
from torch import nn
from torch.autograd import Function
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

# Cuda modules will be imported if needed
transformer_cuda_module = None
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/profiling/flops_profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List, Optional
from collections import OrderedDict
import numpy as np
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

Tensor = torch.Tensor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from deepspeed.utils import logger
from deepspeed.runtime.utils import copy_to_device, move_to_device, see_memory_usage, bwc_tensor_model_parallel_rank
from deepspeed.utils.timer import SynchronizedWallClockTimer as Timers
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

# DeepSpeed Checkpointing Enabled or Disabled
deepspeed_checkpointing_enabled = False
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/comm/nccl.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

from deepspeed.runtime.compression.cupy import CupyBackend
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class NcclBackend(object):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from torch.utils.data import DataLoader, RandomSampler
from torch.utils.data.distributed import DistributedSampler
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class RepeatingLoader:
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
from deepspeed.profiling.flops_profiler.profiler import FlopsProfiler
from deepspeed.utils.logging import print_json_dist

from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

# Set to torch's distributed package or deepspeed.comm based inside DeepSpeedEngine init
dist = None
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/fp16/fused_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from deepspeed.utils import groups, logger, log_dist
from deepspeed import comm as dist
from deepspeed.checkpoint.constants import OPTIMIZER_STATE_DICT, CLIP_GRAD
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class FP16_Optimizer(DeepSpeedOptimizer):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/fp16/onebit/adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import types
import torch
import numpy as np
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist


Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/fp16/onebit/lamb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from deepspeed import comm as dist
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator


class OnebitLamb(torch.optim.Optimizer):
Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/fp16/onebit/zoadam.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import types
import torch
import numpy as np
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist


Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/fp16/unfused_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from deepspeed.runtime.fp16.loss_scaler import INITIAL_LOSS_SCALE, SCALE_WINDOW, MIN_LOSS_SCALE
from deepspeed.utils import logger
from deepspeed.checkpoint.constants import OPTIMIZER_STATE_DICT
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist


Expand Down
2 changes: 1 addition & 1 deletion deepspeed/runtime/pipe/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from deepspeed.utils import logger
from deepspeed.utils.timer import ThroughputTimer
from deepspeed.accelerator.real_accelerator import get_accelerator
from deepspeed.accelerator import get_accelerator

from ..engine import DeepSpeedEngine, MEMORY_OPT_ALLREDUCE_SIZE
from ..utils import PartitionedTensor
Expand Down
Loading