|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
Enumerations | |
| enum | Format : int { kF32 = 0 , kF16 = 1 , kQ8 = 2 , kQ4 = 3 } |
Functions | |
| void | write_cuda (int f, void *Kd, void *Ks, void *Vd, void *Vs, const float *k, const float *v, int T, int row, int start_pos, cudaStream_t st, const int *dpos) |
| size_t | partial_floats (int hq, int hd, int max_len) |
| void | decode_cuda (int f, const float *q, const void *Kd, const void *Ks, const void *Vd, const void *Vs, float *out, int hq, int hkv, int hd, float scale, int max_len, int seq_len, float *part, cudaStream_t st, const int *dpos) |
| void | dequant_rows_cuda (int f, const void *Kd, const void *Ks, const void *Vd, const void *Vs, float *K, float *V, int n, int row, cudaStream_t st) |
| Format | parse_format (const char *s) |
| const char * | format_name (int f) |
| size_t | data_bytes (int f, size_t row) |
| size_t | scale_bytes (int f, size_t row) |
| std::string | shape_error (int f, int head_dim) |
| uint16_t | f32_to_f16 (float x) |
| float | f16_to_f32 (uint16_t h) |
| void | roundtrip_block (int f, float *x) |
| void | roundtrip_rows (int f, float *x, size_t rows, size_t row) |
Variables | |
| constexpr int | kBlock = 32 |
| void ember_kvq::decode_cuda | ( | int | f, |
| const float * | q, | ||
| const void * | Kd, | ||
| const void * | Ks, | ||
| const void * | Vd, | ||
| const void * | Vs, | ||
| float * | out, | ||
| int | hq, | ||
| int | hkv, | ||
| int | hd, | ||
| float | scale, | ||
| int | max_len, | ||
| int | seq_len, | ||
| float * | part, | ||
| cudaStream_t | st, | ||
| const int * | dpos | ||
| ) |
Definition at line 288 of file kv_quant.cu.
References j, kF16, kQ4, kQ8, out, scale, and ember_tiled::tiled_shape_ok().
| void ember_kvq::dequant_rows_cuda | ( | int | f, |
| const void * | Kd, | ||
| const void * | Ks, | ||
| const void * | Vd, | ||
| const void * | Vs, | ||
| float * | K, | ||
| float * | V, | ||
| int | n, | ||
| int | row, | ||
| cudaStream_t | st | ||
| ) |
Definition at line 303 of file kv_quant.cu.
Definition at line 88 of file kv_quant.h.
Referenced by roundtrip_block(), and roundtrip_rows().
Definition at line 64 of file kv_quant.h.
References j.
Referenced by roundtrip_block(), and roundtrip_rows().
Definition at line 45 of file kv_quant.h.
References j, kF16, kQ4, and kQ8.
Referenced by ember_ir::Interpreter::init(), and ember_ir::Interpreter::kv_format().
Definition at line 37 of file kv_quant.h.
References j, kF16, kF32, kQ4, kQ8, and v.
Referenced by ember_ir::Interpreter::init().
Definition at line 284 of file kv_quant.cu.
References j, and ember_tiled::tiled_grid_chunks().
Definition at line 111 of file kv_quant.h.
References f16_to_f32(), f32_to_f16(), j, kBlock, kQ4, and kQ8.
Referenced by roundtrip_rows().
Definition at line 138 of file kv_quant.h.
References f16_to_f32(), f32_to_f16(), j, kBlock, kF16, kF32, n, and roundtrip_block().
Referenced by ember_ir::Interpreter::run_nodes().
| void ember_kvq::write_cuda | ( | int | f, |
| void * | Kd, | ||
| void * | Ks, | ||
| void * | Vd, | ||
| void * | Vs, | ||
| const float * | k, | ||
| const float * | v, | ||
| int | T, | ||
| int | row, | ||
| int | start_pos, | ||
| cudaStream_t | st, | ||
| const int * | dpos | ||
| ) |
Definition at line 260 of file kv_quant.cu.
Definition at line 34 of file kv_quant.h.
Referenced by roundtrip_block(), roundtrip_rows(), scale_bytes(), shape_error(), and write_cuda().