Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ox696c
ktransformers
Commits
706e69f4
Commit
706e69f4
authored
Feb 24, 2025
by
akemimadoka
Browse files
Fix missing macro definition for KTRANSFORMERS_USE_CUDA and <chrono> includes on MSVC
parent
eb039b72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
0 deletions
+10
-0
ktransformers/ktransformers_ext/CMakeLists.txt
ktransformers/ktransformers_ext/CMakeLists.txt
+1
-0
ktransformers/ktransformers_ext/operators/kvcache/kvcache_attn.cpp
...mers/ktransformers_ext/operators/kvcache/kvcache_attn.cpp
+2
-0
ktransformers/ktransformers_ext/operators/kvcache/kvcache_load_dump.cpp
...ktransformers_ext/operators/kvcache/kvcache_load_dump.cpp
+3
-0
ktransformers/ktransformers_ext/operators/kvcache/kvcache_read_write.cpp
...transformers_ext/operators/kvcache/kvcache_read_write.cpp
+2
-0
ktransformers/ktransformers_ext/operators/kvcache/kvcache_utils.cpp
...ers/ktransformers_ext/operators/kvcache/kvcache_utils.cpp
+2
-0
No files found.
ktransformers/ktransformers_ext/CMakeLists.txt
View file @
706e69f4
...
@@ -209,6 +209,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/llama.cpp ${CMAKE
...
@@ -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
)
...
...
ktransformers/ktransformers_ext/operators/kvcache/kvcache_attn.cpp
View file @
706e69f4
...
@@ -10,6 +10,8 @@
...
@@ -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
)
{
...
...
ktransformers/ktransformers_ext/operators/kvcache/kvcache_load_dump.cpp
View file @
706e69f4
...
@@ -9,6 +9,9 @@
...
@@ -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
();
...
...
ktransformers/ktransformers_ext/operators/kvcache/kvcache_read_write.cpp
View file @
706e69f4
...
@@ -10,6 +10,8 @@
...
@@ -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
...
...
ktransformers/ktransformers_ext/operators/kvcache/kvcache_utils.cpp
View file @
706e69f4
...
@@ -10,6 +10,8 @@
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment