Skip to content

Commit 2bc1b80

Browse files
authored
ggml : deprecate GGML_OP_ADD1 (ggml-org#21363)
* ggml : deprecate GGML_OP_ADD1 * cont : remove tests * cont : re-enable vulkan check
1 parent 228a283 commit 2bc1b80

2 files changed

Lines changed: 6 additions & 39 deletions

File tree

ggml/include/ggml.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,17 @@ extern "C" {
902902
struct ggml_tensor * b,
903903
struct ggml_tensor * ids);
904904

905-
GGML_API struct ggml_tensor * ggml_add1(
905+
GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_add1(
906906
struct ggml_context * ctx,
907907
struct ggml_tensor * a,
908-
struct ggml_tensor * b);
908+
struct ggml_tensor * b),
909+
"use ggml_add instead");
909910

910-
GGML_API struct ggml_tensor * ggml_add1_inplace(
911+
GGML_DEPRECATED(GGML_API struct ggml_tensor * ggml_add1_inplace(
911912
struct ggml_context * ctx,
912913
struct ggml_tensor * a,
913-
struct ggml_tensor * b);
914+
struct ggml_tensor * b),
915+
"use ggml_add_inplace instead");
914916

915917
// dst = a
916918
// view(dst, nb1, nb2, nb3, offset) += b

tests/test-backend-ops.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,39 +3129,6 @@ struct test_add_id : public test_case {
31293129
}
31303130
};
31313131

3132-
// GGML_OP_ADD1
3133-
struct test_add1 : public test_case {
3134-
const ggml_type type;
3135-
const std::array<int64_t, 4> ne;
3136-
3137-
std::string vars() override {
3138-
return VARS_TO_STR2(type, ne);
3139-
}
3140-
3141-
test_add1(ggml_type type = GGML_TYPE_F32,
3142-
std::array<int64_t, 4> ne = {10, 5, 4, 3})
3143-
: type(type), ne(ne) {}
3144-
3145-
ggml_tensor * build_graph(ggml_context * ctx) override {
3146-
ggml_tensor * a = ggml_new_tensor(ctx, type, 4, ne.data());
3147-
ggml_set_param(a);
3148-
ggml_set_name(a, "a");
3149-
3150-
ggml_tensor * b = ggml_new_tensor_1d(ctx, type, 1);
3151-
// ggml_set_param(b); // TODO: implement
3152-
ggml_set_name(b, "b");
3153-
3154-
ggml_tensor * out = ggml_add1(ctx, a, b);
3155-
ggml_set_name(out, "out");
3156-
3157-
return out;
3158-
}
3159-
3160-
float grad_eps() override {
3161-
return 0.1f * ne[0]*ne[1]*ne[2]*ne[3];
3162-
}
3163-
};
3164-
31653132
// GGML_OP_SCALE
31663133
struct test_scale : public test_case {
31673134
const ggml_type type;
@@ -7886,8 +7853,6 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
78867853
test_cases.emplace_back(new test_bin_bcast(ggml_add, GGML_TYPE_F32, {16, 5, 4, 3}, {2, 2, 2, 2}, 8));
78877854
test_cases.emplace_back(new test_bin_bcast(ggml_add, GGML_TYPE_F32, {16, 5, 4, 3}, {1, 1, 1, 1}, 16));
78887855

7889-
test_cases.emplace_back(new test_add1());
7890-
test_cases.emplace_back(new test_add1(GGML_TYPE_F32, {1024, 1024, 1, 1}));
78917856
test_cases.emplace_back(new test_scale());
78927857
test_cases.emplace_back(new test_scale(GGML_TYPE_F32, {10, 10, 10, 10}, 2.0f, 1.0f));
78937858
test_cases.emplace_back(new test_scale(GGML_TYPE_F32, {10, 10, 10, 10}, 2.0f, 1.0f, true)); // inplace test

0 commit comments

Comments
 (0)