Browse Source

refactor code

pull/5445/head
xs_courtesy 9 months ago
parent
commit
095c070a6e
  1. 2
      extensions/cpu_adam/cpu_adam_x86.py
  2. 0
      extensions/csrc/cuda/compat.h
  3. 0
      extensions/csrc/cuda/layer_norm_kernel.cu
  4. 0
      extensions/csrc/cuda/moe_kernel.cu
  5. 0
      extensions/csrc/cuda/multi_tensor_adam_kernel.cu
  6. 0
      extensions/csrc/cuda/multi_tensor_lamb_kernel.cu
  7. 0
      extensions/csrc/cuda/pybind/inference.cpp
  8. 0
      extensions/csrc/cuda/pybind/layer_norm.cpp
  9. 0
      extensions/csrc/cuda/pybind/moe.cpp
  10. 0
      extensions/csrc/cuda/pybind/optimizer.cpp
  11. 0
      extensions/csrc/cuda/pybind/scaled_masked_softmax.cpp
  12. 0
      extensions/csrc/cuda/pybind/scaled_upper_triang_masked_softmax.cpp
  13. 2
      extensions/csrc/cuda/rms_layernorm_kernel.cu
  14. 0
      extensions/csrc/cuda/scaled_masked_softmax_kernel.cu
  15. 0
      extensions/csrc/cuda/scaled_upper_triang_masked_softmax_kernel.cu
  16. 0
      extensions/csrc/x86/cpu_adam.cpp
  17. 0
      extensions/csrc/x86/cpu_adam.h
  18. 2
      extensions/inference/inference_ops_cuda.py
  19. 2
      extensions/layernorm/layernorm_cuda.py
  20. 2
      extensions/moe/moe_cuda.py
  21. 6
      extensions/optimizer/fused_optimizer_cuda.py
  22. 2
      extensions/softmax/scaled_masked_softmax_cuda.py
  23. 4
      extensions/softmax/scaled_upper_triangle_masked_softmax_cuda.py

2
extensions/cpu_adam/cpu_adam_x86.py

@ -21,7 +21,7 @@ class CpuAdamX86Extension(_CudaExtension):
# necessary 4 functions
def sources_files(self):
ret = [
self.csrc_abs_path("cuda/cpu_adam.cpp"),
self.csrc_abs_path("x86/cpu_adam.cpp"),
]
return ret

0
extensions/csrc/cuda/compat.h

0
extensions/csrc/cuda/layer_norm_cuda_kernel.cu → extensions/csrc/cuda/layer_norm_kernel.cu

0
extensions/csrc/cuda/moe_cuda_kernel.cu → extensions/csrc/cuda/moe_kernel.cu

0
extensions/csrc/cuda/multi_tensor_adam.cu → extensions/csrc/cuda/multi_tensor_adam_kernel.cu

0
extensions/csrc/cuda/multi_tensor_lamb.cu → extensions/csrc/cuda/multi_tensor_lamb_kernel.cu

0
extensions/csrc/cuda/colossal_inference_C_frontend.cpp → extensions/csrc/cuda/pybind/inference.cpp

0
extensions/csrc/cuda/layer_norm_cuda.cpp → extensions/csrc/cuda/pybind/layer_norm.cpp

0
extensions/csrc/cuda/moe_cuda.cpp → extensions/csrc/cuda/pybind/moe.cpp

0
extensions/csrc/cuda/colossal_C_frontend.cpp → extensions/csrc/cuda/pybind/optimizer.cpp

0
extensions/csrc/cuda/scaled_masked_softmax.cpp → extensions/csrc/cuda/pybind/scaled_masked_softmax.cpp

0
extensions/csrc/cuda/scaled_upper_triang_masked_softmax.cpp → extensions/csrc/cuda/pybind/scaled_upper_triang_masked_softmax.cpp

2
extensions/csrc/cuda/rms_layernorm_kernel.cu

