fix: remove glog/cuda_ops_api.h dependency from all xllm CUDA kernels
cuda_ops_api.h includes glog/logging.h and ATen/DynamicLibrary.h which are not available in corex standalone compilation. All kernel .cu files only need device_utils.cuh (provides namespace, XLLM_KERNEL_ATTR macro, CUB includes, type helpers). Fixed files: norm.cu, activation.cu, rope.cu, block_copy.cu, reshape_paged_cache.cu moe/moe_combine.cu, moe/moe_compute_index.cu, moe/moe_fused_topk.cu
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "cuda_ops_api.h"
|
|
||||||
#include "device_utils.cuh"
|
#include "device_utils.cuh"
|
||||||
|
|
||||||
// ref to:
|
// ref to:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ limitations under the License.
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "cuda_ops_api.h"
|
#include "device_utils.cuh"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
namespace xllm::kernel::cuda {
|
namespace xllm::kernel::cuda {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ limitations under the License.
|
|||||||
#include <c10/cuda/CUDAGuard.h>
|
#include <c10/cuda/CUDAGuard.h>
|
||||||
|
|
||||||
#include "device_utils.cuh"
|
#include "device_utils.cuh"
|
||||||
#include "kernels/cuda/cuda_ops_api.h"
|
#include "device_utils.cuh"
|
||||||
|
|
||||||
namespace xllm::kernel::cuda {
|
namespace xllm::kernel::cuda {
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <cub/block/block_scan.cuh>
|
#include <cub/block/block_scan.cuh>
|
||||||
|
|
||||||
#include "kernels/cuda/cuda_ops_api.h"
|
#include "device_utils.cuh"
|
||||||
|
|
||||||
namespace xllm::kernel::cuda {
|
namespace xllm::kernel::cuda {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
#if defined(USE_DCU)
|
#if defined(USE_DCU)
|
||||||
#include "kernels/dcu/dcu_ops_api.h"
|
#include "kernels/dcu/dcu_ops_api.h"
|
||||||
#else
|
#else
|
||||||
#include "kernels/cuda/cuda_ops_api.h"
|
#include "device_utils.cuh"
|
||||||
#endif
|
#endif
|
||||||
#include "moe_topk_sigmoid_kernels.cuh"
|
#include "moe_topk_sigmoid_kernels.cuh"
|
||||||
#include "moe_topk_softmax_kernels.cuh"
|
#include "moe_topk_softmax_kernels.cuh"
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ limitations under the License.
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cub/cub.cuh>
|
#include <cub/cub.cuh>
|
||||||
|
|
||||||
#include "cuda_ops_api.h"
|
|
||||||
#include "device_utils.cuh"
|
#include "device_utils.cuh"
|
||||||
#include "fp8_quant_utils.cuh"
|
#include "fp8_quant_utils.cuh"
|
||||||
#include "type_convert.cuh"
|
#include "type_convert.cuh"
|
||||||
@@ -27,14 +26,10 @@ limitations under the License.
|
|||||||
// ref to:
|
// ref to:
|
||||||
// https://github.com/vllm-project/vllm/blob/main/csrc/layernorm_kernels.cu
|
// https://github.com/vllm-project/vllm/blob/main/csrc/layernorm_kernels.cu
|
||||||
|
|
||||||
#if CUB_VERSION >= 200800
|
// corex CUB (CUDA 10.2) — use old-style CUB operators
|
||||||
// corex CUB (CUDA 10.2) — no cuda::std::functional
|
|
||||||
using CubAddOp = cub::Sum;
|
using CubAddOp = cub::Sum;
|
||||||
using CubMaxOp = cub::Max;
|
using CubMaxOp = cub::Max;
|
||||||
#else // if CUB_VERSION < 200800
|
|
||||||
using CubAddOp = cub::Sum;
|
|
||||||
using CubMaxOp = cub::Max;
|
|
||||||
#endif // CUB_VERSION
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <c10/cuda/CUDAStream.h>
|
#include <c10/cuda/CUDAStream.h>
|
||||||
|
|
||||||
#include "cuda_ops_api.h"
|
|
||||||
#include "device_utils.cuh"
|
#include "device_utils.cuh"
|
||||||
|
|
||||||
namespace xllm::kernel::cuda {
|
namespace xllm::kernel::cuda {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#include <c10/cuda/CUDAGuard.h>
|
#include <c10/cuda/CUDAGuard.h>
|
||||||
#include <torch/all.h>
|
#include <torch/all.h>
|
||||||
|
|
||||||
#include "cuda_ops_api.h"
|
|
||||||
#include "device_utils.cuh"
|
#include "device_utils.cuh"
|
||||||
|
|
||||||
// ref to:
|
// ref to:
|
||||||
|
|||||||
Reference in New Issue
Block a user