Skip to content

Commit 7e475fb

Browse files
SW publisherJenkins
authored andcommitted
deepspeed-fork content for 1.15.1
Signed-off-by: SW publisher <sw_publisher@habana-labs.com>
1 parent 7122362 commit 7e475fb

204 files changed

Lines changed: 11874 additions & 743 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
name: check-torchdist
4040
entry: ./scripts/check-torchdist.py
4141
language: python
42-
exclude: ^(deepspeed/comm/|docs/|benchmarks/|scripts/check-torchdist.py|deepspeed/moe/sharded_moe.py|deepspeed/runtime/comm/coalesced_collectives.py|deepspeed/elasticity/elastic_agent.py|deepspeed/launcher/launch.py|tests/unit/comm/test_dist.py)
42+
exclude: ^(deepspeed/comm/|docs/|benchmarks/|scripts/check-torchdist.py|deepspeed/moe/sharded_moe.py|deepspeed/runtime/comm/coalesced_collectives.py|deepspeed/elasticity/elastic_agent.py|deepspeed/launcher/launch.py|tests/unit/comm/test_dist.py|deepspeed/runtime/zero/utils.py|deepspeed/tools/pg_sim/ut/base.py|deepspeed/tools/pg_sim/pg.py)
4343
# Specific deepspeed/ files are excluded for now until we wrap ProcessGroup in deepspeed.comm
4444

4545
- repo: local

accelerator/abstract_accelerator.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ def __init__(self):
1717
def is_synchronized_device(self):
1818
...
1919

20+
@abc.abstractmethod
21+
def use_host_timers(self):
22+
...
23+
24+
@abc.abstractmethod
25+
def resolves_data_dependency(self):
26+
...
27+
28+
@abc.abstractmethod
29+
def handles_memory_backpressure(self):
30+
...
31+
2032
# Device APIs
2133
@abc.abstractmethod
2234
def device_name(self, device_index):
@@ -255,6 +267,11 @@ def create_op_builder(self, class_name):
255267
def get_op_builder(self, class_name):
256268
...
257269

270+
# creates and returns an optimizer, specified by optimizer_name, when the accelerator has its own implementation
271+
@abc.abstractmethod
272+
def get_optimizer(self, optimizer_name, cpu_optimization, model_parameters, **optimizer_parameters):
273+
...
274+
258275
@abc.abstractmethod
259276
def build_extension(self):
260277
...

accelerator/cpu_accelerator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ def __init__(self):
2121
def is_synchronized_device(self):
2222
return True
2323

24+
def use_host_timers(self):
25+
return self.is_synchronized_device()
26+
27+
def resolves_data_dependency(self):
28+
return self.is_synchronized_device()
29+
30+
def handles_memory_backpressure(self):
31+
return self.is_synchronized_device()
32+
2433
# Device APIs
2534
def device_name(self, device_index=None):
2635
return 'cpu'
@@ -280,3 +289,6 @@ def get_op_builder(self, class_name):
280289
def build_extension(self):
281290
from torch.utils.cpp_extension import BuildExtension
282291
return BuildExtension
292+
293+
def get_optimizer(self, optimizer_name, cpu_optimization, model_parameters, **optimizer_parameters):
294+
return None

accelerator/cuda_accelerator.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ def _init_pynvml(self):
4242
def is_synchronized_device(self):
4343
return False
4444

45+
def use_host_timers(self):
46+
return self.is_synchronized_device()
47+
48+
def resolves_data_dependency(self):
49+
return self.is_synchronized_device()
50+
51+
def handles_memory_backpressure(self):
52+
return self.is_synchronized_device()
53+
4554
# Device APIs
4655
def device_name(self, device_index=None):
4756
if device_index == None:
@@ -183,11 +192,7 @@ def is_bf16_supported(self):
183192
return torch.cuda.is_bf16_supported()
184193

185194
def is_fp16_supported(self):
186-
major, _ = torch.cuda.get_device_capability()
187-
if major >= 7:
188-
return True
189-
else:
190-
return False
195+
return True
191196

192197
def supported_dtypes(self):
193198
return [torch.float, torch.half, torch.bfloat16]
@@ -322,3 +327,6 @@ def get_op_builder(self, class_name):
322327
def build_extension(self):
323328
from torch.utils.cpp_extension import BuildExtension
324329
return BuildExtension
330+
331+
def get_optimizer(self, optimizer_name, cpu_optimization, model_parameters, **optimizer_parameters):
332+
return None

0 commit comments

Comments
 (0)