@ -9,7 +9,7 @@
#include "block_reduce.h"
#include "type_shim.h"
#include "../common/micros.h"
template<typename scalar_t>
__global__ void rms_layernorm_kernel(

0
extensions/csrc/cuda/scaled_masked_softmax_cuda.cu → extensions/csrc/cuda/scaled_masked_softmax_kernel.cu

0
extensions/csrc/cuda/scaled_upper_triang_masked_softmax_cuda.cu → extensions/csrc/cuda/scaled_upper_triang_masked_softmax_kernel.cu

0
extensions/csrc/cuda/cpu_adam.cpp → extensions/csrc/x86/cpu_adam.cpp

0
extensions/csrc/cuda/cpu_adam.h → extensions/csrc/x86/cpu_adam.h

2
extensions/inference/inference_ops_cuda.py

@ -10,7 +10,7 @@ class InferenceOpsCudaExtension(_CudaExtension):
ret = [
self.csrc_abs_path(fname)
for fname in [
"cuda/colossal_inference_C_frontend.cpp",
"cuda/pybind/inference.cpp",
"cuda/decode_kv_cache_memcpy_kernel.cu",
"cuda/activation_kernel.cu",
"cuda/rms_layernorm_kernel.cu",

2
extensions/layernorm/layernorm_cuda.py

@ -7,7 +7,7 @@ class LayerNormCudaExtension(_CudaExtension):
super().__init__(name="layernorm_cuda")
def sources_files(self):
ret = [self.csrc_abs_path(fname) for fname in ["cuda/layer_norm_cuda.cpp", "cuda/layer_norm_cuda_kernel.cu"]]
ret = [self.csrc_abs_path(fname) for fname in ["cuda/pybind/layer_norm.cpp", "cuda/layer_norm_kernel.cu"]]
return ret
def include_dirs(self):

2
extensions/moe/moe_cuda.py

@ -11,7 +11,7 @@ class MoeCudaExtension(_CudaExtension):
return ret
def sources_files(self):
ret = [self.csrc_abs_path(fname) for fname in ["cuda/moe_cuda.cpp", "cuda/moe_cuda_kernel.cu"]]
ret = [self.csrc_abs_path(fname) for fname in ["cuda/moe.cpp", "cuda/moe_kernel.cu"]]
return ret
def cxx_flags(self):

6
extensions/optimizer/fused_optimizer_cuda.py

@ -10,12 +10,12 @@ class FusedOptimizerCudaExtension(_CudaExtension):
ret = [
self.csrc_abs_path(fname)
for fname in [
"cuda/colossal_C_frontend.cpp",
"cuda/pybind/optimizer.cpp",
"cuda/multi_tensor_sgd_kernel.cu",
"cuda/multi_tensor_scale_kernel.cu",
"cuda/multi_tensor_adam.cu",
"cuda/multi_tensor_adam_kernel.cu",
"cuda/multi_tensor_l2norm_kernel.cu",
"cuda/multi_tensor_lamb.cu",
"cuda/multi_tensor_lamb_kernel.cu",
]
]
return ret

2
extensions/softmax/scaled_masked_softmax_cuda.py

@ -9,7 +9,7 @@ class ScaledMaskedSoftmaxCudaExtension(_CudaExtension):
def sources_files(self):
ret = [
self.csrc_abs_path(fname)
for fname in ["cuda/scaled_masked_softmax.cpp", "cuda/scaled_masked_softmax_cuda.cu"]
for fname in ["cuda/pybind/scaled_masked_softmax.cpp", "cuda/scaled_masked_softmax_kernel.cu"]
]
return ret

4
extensions/softmax/scaled_upper_triangle_masked_softmax_cuda.py

@ -13,8 +13,8 @@ class ScaledUpperTriangleMaskedSoftmaxCudaExtension(_CudaExtension):
ret = [
self.csrc_abs_path(fname)
for fname in [
"cuda/scaled_upper_triang_masked_softmax.cpp",
"cuda/scaled_upper_triang_masked_softmax_cuda.cu",
"cuda/pybind/scaled_upper_triang_masked_softmax.cpp",
"cuda/scaled_upper_triang_masked_softmax_kernel.cu",
]
]
return ret

Loading…
Cancel
Save