Skip to content

Commit 540f4e0

Browse files
committed
Merge remote-tracking branch 'upstream/concedo'
2 parents 2c3b46f + eda663f commit 540f4e0

File tree

16 files changed

+78
-36
lines changed

16 files changed

+78
-36
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ set(LLAMA_CUDA_DMMV_X "32" CACHE STRING "llama: x stride for dmmv CUDA kern
4646
set(LLAMA_CUDA_DMMV_Y "1" CACHE STRING "llama: y block size for dmmv CUDA kernels")
4747
option(LLAMA_CUDA_DMMV_F16 "llama: use 16 bit floats for dmmv CUDA kernels" OFF)
4848
set(LLAMA_CUDA_KQUANTS_ITER "2" CACHE STRING "llama: iters./thread per block for Q2_K/Q6_K")
49-
option(LLAMA_HIPBLAS "llama: use hipBLAS" OFF)
49+
option(LLAMA_HIPBLAS "llama: use hipBLAS" ON)
5050
option(LLAMA_K_QUANTS "llama: use k-quants" ON)
5151

5252

@@ -339,4 +339,3 @@ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp_cublas")
339339
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
340340
target_link_libraries(${TARGET} PUBLIC ggml ggml_v1 ggml_v2 common2 gpttype_adapter ${CMAKE_THREAD_LIBS_INIT})
341341
target_compile_features(${TARGET} PRIVATE cxx_std_11)
342-

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif
4242

4343
# keep standard at C11 and C++11
4444
CFLAGS = -I. -I./include -I./include/CL -I./otherarch -I./otherarch/tools -Ofast -DNDEBUG -std=c11 -fPIC -DGGML_USE_K_QUANTS
45-
CXXFLAGS = -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC
45+
CXXFLAGS = -I. -I./examples -I./include -I./include/CL -I./otherarch -I./otherarch/tools -O3 -DNDEBUG -std=c++11 -fPIC -DGGML_USE_K_QUANTS
4646
LDFLAGS =
4747

4848
# these are used on windows, to build some libraries with extra old device compatibility
@@ -53,7 +53,11 @@ NONECFLAGS =
5353
OPENBLAS_FLAGS = -DGGML_USE_OPENBLAS -I/usr/local/include/openblas
5454
CLBLAST_FLAGS = -DGGML_USE_CLBLAST
5555
FAILSAFE_FLAGS = -DUSE_FAILSAFE
56-
CUBLAS_FLAGS = -DGGML_USE_CUBLAS
56+
ifdef LLAMA_CUBLAS
57+
CUBLAS_FLAGS = -DGGML_USE_CUBLAS
58+
else
59+
CUBLAS_FLAGS =
60+
endif
5761
CUBLASLD_FLAGS =
5862
CUBLAS_OBJS =
5963

examples/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
110110
invalid_param = true;
111111
break;
112112
}
113-
params.seed = std::stoi(argv[i]);
113+
params.seed = std::stoul(argv[i]);
114114
} else if (arg == "-t" || arg == "--threads") {
115115
if (++i >= argc) {
116116
invalid_param = true;

examples/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
int32_t get_num_physical_cores();
2323

2424
struct gpt_params {
25-
int32_t seed = -1; // RNG seed
25+
uint32_t seed = -1; // RNG seed
2626
int32_t n_threads = get_num_physical_cores();
2727
int32_t n_predict = -1; // new tokens to predict
2828
int32_t n_ctx = 512; // context size

examples/embedding/embedding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ int main(int argc, char ** argv) {
2424

2525
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
2626

27-
if (params.seed < 0) {
27+
if (params.seed == LLAMA_DEFAULT_SEED) {
2828
params.seed = time(NULL);
2929
}
3030

31-
fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
31+
fprintf(stderr, "%s: seed = %u\n", __func__, params.seed);
3232

3333
std::mt19937 rng(params.seed);
3434
if (params.random_prompt) {

examples/main/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Example usage: `--logit-bias 29905-inf`
242242

243243
### RNG Seed
244244

245-
- `-s SEED, --seed SEED`: Set the random number generator (RNG) seed (default: -1, < 0 = random seed).
245+
- `-s SEED, --seed SEED`: Set the random number generator (RNG) seed (default: -1, -1 = random seed).
246246

247247
The RNG seed is used to initialize the random number generator that influences the text generation process. By setting a specific seed value, you can obtain consistent and reproducible results across multiple runs with the same input and settings. This can be helpful for testing, debugging, or comparing the effects of different options on the generated text to see when they diverge. If the seed is set to a value less than 0, a random seed will be used, which will result in different outputs on each run.
248248

examples/main/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ int main(int argc, char ** argv) {
9494

9595
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
9696

97-
if (params.seed < 0) {
97+
if (params.seed == LLAMA_DEFAULT_SEED) {
9898
params.seed = time(NULL);
9999
}
100100

101-
fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
101+
fprintf(stderr, "%s: seed = %u\n", __func__, params.seed);
102102

103103
std::mt19937 rng(params.seed);
104104
if (params.random_prompt) {

examples/perplexity/perplexity.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ int main(int argc, char ** argv) {
136136

137137
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
138138

139-
if (params.seed < 0) {
139+
if (params.seed == LLAMA_DEFAULT_SEED) {
140140
params.seed = time(NULL);
141141
}
142142

143-
fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
143+
fprintf(stderr, "%s: seed = %u\n", __func__, params.seed);
144144

145145
std::mt19937 rng(params.seed);
146146
if (params.random_prompt) {

examples/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ node .
152152

153153
`mirostat_eta`: Set the Mirostat learning rate, parameter eta (default: 0.1).
154154

155-
`seed`: Set the random number generator (RNG) seed (default: -1, < 0 = random seed).
155+
`seed`: Set the random number generator (RNG) seed (default: -1, -1 = random seed).
156156

157157
`ignore_eos`: Ignore end of stream token and continue generating (default: false).
158158

examples/train-text-from-scratch/train-text-from-scratch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,7 +2768,7 @@ void train_print_usage(int /*argc*/, char ** argv, const struct train_params * p
27682768
fprintf(stderr, " --checkpoint-in FNAME path from which to load training checkpoint (default '%s')\n", params->fn_checkpoint_in);
27692769
fprintf(stderr, " --checkpoint-out FNAME path to save training checkpoint (default '%s')\n", params->fn_checkpoint_out);
27702770
fprintf(stderr, " --model-out FNAME path to save ggml model (default '%s')\n", params->fn_model_out);
2771-
fprintf(stderr, " -s SEED, --seed SEED RNG seed (default: -1, use random seed for < 0)\n");
2771+
fprintf(stderr, " -s SEED, --seed SEED RNG seed (default: -1, use random seed for -1)\n");
27722772
fprintf(stderr, " -c N, --ctx N Context size used during training (default %d)\n", params->n_ctx);
27732773
fprintf(stderr, " --embd N Embedding size used for new models (default %d)\n", params->n_embd);
27742774
fprintf(stderr, " --mult N Mult size used for new models, influences feedforward size. (default %d)\n", params->n_mult);
@@ -3034,10 +3034,10 @@ int main(int argc, char ** argv) {
30343034
return 1;
30353035
}
30363036

3037-
if (params.seed < 0) {
3037+
if (params.seed == LLAMA_DEFAULT_SEED) {
30383038
params.seed = time(NULL);
30393039
}
3040-
printf("%s: seed: %d\n", __func__, params.seed);
3040+
printf("%s: seed: %u\n", __func__, params.seed);
30413041
srand(params.seed);
30423042

30433043
struct llama_context_params llama_params = llama_context_default_params();

0 commit comments

Comments
 (0)