Skip to content

Commit

Permalink
update llama.cpp + peg cuda architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
LLukas22 committed Jul 17, 2023
1 parent 4254a69 commit a516b49
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions crates/ggml/sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,16 @@ fn enable_cublas(build: &mut cc::Build, out_dir: &Path) {
.arg("--compile")
.arg("-cudart")
.arg("static")
.arg("--generate-code=arch=compute_52,code=[compute_52,sm_52]")
.arg("--generate-code=arch=compute_61,code=[compute_61,sm_61]")
.arg("-D_WINDOWS")
.arg("-DNDEBUG")
.arg("-DGGML_USE_CUBLAS")
.arg("-D_CRT_SECURE_NO_WARNINGS")
.arg("-D_MBCS")
.arg("-DWIN32")
.arg(r"-Illama-cpp\include\ggml")
.arg(r"-Illama-cpp\include\ggml")
.arg(r"llama-cpp\ggml-cuda.cu")
.status()
.unwrap_or_else(|_| panic!("{}", get_error_message()));
Expand All @@ -358,6 +361,8 @@ fn enable_cublas(build: &mut cc::Build, out_dir: &Path) {
.arg("-Illama-cpp/include/ggml")
.arg("-mtune=native")
.arg("-pthread")
.arg("--generate-code=arch=compute_52,code=[compute_52,sm_52]")
.arg("--generate-code=arch=compute_61,code=[compute_61,sm_61]")
.arg("-DGGML_USE_CUBLAS")
.arg("-I/usr/local/cuda/include")
.arg("-I/opt/cuda/include")
Expand Down
12 changes: 12 additions & 0 deletions crates/ggml/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,18 @@ extern "C" {
n_ctx: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
}
extern "C" {
pub fn ggml_rope_custom_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
n_past: ::std::os::raw::c_int,
n_dims: ::std::os::raw::c_int,
mode: ::std::os::raw::c_int,
freq_base: f32,
freq_scale: f32,
n_ctx: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
}
extern "C" {
pub fn ggml_rope_back(
ctx: *mut ggml_context,
Expand Down

0 comments on commit a516b49

Please sign in to comment.