Skip to content

Commit d0a81f4

Browse files
committed
Revert "protyping the idea that supports running on CPU for a GGML_USE_CUBLAS=on build"
This reverts commit b5149aa.
1 parent b5149aa commit d0a81f4

File tree

3 files changed

+76
-124
lines changed

3 files changed

+76
-124
lines changed

ggml-cuda.cu

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,11 +5724,6 @@ static void ggml_cuda_pool_free(void * ptr, size_t size) {
57245724
CUDA_CHECK(cudaFree(ptr));
57255725
}
57265726

5727-
static bool g_cublas_loaded = false;
5728-
5729-
bool ggml_cublas_loaded(void) {
5730-
return g_cublas_loaded;
5731-
}
57325727

57335728
void ggml_init_cublas() {
57345729
static bool initialized = false;
@@ -5742,12 +5737,7 @@ void ggml_init_cublas() {
57425737
CUDA_CHECK(cudaDeviceSynchronize());
57435738
#endif
57445739

5745-
if (cudaGetDeviceCount(&g_device_count) != cudaSuccess) {
5746-
initialized = true;
5747-
g_cublas_loaded = false;
5748-
return;
5749-
}
5750-
5740+
CUDA_CHECK(cudaGetDeviceCount(&g_device_count));
57515741
GGML_ASSERT(g_device_count <= GGML_CUDA_MAX_DEVICES);
57525742
int64_t total_vram = 0;
57535743
#if defined(GGML_CUDA_FORCE_MMQ)
@@ -5795,7 +5785,6 @@ void ggml_init_cublas() {
57955785
// CUBLAS_CHECK(cublasLoggerConfigure(1, 1, 0, nullptr));
57965786

57975787
initialized = true;
5798-
g_cublas_loaded = true;
57995788
}
58005789
}
58015790

@@ -7070,8 +7059,6 @@ static void ggml_cuda_rms_norm(const ggml_tensor * src0, const ggml_tensor * src
70707059
}
70717060

70727061
bool ggml_cuda_can_mul_mat(const struct ggml_tensor * src0, const struct ggml_tensor * src1, struct ggml_tensor * dst) {
7073-
if (!g_cublas_loaded) return false;
7074-
70757062
const int64_t ne10 = src1->ne[0];
70767063

70777064
const int64_t ne0 = dst->ne[0];
@@ -7735,8 +7722,6 @@ void ggml_cuda_free_scratch() {
77357722
}
77367723

77377724
bool ggml_cuda_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) {
7738-
if (!g_cublas_loaded) return false;
7739-
77407725
ggml_cuda_func_t func;
77417726
const bool any_on_device = tensor->backend == GGML_BACKEND_GPU
77427727
|| (tensor->src[0] != nullptr && (tensor->src[0]->backend == GGML_BACKEND_GPU || tensor->src[0]->backend == GGML_BACKEND_GPU_SPLIT))

ggml-cuda.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ extern "C" {
1818
#define GGML_CUDA_MAX_DEVICES 16
1919

2020
GGML_API void ggml_init_cublas(void);
21-
GGML_API bool ggml_cublas_loaded(void);
22-
2321
GGML_API void * ggml_cuda_host_malloc(size_t size);
2422
GGML_API void ggml_cuda_host_free(void * ptr);
2523

0 commit comments

Comments
 (0)