code wiki / (root) / nx_f32_llama_block_test.nx

nx_f32_llama_block_test.nx

buildroot/runtime/nx_f32_llama_block_test.nx

5162 B129 linesdepth 9pulls 18 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_llama_block_test.nx -- smoke for nx_f32_llama_block.nx. Identity-with-zero-weights test: All weight matrices are zero (mmap default). gamma_attn and gamma_ffn can be anything; with zero W_q/k/v the attention projections are 0; with zero W_o attn_proj=0. x_mid = x + 0 = x. FFN similarly produces 0 with zero W_*. out = x_mid + 0 = x. This exercises the full forward pass (RMSNorm + matmul + RoPE + attn-with-cache + SwiGLU + residual) and verifies the residual path preserves x bit-exact when weights are zero.

dependencies 11 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_f32.nx nx_f32_rmsnorm.nx nx_f32_matmul.nx nx_f32_activations.nx nx_f32_rope.nx nx_f32_attn_multi.nx nx_f32_kv_cache.nx nx_f32_attn_cached.nx nx_f32_llama_block_test.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_f32.nxnx_f32_rmsnorm.nxnx_f32_matmul.nxnx_f32_activations.nxnx_f32_rope.nxnx_f32_attn_multi.nxnx_f32_kv_cache.nxnx_f32_attn_cached.nxnx_f32_llama_block.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_f32_blk_verdict_is_vali nx_f32_llama_layer_alloc sys_mmap sys_mmap ↻ nx_f32_kv_cache_alloc sys_mmap ↻ nx_f32_llama_block_forward sys_mmap ↻ nx_f32_rmsnorm nx_i32_to_f32 nx_f32_sqrt nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_exp_field ↻ nx_f32_mant_field ↻ _f32_isqrt nx_f32_matmul nx_f32_kv_cache_get_seq_le nx_f32_rope_apply_vector nx_i32_to_f32 ↻ nx_f32_neg nx_f32_div nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_exp nx_f32_classify ↻ nx_f32_sign ↻ _f32_to_i32_rne nx_f32_classify ↻ nx_f32_sign ↻

structs

none

consts

none

functions

26func main() -> i64