Skip to content

Commit f9e1b9a

Browse files
committed
make github CI happy
1 parent b0c3013 commit f9e1b9a

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

ggml-qnn.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@
8989
class qnn_instance;
9090

9191
//TODO: should be removed because this is a workaround method during development stage
92+
//a minor modification is required during development stage for validate QNN backend on Android phone:
93+
//
94+
//modify from
95+
//
96+
//static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor)
97+
//
98+
//to
99+
//
100+
//void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor)
101+
//
102+
//in source file ggml.c#L16156
103+
//
104+
//this workaround will not be needed when the final QNN backend is complete
92105
extern "C" void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor);
93106

94107
#if (defined __ANDROID__) || (defined ANDROID) //Qualcomm's QNN could running on Windows over ARM(aka WoA)

ggml-qnn.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ GGML_API void ggml_backend_qnn_get_device_description(int device, char
4646
GGML_API ggml_backend_buffer_type_t ggml_backend_qnn_buffer_type(size_t dev_num);
4747

4848

49-
//temporary API, should be removed in the future
50-
GGML_API bool ggml_qnn_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor);
51-
52-
5349
#ifdef __cplusplus
5450
}
5551
#endif

ggml.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16153,8 +16153,7 @@ static void ggml_compute_forward_cross_entropy_loss_back(
1615316153

1615416154
/////////////////////////////////
1615516155

16156-
//workaround for Qualcomm QNN backend
16157-
void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) {
16156+
static void ggml_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor) {
1615816157
GGML_ASSERT(params);
1615916158

1616016159
if (tensor->op == GGML_OP_NONE || ggml_is_empty(tensor)) {

llama.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15403,7 +15403,7 @@ struct llama_context * llama_new_context_with_model(
1540315403
#elif defined(GGML_USE_QNN)
1540415404
if (model->n_gpu_layers > 0) {
1540515405
//the second param is package name of Andorid app, can be got by JNI from Java layer
15406-
ggml_backend_t backend = ggml_backend_qnn_init(QNN_CPU, "/data/data/com.ggml.llamacpp/");
15406+
ggml_backend_t backend = ggml_backend_qnn_init(model->main_gpu, "/data/data/com.ggml.llamacpp/");
1540715407
if (nullptr == backend) {
1540815408
LLAMA_LOG_ERROR("%s: failed to initialize QNN backend\n", __func__);
1540915409
llama_free(ctx);
@@ -17577,14 +17577,6 @@ void llama_reset_timings(struct llama_context * ctx) {
1757717577
ctx->t_p_eval_us = ctx->n_p_eval = 0;
1757817578
}
1757917579

17580-
static int llama_has_qnn(void) {
17581-
#ifdef GGML_USE_QNN
17582-
return 1;
17583-
#else
17584-
return 0;
17585-
#endif
17586-
}
17587-
1758817580
const char * llama_print_system_info(void) {
1758917581
static std::string s;
1759017582

@@ -17606,7 +17598,6 @@ const char * llama_print_system_info(void) {
1760617598
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
1760717599
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
1760817600
s += "MATMUL_INT8 = " + std::to_string(ggml_cpu_has_matmul_int8()) + " | ";
17609-
s += "QNN = " + std::to_string(llama_has_qnn()) + " | ";
1761017601

1761117602
return s.c_str();
1761217603
}

0 commit comments

Comments
 (0)