|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
Functions | |
| __host__ __device__ int | tiled_chunk (int L, int min_chunk, int max_chunks) |
| __host__ __device__ int | tiled_nchunks (int L, int chunk) |
| __host__ __device__ int | tiled_grid_chunks (int max_len, int min_chunk, int max_chunks) |
| __host__ bool | tiled_shape_ok (int heads, int head_dim, int max_len, int heads_max, int min_chunk, int max_chunks) |
| __host__ size_t | tiled_shm_bytes (int head_dim, int max_len, int min_chunk, int max_chunks) |
| __device__ __forceinline__ void | tiled_split_block (const float *__restrict__ Qh, const float *__restrict__ K, const float *__restrict__ V, int L, int c, int kvh, int num_kv_heads, int head_dim, float scale, int min_chunk, int max_chunks, float *__restrict__ part) |
| __device__ __forceinline__ void | tiled_merge_block (const float *__restrict__ base, float *__restrict__ out_h, int L, int head_dim, int min_chunk, int max_chunks) |
Variables | |
| constexpr int | kTiledThreads = 128 |
| constexpr int | kTiledMinChunk = 32 |
| constexpr int | kTiledMaxChunks = 64 |
| constexpr int | kTiledChunkMax = 2048 |
| constexpr int | kTiledHeadDimMax = 256 |
Definition at line 35 of file decode_attn_tiled.cuh.
Referenced by tiled_merge_block(), tiled_shape_ok(), tiled_shm_bytes(), and tiled_split_block().
|
inline |
Definition at line 41 of file decode_attn_tiled.cuh.
Referenced by ember_kvq::partial_floats().
| __device__ __forceinline__ void ember_tiled::tiled_merge_block | ( | const float *__restrict__ | base, |
| float *__restrict__ | out_h, | ||
| int | L, | ||
| int | head_dim, | ||
| int | min_chunk, | ||
| int | max_chunks | ||
| ) |
Definition at line 152 of file decode_attn_tiled.cuh.
References c, j, kTiledMaxChunks, p, tiled_chunk(), and tiled_nchunks().
|
inline |
Definition at line 39 of file decode_attn_tiled.cuh.
References j.
Referenced by tiled_merge_block().
|
inline |
Definition at line 46 of file decode_attn_tiled.cuh.
References j, kTiledChunkMax, kTiledHeadDimMax, kTiledMaxChunks, and tiled_chunk().
Referenced by ember_kvq::decode_cuda().
|
inline |
| __device__ __forceinline__ void ember_tiled::tiled_split_block | ( | const float *__restrict__ | Qh, |
| const float *__restrict__ | K, | ||
| const float *__restrict__ | V, | ||
| int | L, | ||
| int | c, | ||
| int | kvh, | ||
| int | num_kv_heads, | ||
| int | head_dim, | ||
| float | scale, | ||
| int | min_chunk, | ||
| int | max_chunks, | ||
| float *__restrict__ | part | ||
| ) |
Definition at line 58 of file decode_attn_tiled.cuh.
References a, c, j, k, kTiledThreads, n, scale, tiled_chunk(), and v.
Definition at line 32 of file decode_attn_tiled.cuh.
Referenced by tiled_shape_ok().
Definition at line 33 of file decode_attn_tiled.cuh.
Referenced by tiled_shape_ok().
Definition at line 31 of file decode_attn_tiled.cuh.
Referenced by decode_attention_tiles(), tiled_merge_block(), and tiled_shape_ok().
Definition at line 30 of file decode_attn_tiled.cuh.
Referenced by decode_attention_tiles().
Definition at line 29 of file decode_attn_tiled.cuh.
Referenced by tiled_split_block().