Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/kuiper/include",
"/usr/local/cuda/include",
"/usr/include/c++/**",
"/usr/include"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "/home/tangjin/KuiperLLama/build/demo/llama_infer", // 可执行文件路径
"args": [], // 可选参数
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb", // 调试器路径,可以是gdb或lldb
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build", // 构建任务名称, 可选
"internalConsoleOptions": "openOnSessionStart"
}
]
}
118 changes: 118 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

{

"files.associations": {
"cctype": "cpp",
"cmath": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdint": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"random": "cpp",
"ratio": "cpp",
"string": "cpp",
"string_view": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"__nullptr": "cpp",
"iostream": "cpp",
"cstdarg": "cpp",
"clocale": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"fstream": "cpp",
"iomanip": "cpp",
"mutex": "cpp",
"numbers": "cpp",
"numeric": "cpp",
"optional": "cpp",
"semaphore": "cpp",
"stop_token": "cpp",
"system_error": "cpp",
"typeindex": "cpp",
"variant": "cpp",
"filesystem": "cpp",
"any": "cpp",
"regex": "cpp",
"unordered_set": "cpp",
"*.inc": "cpp",
"*.ipp": "cpp",
"span": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"queue": "cpp",
"stack": "cpp",
"shared_mutex": "cpp",
"__mutex_base": "cpp",
"valarray": "cpp",
"__hash_table": "cpp",
"__tree": "cpp",
"__locale": "cpp",
"__string": "cpp",
"forward_list": "cpp",
"__bit_reference": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"strstream": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"codecvt": "cpp",
"source_location": "cpp",
"future": "cpp",
"barrier": "cpp",
"charconv": "cpp",
"coroutine": "cpp",
"cuchar": "cpp",
"latch": "cpp",
"scoped_allocator": "cpp",
"syncstream": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"__config": "cpp",
"__tuple": "cpp",
"ios": "cpp"
},
"C_Cpp.errorSquiggles": "disabled",
"window.zoomLevel": 3,
"window.zoomPerWindow": false,
"testMate.cpp.test.executables": "/home/tangjin/KuiperLLama/build/*/*",
"testMate.cpp.test.workingDirectory": "${absDirpath}",
"cmake.ctest.testExplorerIntegrationEnabled": true
}
16 changes: 16 additions & 0 deletions .vscode/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cmake",
"label": "build",
"command": "build",
"targets": [
"all"
],
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
}
]
}
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ find_package(Armadillo REQUIRED)
aux_source_directory(kuiper/source/tensor/ DIR_TENSOR)
aux_source_directory(kuiper/source/base/ DIR_BASE)
aux_source_directory(kuiper/source/op/ DIR_OP)
aux_source_directory(kuiper/source/model/ DIR_MODEL)
file(GLOB DIR_MODEL CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/kuiper/source/model/*.cpp")
list(REMOVE_ITEM DIR_MODEL "${CMAKE_CURRENT_SOURCE_DIR}/kuiper/source/model/model_paged.cpp")
aux_source_directory(kuiper/source/op/kernels/cpu DIR_KERNEL_CPU)
aux_source_directory(kuiper/source/op/kernels/cuda DIR_KERNEL_CUDA)
aux_source_directory(kuiper/source/op/kernels/ DIR_KERNEL)
Expand Down
33 changes: 33 additions & 0 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,39 @@ if (LLAMA3_SUPPORT)
endif ()
set_target_properties(llama_infer PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

add_executable(llama_infer_paged mainpaged.cpp)
target_link_directories(llama_infer_paged PUBLIC ${PROJECT_SOURCE_DIR}/lib)
target_link_libraries(llama_infer_paged llama)
if (LLAMA3_SUPPORT)
find_package(absl REQUIRED)
find_package(re2 REQUIRED)
find_package(nlohmann_json REQUIRED)
target_link_libraries(llama_infer_paged absl::base re2::re2 nlohmann_json::nlohmann_json)
endif ()
set_target_properties(llama_infer_paged PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

add_executable(llama_infer_unified main_unified.cpp)
target_link_directories(llama_infer_unified PUBLIC ${PROJECT_SOURCE_DIR}/lib)
target_link_libraries(llama_infer_unified llama)
if (LLAMA3_SUPPORT)
find_package(absl REQUIRED)
find_package(re2 REQUIRED)
find_package(nlohmann_json REQUIRED)
target_link_libraries(llama_infer_unified absl::base re2::re2 nlohmann_json::nlohmann_json)
endif ()
set_target_properties(llama_infer_unified PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

add_executable(llama_infer_continuous main_continuous.cpp)
target_link_directories(llama_infer_continuous PUBLIC ${PROJECT_SOURCE_DIR}/lib)
target_link_libraries(llama_infer_continuous llama)
if (LLAMA3_SUPPORT)
find_package(absl REQUIRED)
find_package(re2 REQUIRED)
find_package(nlohmann_json REQUIRED)
target_link_libraries(llama_infer_continuous absl::base re2::re2 nlohmann_json::nlohmann_json)
endif ()
set_target_properties(llama_infer_continuous PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

if (QWEN2_SUPPORT)
message(STATUS "LINK QWEN2 SUPPORT")
add_executable(qwen_infer main_qwen.cpp)
Expand Down
Loading