[HIP][Docs] embed_bf16 + gemm_bf16 kernels (GPU-verified) + newcomer orientation guide
- kernels/hip: k_embed_bf16_gather (BF16 table -> f32 token rows, exact) and k_gemm_bf16 (y[M,N] = x[M,K] @ w[N,K]^T, BF16 in / f32 accumulate, correctness-first per-element; WMMA tiling is the later performance pass). C ABI + safe Rust wrappers (embed_bf16_gather, gemm_bf16) + DeviceBuf byte-level h2d/d2h. - Verified LIVE on gfx1150: embed exact, gemm max_rel_err 0.0 across (2,8,16)/(4,32,64)/(1,128,256), rms_norm ~1e-6. Three kernels now cover the trunk + projection compute path (embed, norm, gemm). - docs/ORIENTATION.md: a guide for newcomers arriving from vLLM/llama.cpp/ SGLang — what this engine is, the five ideas behind the mental-model shift (microkernel+services, models compiled to .vbundle, forward pass as a Lean-proven validated plan, proof-first, parity discipline), the crate map, the honest current state (CPU pipeline done, GPU begun, no token yet), and the ordered road to the first agent chat and beyond. Linked from README. Verified: RUSTFLAGS="-D warnings" cargo test --workspace = 97/97 PASS; lean proofs (4 files, 42 theorems) green; GPU parity 4/4 (--features hip).
This commit is contained in:
1 parent
bd0d4f2a63
commit
356f9c458e
5 files changed
+313
No files matched your search
@@ -36,6 +36,15 @@ int vetta_buf_d2h(void* dst, const void* src, size_t bytes);
|
||||
int vetta_rms_norm_f32(const float* x, const float* w, float* y,
|
||||
int rows, int D, float eps, vetta_stream_t stream);
|
||||
|
||||
// k_embed_bf16 (kernel #1): gather token rows from a BF16 table -> f32.
|
||||
int vetta_embed_bf16_gather(const uint16_t* table, const int32_t* tokens,
|
||||
float* out, int B, int D, int vocab,
|
||||
vetta_stream_t stream);
|
||||
|
||||
// k_gemm_bf16: y[M,N] = x[M,K] @ w[N,K]^T, BF16 inputs, f32 accumulate.
|
||||
int vetta_gemm_bf16(const uint16_t* x, const uint16_t* w, float* y,
|
||||
int M, int N, int K, vetta_stream_t stream);
|
||||
|
||||
// Core <15 microkernel entry points (implemented progressively in M1 & M2):
|
||||
// 1. k_embed_bf16
|
||||
// 2. k_rms_norm
|
||||
|
||||
Reference in new issue
Block a user