Skip to content

Commit 721bb4b

Browse files
authored
Merge pull request #63 from tsisw/soft-max-latest
@FIR-999 - Create SOFT_MAX for tsavorite-backend for GGML
2 parents 272b85c + 41137ce commit 721bb4b

File tree

4 files changed

+207
-83
lines changed

4 files changed

+207
-83
lines changed

ggml-tsi-kernel

ggml/include/ggml-tsavorite.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ enum ggml_tsavorite_kernel_type {
140140
GGML_TSAVORITE_KERNEL_TYPE_GEGLU_ERF,
141141
GGML_TSAVORITE_KERNEL_TYPE_GEGLU_QUICK,
142142

143+
GGML_TSAVORITE_KERNEL_TYPE_SOFT_MAX,
144+
143145
GGML_TSAVORITE_KERNEL_TYPE_COUNT
144146
};
145147

@@ -156,7 +158,7 @@ typedef struct tensor_log_ {
156158
uint32_t leaf2_len;
157159
uint32_t node_len;
158160
enum ggml_tsavorite_tensor_data_type data_type;
159-
enum ggml_tsavorite_kernel_type kernel_type;
161+
enum ggml_op kernel_type;
160162
uint64_t num_of_op;
161163
FILE *log_file;
162164
const ggml_tensor *tensor;
@@ -185,6 +187,7 @@ extern void _mlir_ciface_txe_sin_host(void *a, void *res);
185187
extern void _mlir_ciface_txe_sigmoid_host(void *a, void *res);
186188
extern void _mlir_ciface_txe_silu_host(void *a, void *res);
187189
extern void _mlir_ciface_txe_swiglu_host(void *a, void *b, void *res);
190+
extern void _mlir_ciface_txe_soft_max_host(void *a, void *b, void *res, void *buf);
188191
extern void _mlir_ciface_txe_rms_norm_host(void *a, void *res, void *buf);
189192

190193
/*
@@ -210,7 +213,7 @@ extern void ggml_tsi_log_tensor_data(tensor_log log_data);
210213

211214
// GGML supports tensors with a maximum rank of 4
212215
#define MEM_REF_DESCRIPTOR_RANK 4
213-
#define TSI_TVU_LOAD_SIZE 32
216+
#define TSI_TVU_MEM_ALIGN 128
214217

215218
//
216219
// backend API

0 commit comments

Comments
 (0)