File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -1111,17 +1111,23 @@ class vk_perf_logger {
11111111 return;
11121112 }
11131113 if (node->op == GGML_OP_MUL_MAT || node->op == GGML_OP_MUL_MAT_ID) {
1114- const uint64_t m = node->src[0]->ne[1];
1115- const uint64_t n = node->src[1]->ne[1];
1116- const uint64_t k = node->src[1]->ne[0];
1117- std::string name = ggml_op_name(node->op);
1118- if (n == 1) {
1119- name += "_VEC m=" + std::to_string(m) + " k=" + std::to_string(k);
1120- } else {
1121- name += " m=" + std::to_string(m) + " n=" + std::to_string(n) + " k=" + std::to_string(k);
1114+ const uint64_t m = node->src[0]->ne[1];
1115+ const uint64_t n = node->ne[1];
1116+ const uint64_t k = node->src[1]->ne[0];
1117+ const uint64_t batch = node->src[1]->ne[2] * node->src[1]->ne[3];
1118+ std::string name = ggml_op_name(node->op);
1119+ if ((node->op == GGML_OP_MUL_MAT && n <= mul_mat_vec_max_cols) ||
1120+ (node->op == GGML_OP_MUL_MAT_ID && node->src[2]->ne[1] == 1)) {
1121+ name += "_VEC";
1122+ }
1123+ name += " ";
1124+ name += ggml_type_name(node->src[0]->type);
1125+ name += " m=" + std::to_string(m) + " n=" + std::to_string(n) + " k=" + std::to_string(k);
1126+ if (batch > 1) {
1127+ name += " batch=" + std::to_string(batch);
11221128 }
11231129 timings[name].push_back(time);
1124- flops[name].push_back(m * n * (k + (k - 1)));
1130+ flops[name].push_back(m * n * (k + (k - 1)) * batch );
11251131 return;
11261132 }
11271133 if (node->op == GGML_OP_CONV_2D) {
You can’t perform that action at this time.
0 commit comments