Skip to content

Commit e50711f

Browse files
committed
test-backend-ops modifications are reverted
1 parent a672803 commit e50711f

File tree

3 files changed

+50
-439
lines changed

3 files changed

+50
-439
lines changed

ggml/include/ggml-backend.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,6 @@ extern "C" {
340340

341341
// Compare the output of two backends
342342
GGML_API bool ggml_backend_compare_graph_backend(ggml_backend_t backend1, ggml_backend_t backend2, struct ggml_cgraph * graph, ggml_backend_eval_callback callback, void * user_data, struct ggml_tensor * test_node);
343-
// Compare the output of two backends, graphs can be different and only the selected nodes will be compared
344-
GGML_API bool ggml_backend_compare_graph_backend_node(ggml_backend_t backend1, ggml_backend_t backend2, struct ggml_cgraph * graph1, struct ggml_cgraph * graph2, ggml_backend_eval_callback callback, void * user_data, char* op_name_out_1, char* op_name_out_2);
345343

346344
// Tensor initialization
347345
GGML_API enum ggml_status ggml_backend_tensor_alloc(ggml_backend_buffer_t buffer, struct ggml_tensor * tensor, void * addr);

ggml/src/ggml-backend.cpp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,55 +1882,6 @@ bool ggml_backend_compare_graph_backend(ggml_backend_t backend1, ggml_backend_t
18821882
return true;
18831883
}
18841884

1885-
bool ggml_backend_compare_graph_backend_node(
1886-
ggml_backend_t backend1,
1887-
ggml_backend_t backend2,
1888-
struct ggml_cgraph * graph1,
1889-
struct ggml_cgraph * graph2,
1890-
ggml_backend_eval_callback callback, void * user_data, char* op_name_out_1, char* op_name_out_2) {
1891-
1892-
ggml_tensor * out1 = NULL;
1893-
ggml_tensor * out2 = NULL;
1894-
1895-
struct ggml_cgraph * g1 = graph1;
1896-
struct ggml_cgraph * g2 = graph2;
1897-
1898-
for (int i = 0; i < g1->n_nodes; i++) {
1899-
struct ggml_tensor * t1 = g1->nodes[i];
1900-
struct ggml_cgraph g1v = ggml_graph_view(g1, i, i + 1);
1901-
ggml_backend_graph_compute(backend1, &g1v);
1902-
if (ggml_is_view_op(t1->op)) {
1903-
continue;
1904-
}
1905-
if(strcmp(t1 -> name, op_name_out_1) == 0){
1906-
out1 = t1;
1907-
}
1908-
}
1909-
1910-
for (int i = 0; i < g2->n_nodes; i++) {
1911-
struct ggml_tensor * t2 = g2->nodes[i];
1912-
struct ggml_cgraph g2v = ggml_graph_view(g2, i, i + 1);
1913-
ggml_backend_graph_compute(backend2, &g2v);
1914-
if (ggml_is_view_op(t2->op)) {
1915-
continue;
1916-
}
1917-
if(strcmp(t2 -> name, op_name_out_2) == 0){
1918-
out2 = t2;
1919-
}
1920-
}
1921-
1922-
assert(out1 != NULL);
1923-
assert(out2 != NULL);
1924-
assert(ggml_are_same_layout(out1, out2));
1925-
1926-
// compare results, calculate rms etc
1927-
if (!callback(0, out1, out2, user_data)) {
1928-
return false;
1929-
}
1930-
1931-
return true;
1932-
}
1933-
19341885
// CPU backend - buffer
19351886

19361887
static void * ggml_backend_cpu_buffer_get_base(ggml_backend_buffer_t buffer) {

0 commit comments

Comments
 (0)