MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / extract_graph_ops

Function extract_graph_ops

tests/export-graph-ops.cpp:90–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88};
89
90static void extract_graph_ops(ggml_cgraph * cgraph, const char * label, std::set<test_object> & tests) {
91 int n_nodes = ggml_graph_n_nodes(cgraph);
92 int n_skipped = 0;
93 int n_before = (int) tests.size();
94 for (int i = 0; i < n_nodes; i++) {
95 ggml_tensor * node = ggml_graph_node(cgraph, i);
96
97 if (node->op == GGML_OP_NONE || node->op == GGML_OP_VIEW || node->op == GGML_OP_RESHAPE || node->op == GGML_OP_PERMUTE || node->op == GGML_OP_TRANSPOSE) {
98 n_skipped++;
99 continue;
100 }
101
102 test_object test;
103
104 test.op = node->op;
105 test.type = node->type;
106 memcpy(&test.ne, node->ne, 4 * sizeof(int64_t));
107
108 test.op_params.resize(GGML_MAX_OP_PARAMS / sizeof(int32_t));
109 memcpy(test.op_params.data(), node->op_params, GGML_MAX_OP_PARAMS);
110
111 for (size_t s = 0; s < GGML_MAX_SRC; s++) {
112 if (node->src[s] == nullptr) {
113 break;
114 }
115
116 test.sources.emplace_back(node->src[s]->type, node->src[s]->ne, node->src[s]->nb);
117 }
118
119 test.name = node->name;
120 tests.insert(test);
121 }
122
123 int n_new = (int) tests.size() - n_before;
124 LOG_INF("%s: %d unique ops, %d total nodes, %d skipped (view ops)\n",
125 label, n_new, n_nodes, n_skipped);
126}
127
128int main(int argc, char ** argv) {
129 common_params params;

Callers 1

mainFunction · 0.85

Calls 6

ggml_graph_n_nodesFunction · 0.85
ggml_graph_nodeFunction · 0.85
sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected