| 6009 | } |
| 6010 | |
| 6011 | void ggml_conv_2d_direct_set_cudnn_bias(struct ggml_tensor * tensor, struct ggml_tensor * bias) { |
| 6012 | GGML_ASSERT(tensor && tensor->op == GGML_OP_CONV_2D); |
| 6013 | GGML_ASSERT(ggml_get_op_params_i32(tensor, 7) == 1); |
| 6014 | GGML_ASSERT(bias && bias->type == GGML_TYPE_F16 && ggml_nelements(bias) == tensor->ne[2]); |
| 6015 | tensor->src[2] = bias; |
| 6016 | } |
| 6017 | |
| 6018 | struct ggml_tensor * ggml_sage_attn2( |
| 6019 | struct ggml_context * ctx, |
| 6020 | struct ggml_tensor * q, |
| 6021 | struct ggml_tensor * k, |
| 6022 | struct ggml_tensor * v, |
| 6023 | float scale, |
| 6024 | bool causal) { |
| 6025 | GGML_ASSERT(q->type == GGML_TYPE_F16); |
| 6026 | GGML_ASSERT(k->type == GGML_TYPE_F16); |
| 6027 | GGML_ASSERT(v->type == GGML_TYPE_F16); |
| 6028 | GGML_ASSERT(ggml_is_contiguous(q)); |
| 6029 | GGML_ASSERT(ggml_is_contiguous(k)); |
| 6030 | GGML_ASSERT(ggml_is_contiguous(v)); |
| 6031 | |
| 6032 | GGML_ASSERT(q->ne[0] == k->ne[0]); |
| 6033 | GGML_ASSERT(q->ne[0] == v->ne[0]); |
| 6034 | GGML_ASSERT(k->ne[1] == v->ne[1]); |
| 6035 | GGML_ASSERT(k->ne[2] == v->ne[2]); |
| 6036 | GGML_ASSERT(q->ne[3] == k->ne[3]); |
no test coverage detected