Skip to content

Commit 6b0f923

Browse files
committed
Change cublas to cuda
1 parent 76e5753 commit 6b0f923

File tree

11 files changed

+24
-23
lines changed

11 files changed

+24
-23
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ cc = { workspace = true, features = ["parallel"] }
5151
once_cell = "1.19.0"
5252

5353
[features]
54-
cublas = []
54+
cuda = []
5555
metal = []
5656

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.

llama-cpp-sys-2/llama.cpp

simple/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ anyhow = { workspace = true }
1313
encoding_rs = { workspace = true }
1414

1515
[features]
16-
cublas = ["llama-cpp-2/cublas"]
16+
cuda = ["llama-cpp-2/cuda"]
1717
metal = ["llama-cpp-2/metal"]
1818

1919
[lints]

simple/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use llama_cpp_2::llama_backend::LlamaBackend;
1515
use llama_cpp_2::llama_batch::LlamaBatch;
1616
use llama_cpp_2::model::params::kv_overrides::ParamOverrideValue;
1717
use llama_cpp_2::model::params::LlamaModelParams;
18-
use llama_cpp_2::model::{AddBos, Special};
1918
use llama_cpp_2::model::LlamaModel;
19+
use llama_cpp_2::model::{AddBos, Special};
2020
use llama_cpp_2::token::data_array::LlamaTokenDataArray;
2121
use std::ffi::CString;
2222
use std::io::Write;
@@ -44,7 +44,7 @@ struct Args {
4444
#[arg(short = 'o', value_parser = parse_key_val)]
4545
key_value_overrides: Vec<(String, ParamOverrideValue)>,
4646
/// Disable offloading layers to the gpu
47-
#[cfg(feature = "cublas")]
47+
#[cfg(feature = "cuda")]
4848
#[clap(long)]
4949
disable_gpu: bool,
5050
#[arg(short = 's', long, help = "RNG seed (default: 1234)")]
@@ -123,7 +123,7 @@ fn main() -> Result<()> {
123123
model,
124124
prompt,
125125
file,
126-
#[cfg(feature = "cublas")]
126+
#[cfg(feature = "cuda")]
127127
disable_gpu,
128128
key_value_overrides,
129129
seed,
@@ -137,13 +137,13 @@ fn main() -> Result<()> {
137137

138138
// offload all layers to the gpu
139139
let model_params = {
140-
#[cfg(feature = "cublas")]
140+
#[cfg(feature = "cuda")]
141141
if !disable_gpu {
142142
LlamaModelParams::default().with_n_gpu_layers(1000)
143143
} else {
144144
LlamaModelParams::default()
145145
}
146-
#[cfg(not(feature = "cublas"))]
146+
#[cfg(not(feature = "cuda"))]
147147
LlamaModelParams::default()
148148
};
149149

0 commit comments

Comments
 (0)