#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <string.h>#include <time.h>#include <math.h>#include <sys/mman.h>#include <fcntl.h>#include <unistd.h>#include "ckernel_engine.h"#include "tokenizer/true_bpe.h"#include "ck-kernel-inference.h"#include "ck-kernel-prefill.h"Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | ANSI_BOLD "\033[1m" |
| #define | ANSI_CYAN "\033[0;36m" |
| #define | ANSI_DIM "\033[2m" |
| #define | ANSI_GREEN "\033[0;32m" |
| #define | ANSI_RESET "\033[0m" |
| #define | ANSI_YELLOW "\033[0;33m" |
| #define | CK_VERSION "6.0.0" |
Functions | |
| static int | load_manifest (const char *path, ManifestEntry **entries, int *num_entries) |
| static int | load_weights (QWEN2_DECODEModel *model, const char *bump_path, const char *manifest_path) |
| int | main (int argc, char **argv) |
| static void | print_banner (void) |
| static int | run_inference (const char *bump_path, const char *manifest_path, const char *tokenizer_path, const char *prompt, int max_tokens, float temperature, int topk) |
| static int | sample_topk (float *probs, int vocab_size, int topk) |
| #define _GNU_SOURCE |
Definition at line 9 of file v6.5_inference.c.
| #define ANSI_BOLD "\033[1m" |
Definition at line 28 of file v6.5_inference.c.
| #define ANSI_CYAN "\033[0;36m" |
Definition at line 32 of file v6.5_inference.c.
| #define ANSI_DIM "\033[2m" |
Definition at line 29 of file v6.5_inference.c.
| #define ANSI_GREEN "\033[0;32m" |
Definition at line 30 of file v6.5_inference.c.
| #define ANSI_RESET "\033[0m" |
Definition at line 27 of file v6.5_inference.c.
| #define ANSI_YELLOW "\033[0;33m" |
Definition at line 31 of file v6.5_inference.c.
| #define CK_VERSION "6.0.0" |
Definition at line 24 of file v6.5_inference.c.
|
static |
|
static |
Definition at line 140 of file v6.5_inference.c.
References load_manifest().
Referenced by run_inference().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 356 of file v6.5_inference.c.
References print_banner(), and run_inference().
|
static |
Definition at line 341 of file v6.5_inference.c.
References ANSI_CYAN, ANSI_DIM, ANSI_RESET, and CK_VERSION.
Referenced by main().
|
static |
Definition at line 197 of file v6.5_inference.c.
References ANSI_CYAN, ANSI_RESET, ANSI_YELLOW, ck_tokenizer_free(), ck_true_bpe_create(), ck_true_bpe_encode(), ck_true_bpe_free(), ck_true_bpe_id_to_token(), ck_true_bpe_load_binary(), load_weights(), num_merges, sample_topk(), token, and vocab_size.
Referenced by main().
|
static |
Definition at line 48 of file v6.5_inference.c.
References start, and vocab_size.
Referenced by run_inference().