mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2025-10-20 23:53:48 +08:00
### Description This PR includes Cambricon MLU accelerator support. With this PR, DeepSpeed supports MLU as backend for training and inference tasks. --------- Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
29 lines
669 B
Python
29 lines
669 B
Python
# Copyright (c) Microsoft Corporation.
|
|
# Copyright (c) 2024 Cambricon Corporation.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# DeepSpeed Team
|
|
|
|
from .builder import MLUOpBuilder
|
|
|
|
|
|
class CPUAdamBuilder(MLUOpBuilder):
|
|
BUILD_VAR = "DS_BUILD_CPU_ADAM"
|
|
NAME = "cpu_adam"
|
|
|
|
def __init__(self):
|
|
super().__init__(name=self.NAME)
|
|
|
|
def absolute_name(self):
|
|
return f'deepspeed.ops.adam.{self.NAME}_op'
|
|
|
|
def sources(self):
|
|
return ['csrc/adam/cpu_adam.cpp', 'csrc/adam/cpu_adam_impl.cpp']
|
|
|
|
def libraries_args(self):
|
|
args = super().libraries_args()
|
|
return args
|
|
|
|
def include_paths(self):
|
|
return ['csrc/includes']
|