Skip to content

Commit 7618646

Browse files
authored
Merge pull request #326 from SilasMarvin/silas-redo-build-script
Switched build script
2 parents 0d60d79 + 94e6b10 commit 7618646

File tree

13 files changed

+1010
-301
lines changed

13 files changed

+1010
-301
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ git clone --recursive https://github.com/utilityai/llama-cpp-rs
3535
cd llama-cpp-rs
3636
```
3737

38-
Run the simple example (add `--featues cublas` if you have a cuda gpu)
38+
Run the simple example (add `--featues cuda` if you have a cuda gpu)
3939

4040
```bash
4141
cargo run --release --bin simple "The way to kill a linux process is" hf-model TheBloke/Llama-2-7B-GGUF llama-2-7b.Q4_K_M.gguf

embeddings/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use llama_cpp_2::ggml_time_us;
2020
use llama_cpp_2::llama_backend::LlamaBackend;
2121
use llama_cpp_2::llama_batch::LlamaBatch;
2222
use llama_cpp_2::model::params::LlamaModelParams;
23-
use llama_cpp_2::model::{AddBos, Special};
2423
use llama_cpp_2::model::LlamaModel;
24+
use llama_cpp_2::model::{AddBos, Special};
2525

2626
#[derive(clap::Parser, Debug, Clone)]
2727
struct Args {
@@ -35,7 +35,7 @@ struct Args {
3535
#[clap(short)]
3636
normalise: bool,
3737
/// Disable offloading layers to the gpu
38-
#[cfg(feature = "cublas")]
38+
#[cfg(feature = "cuda")]
3939
#[clap(long)]
4040
disable_gpu: bool,
4141
}
@@ -78,7 +78,7 @@ fn main() -> Result<()> {
7878
model,
7979
prompt,
8080
normalise,
81-
#[cfg(feature = "cublas")]
81+
#[cfg(feature = "cuda")]
8282
disable_gpu,
8383
} = Args::parse();
8484

@@ -87,13 +87,13 @@ fn main() -> Result<()> {
8787

8888
// offload all layers to the gpu
8989
let model_params = {
90-
#[cfg(feature = "cublas")]
90+
#[cfg(feature = "cuda")]
9191
if !disable_gpu {
9292
LlamaModelParams::default().with_n_gpu_layers(1000)
9393
} else {
9494
LlamaModelParams::default()
9595
}
96-
#[cfg(not(feature = "cublas"))]
96+
#[cfg(not(feature = "cuda"))]
9797
LlamaModelParams::default()
9898
};
9999

llama-cpp-2/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ thiserror = { workspace = true }
1414
tracing = { workspace = true }
1515

1616
[features]
17-
cublas = ["llama-cpp-sys-2/cublas"]
17+
cuda = ["llama-cpp-sys-2/cuda"]
1818
metal = ["llama-cpp-sys-2/metal"]
1919
sampler = []
2020

@@ -25,4 +25,4 @@ llama-cpp-sys-2 = { path = "../llama-cpp-sys-2", features=["metal"], version = "
2525
workspace = true
2626

2727
[package.metadata.docs.rs]
28-
features = ["sampler"]
28+
features = ["sampler"]

llama-cpp-2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//!
1212
//! # Feature Flags
1313
//!
14-
//! - `cublas` enables CUDA gpu support.
14+
//! - `cuda` enables CUDA gpu support.
1515
//! - `sampler` adds the [`context::sample::sampler`] struct for a more rusty way of sampling.
1616
use std::ffi::NulError;
1717
use std::fmt::Debug;

llama-cpp-sys-2/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ include = [
4848
[build-dependencies]
4949
bindgen = { workspace = true }
5050
cc = { workspace = true, features = ["parallel"] }
51+
once_cell = "1.19.0"
5152

5253
[features]
53-
cublas = []
54+
cuda = []
5455
metal = []
5556

llama-cpp-sys-2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# llama-cpp-sys
22

3-
Raw bindings to llama.cpp with cublas support.
3+
Raw bindings to llama.cpp with cuda support.
44

5-
See [llama-cpp-2](https://crates.io/crates/llama-cpp-2) for a safe API.
5+
See [llama-cpp-2](https://crates.io/crates/llama-cpp-2) for a safe API.

0 commit comments

Comments
 (0)