Skip to content

Commit

Permalink
fixed compile issues for cublas
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Jan 21, 2024
1 parent 5639c1a commit 5ff5350
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions gpttype_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,7 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in

printf("System Info: %s\n", llama_print_system_info());
#if defined(GGML_USE_CUBLAS)
if(file_format==FileFormat::GGUF_LLAMA || file_format==FileFormat::GGUF_FALCON)
{
if(ggml_cpu_has_gpublas() && cu_parseinfo_maindevice>0)
{
printf("CUBLAS: Set main device to %d\n",cu_parseinfo_maindevice);
ggml_cuda_set_main_device(cu_parseinfo_maindevice);
}
}
else
if(file_format!=FileFormat::GGUF_LLAMA && file_format!=FileFormat::GGUF_FALCON)
{
if(ggml_v3_cpu_has_gpublas() && cu_parseinfo_maindevice>0)
{
Expand Down Expand Up @@ -932,9 +924,7 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
llama_ctx_params.n_ctx += extra_context_handle_fragmentation;
}

//llama_ctx_paran_parts = -1;
llama_ctx_params.seed = -1;
//llama_ctx_params.f16_kv = true;
llama_ctx_params.offload_kqv = !inputs.low_vram;
llama_ctx_params.mul_mat_q = inputs.use_mmq;
llama_ctx_params.logits_all = false;
Expand All @@ -948,6 +938,12 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
model_params.n_gpu_layers = 0;
}
#endif
#if defined(GGML_USE_CUBLAS)
if(ggml_cpu_has_gpublas() && cu_parseinfo_maindevice>0)
{
printf("CUBLAS: Set main device to %d\n",cu_parseinfo_maindevice);
}
#endif
model_params.main_gpu = cu_parseinfo_maindevice;

llama_ctx_params.n_batch = blasbatchsize;
Expand Down

0 comments on commit 5ff5350

Please sign in to comment.