Skip to content

Commit

Permalink
Pulled build improvements from TabbyML#902
Browse files Browse the repository at this point in the history
  • Loading branch information
cromefire committed Dec 10, 2023
1 parent 5b0816c commit 1be9c1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions crates/llama-cpp-bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() {
println!("cargo:rustc-link-lib=cublasLt");
}
if cfg!(feature = "rocm") {
let amd_gpu_targets: Vec<&str> = vec![
let amd_gpu_default_targets: Vec<&str> = vec![
"gfx803",
"gfx900",
"gfx906:xnack-",
Expand All @@ -51,6 +51,8 @@ fn main() {
"gfx1102",
"gfx1103",
];
let amd_gpu_targets =
env::var("AMDGPU_TARGETS").unwrap_or(amd_gpu_default_targets.join(";"));

let rocm_root = env::var("ROCM_ROOT").unwrap_or("/opt/rocm".to_string());
config.define("LLAMA_HIPBLAS", "ON");
Expand All @@ -59,7 +61,7 @@ fn main() {
"CMAKE_CXX_COMPILER",
format!("{}/llvm/bin/clang++", rocm_root),
);
config.define("AMDGPU_TARGETS", amd_gpu_targets.join(";"));
config.define("AMDGPU_TARGETS", amd_gpu_targets);
println!("cargo:rustc-link-arg=-Wl,--copy-dt-needed-entries");
println!("cargo:rustc-link-search=native={}/hip/lib", rocm_root);
println!("cargo:rustc-link-search=native={}/rocblas/lib", rocm_root);
Expand All @@ -74,8 +76,8 @@ fn main() {

cxx_build::bridge("src/lib.rs")
.file("src/engine.cc")
.flag_if_supported("-Iinclude")
.flag_if_supported("-Illama.cpp")
.include("include")
.include("llama.cpp")
.flag_if_supported("-std=c++14")
.compile("cxxbridge");
}
2 changes: 1 addition & 1 deletion crates/llama-cpp-bindings/src/llama.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl LlamaServiceImpl {
};

for ffi::StepOutput { request_id, text } in result {
let mut stopped = false;
let mut stopped;
let LlamaRunningRequest { tx, stop_condition } =
self.requests.get_mut(&request_id).unwrap();

Expand Down

0 comments on commit 1be9c1e

Please sign in to comment.