ggml : fix clang-tidy warnings

This commit is contained in:
Georgi Gerganov 2023-05-13 15:34:56 +03:00
parent 95a487a17e
commit ef3d42a3aa
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
2 changed files with 13 additions and 14 deletions

6
ggml.c
View file

@ -13715,17 +13715,11 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
case GGML_OP_GET_ROWS_BACK:
case GGML_OP_DIAG:
case GGML_OP_DIAG_MASK_INF:
{
node->n_tasks = 1;
} break;
case GGML_OP_DIAG_MASK_ZERO:
{
node->n_tasks = 1;
} break;
case GGML_OP_SOFT_MAX:
{
node->n_tasks = n_threads;
} break;
case GGML_OP_ROPE:
case GGML_OP_ROPE_BACK:
{

21
ggml.h
View file

@ -612,10 +612,12 @@ extern "C" {
struct ggml_context * ctx,
struct ggml_tensor * a);
struct ggml_tensor * ggml_silu_back(
// a - x
// b - dy
GGML_API struct ggml_tensor * ggml_silu_back(
struct ggml_context * ctx,
struct ggml_tensor * x,
struct ggml_tensor * dy);
struct ggml_tensor * a,
struct ggml_tensor * b);
// normalize along rows
// TODO: eps is hardcoded to 1e-5 for now
@ -627,10 +629,12 @@ extern "C" {
struct ggml_context * ctx,
struct ggml_tensor * a);
// a - x
// b - dy
GGML_API struct ggml_tensor * ggml_rms_norm_back(
struct ggml_context * ctx,
struct ggml_tensor * x,
struct ggml_tensor * dy);
struct ggml_tensor * a,
struct ggml_tensor * b);
// A: m rows, n columns
// B: p rows, n columns (i.e. we transpose it internally)
@ -870,9 +874,10 @@ extern "C" {
int mode);
// rotary position embedding backward, i.e compute dx from dy
// a - dy
GGML_API struct ggml_tensor * ggml_rope_back(
struct ggml_context * ctx,
struct ggml_tensor * dy,
struct ggml_tensor * a,
int n_past,
int n_dims,
int mode);
@ -921,13 +926,13 @@ extern "C" {
GGML_API struct ggml_tensor * ggml_map_unary_f32(
struct ggml_context * ctx,
struct ggml_tensor * a,
const ggml_unary_op_f32_t fun);
ggml_unary_op_f32_t fun);
GGML_API struct ggml_tensor * ggml_map_binary_f32(
struct ggml_context * ctx,
struct ggml_tensor * a,
struct ggml_tensor * b,
const ggml_binary_op_f32_t fun);
ggml_binary_op_f32_t fun);
//
// automatic differentiation