code wiki / (root) / nx_nofloat_arch.nx

nx_nofloat_arch.nx

buildroot/runtime/nx_nofloat_arch.nx

4724 B74 linesdepth 8pulls 17 transitivereach 46 importersview sourcekind librarytopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_arch.nx -- ARCH-CONFIGURABLE inference: read a model's dims from GGUF METADATA instead of hardcoding Qwen2.5-0.5B. The no-float forward (nx_nofloat_llm) is ALREADY cfg-parameterized -- only the gate/serve main()s hardcode ne/n_layers/heads/ffn. This reader fills those from the metadata KVs that llama.cpp's convert writes (`<arch>.embedding_length`, `.block_count`, `.attention.head_count`, `.attention.head_count_kv`, `.feed_forward_length`), so ANY Qwen2/Llama-schema gguf runs -- the real 0.5B AND a small from-scratch model (closing the sovereign train->serve loop). Pure funcs, no main. license_tier: ORIGINAL

dependencies 5 imports · 9 importers

nx_syscalls.nx nx_le.nx nx_gguf.nx nx_gguf_meta.nx nx_nofloat_llm.nx nx_nofloat_arch.nx nx_llm_loopb_gate.nx nx_llm_ppl_bench_gate.nx nx_nofloat_arch_config_gate.nx nx_nofloat_arch_moe_gate.nx nx_nofloat_moe_real_gate.nx nx_nofloat_olmoe_forward_gate.nx nx_nofloat_olmoe_gate.nx nx_nofloat_serve_core.nx nx_olmoe_recon2_gate.nx

imports: nx_syscalls.nxnx_le.nxnx_gguf.nxnx_gguf_meta.nxnx_nofloat_llm.nx

imported by: nx_llm_loopb_gate.nxnx_llm_ppl_bench_gate.nxnx_nofloat_arch_config_gate.nxnx_nofloat_arch_moe_gate.nxnx_nofloat_moe_real_gate.nxnx_nofloat_olmoe_forward_gate.nxnx_nofloat_olmoe_gate.nxnx_nofloat_serve_core.nxnx_olmoe_recon2_gate.nx

structs

none

consts

none

functions

16func nac_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
18func nac_key(prefix: *u8, plen: i64, suffix: *u8, out: *u8) -> i64
called by 2: nac_u32nac_f32_int
23func nac_u32(buf: *u8, len: i64, hdr: *NxGgufHeader, prefix: *u8, plen: i64, suffix: *u8) -> i64
30func nac_f32_int(buf: *u8, len: i64, hdr: *NxGgufHeader, prefix: *u8, plen: i64, suffix: *u8, dflt: i64) -> i64
40func nac_read_config(buf: *u8, len: i64, hdr: *NxGgufHeader, cfg: *i64, arch_out: *u8) -> i64