refactor: 统一硬件相关头文件引用

将分散在各文件中的CUDA/HIP/MUSA硬件相关头文件引用统一到vendors目录下的对应头文件中,提高代码可维护性。移除重复的头文件引用,优化构建配置。
This commit is contained in:
2026-01-20 10:14:31 +08:00
parent 5aef6c175a
commit 2bd9bd4cc2
98 changed files with 1757 additions and 1286 deletions

View File

@@ -17,9 +17,7 @@
* limitations under the License.
*/
#include <torch/all.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include "../vendors/functions.h"
#include <algorithm>
#include "attention_dtypes.h"
@@ -27,9 +25,7 @@
#include "../cuda_compat.h"
#ifdef USE_ROCM
#include <hip/hip_bf16.h>
#include "../quantization/w8a8/fp8/amd/quant_utils.cuh"
typedef __hip_bfloat16 __nv_bfloat16;
#else
#include "../quantization/w8a8/fp8/nvidia/quant_utils.cuh"
#endif

View File

@@ -23,16 +23,8 @@
#include "attention_generic.cuh"
#include "dtype_float32.cuh"
#ifndef USE_ROCM
#include <cuda_bf16.h>
#include <cuda_fp16.h>
#else
#include <hip/hip_bf16.h>
#include <hip/hip_fp16.h>
typedef __hip_bfloat162 __nv_bfloat162;
typedef __hip_bfloat16 __nv_bfloat16;
#endif
#include "../vendors/functions.h"
#include <stdint.h>

View File

@@ -23,9 +23,7 @@
#include "attention_generic.cuh"
#include "dtype_float32.cuh"
#ifdef USE_ROCM
#include <hip/hip_fp16.h>
#endif
#include "../vendors/functions.h"
#include <stdint.h>

View File

@@ -3,11 +3,7 @@
#include "attention_generic.cuh"
#include <stdint.h>
#ifdef ENABLE_FP8
#ifndef USE_ROCM
#include <cuda_fp8.h>
#endif // USE_ROCM
#endif // ENABLE_FP8
#include "../vendors/functions.h"
namespace vllm {

View File

@@ -1,7 +1,5 @@
#include <optional>
#include <torch/all.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include "../vendors/functions.h"
#include <algorithm>
#include "attention_dtypes.h"

View File

@@ -3,9 +3,7 @@
#include <assert.h>
#include <cuda.h>
#include <torch/all.h>
#include "../vendors/functions.h"
__device__ int64_t save_blocks(int* block_offset, int64_t range_start,
int64_t range_end, int64_t block_size,