Skip to content

Commit

Permalink
Change source of CPUAdam for xpu accelerator (#5703)
Browse files Browse the repository at this point in the history
Noted that cpu adam for cuda/cpu accelerator has removed the dependency
of CUDA, we can now use the same source.
  • Loading branch information
Liangliang-Ma authored Jun 28, 2024
1 parent f0e3f01 commit 4b8a4a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 270 deletions.
16 changes: 0 additions & 16 deletions csrc/xpu/adam/cpu_adam.cpp

This file was deleted.

247 changes: 0 additions & 247 deletions csrc/xpu/adam/cpu_adam_impl.cpp

This file was deleted.

12 changes: 5 additions & 7 deletions op_builder/xpu/cpu_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ def absolute_name(self):
return f'deepspeed.ops.adam.{self.NAME}_op'

def sources(self):
if self.build_for_cpu:
return ['csrc/xpu/adam/cpu_adam.cpp', 'csrc/xpu/adam/cpu_adam_impl.cpp']
return ['csrc/adam/cpu_adam.cpp', 'csrc/adam/cpu_adam_impl.cpp']

return [
'csrc/xpu/adam/cpu_adam.cpp', 'csrc/xpu/adam/cpu_adam_impl.cpp',
'csrc/xpu/common/custom_cuda_kernel.dp.cpp'
]
def libraries_args(self):
args = super().libraries_args()
return args

def include_paths(self):
return ['csrc/xpu/includes']
return ['csrc/includes']

0 comments on commit 4b8a4a0

Please sign in to comment.