mirror of
https://github.com/RYDE-WORK/ktransformers.git
synced 2026-02-02 04:28:01 +08:00
Fix missing macro definition for KTRANSFORMERS_USE_CUDA and <chrono> includes on MSVC
This commit is contained in:
parent
eb039b723d
commit
706e69f4fc
@ -209,6 +209,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/llama.cpp ${CMAKE
|
|||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party)
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
include_directories("$ENV{CUDA_PATH}/include")
|
include_directories("$ENV{CUDA_PATH}/include")
|
||||||
|
add_compile_definitions(KTRANSFORMERS_USE_CUDA=1)
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
if (KTRANSFORMERS_USE_CUDA)
|
if (KTRANSFORMERS_USE_CUDA)
|
||||||
find_package(CUDA REQUIRED)
|
find_package(CUDA REQUIRED)
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "kvcache.h"
|
#include "kvcache.h"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
void KVCache::attention_kvhead_(const uint16_t *q_in_data, ggml_fp16_t *output,
|
void KVCache::attention_kvhead_(const uint16_t *q_in_data, ggml_fp16_t *output,
|
||||||
float *attn_lse, int batch_size,
|
float *attn_lse, int batch_size,
|
||||||
Backend *backend) {
|
Backend *backend) {
|
||||||
|
|||||||
@ -9,6 +9,9 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
#include "kvcache.h"
|
#include "kvcache.h"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
void KVCache::load_kvcache(std::string tensor_file_path, Backend *backend) {
|
void KVCache::load_kvcache(std::string tensor_file_path, Backend *backend) {
|
||||||
// Timer start
|
// Timer start
|
||||||
auto start = std::chrono::high_resolution_clock::now();
|
auto start = std::chrono::high_resolution_clock::now();
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "kvcache.h"
|
#include "kvcache.h"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
void KVCache::get_anchor_one_block(ggml_fp16_t *anchor, int layer_id,
|
void KVCache::get_anchor_one_block(ggml_fp16_t *anchor, int layer_id,
|
||||||
int block_idx, Backend *backend) {
|
int block_idx, Backend *backend) {
|
||||||
// Timer start
|
// Timer start
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "kvcache.h"
|
#include "kvcache.h"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
std::string ggml_type_to_string(ggml_type type) {
|
std::string ggml_type_to_string(ggml_type type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GGML_TYPE_F32:
|
case GGML_TYPE_F32:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user