code wiki / _hdl_build / nx_llm_train_estimate.nx

nx_llm_train_estimate.nx

buildroot/runtime/_hdl_build/nx_llm_train_estimate.nx

4994 B66 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic llm
docsdependenciesstructsconstsfunctions

dependencies 3 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_syscalls.nx nx_llm_train_estimate.nx

imports: nx_gate_gn.nxnx_gate_base.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write row train_tflops gpu_hours train_vram_gb gw ↻ gn sys_exit

structs

none

consts

12const K_MAGIC_3600: i64 = 3600
13const K_MAGIC_10000: i64 = 10000
14const K_MAGIC_1500: i64 = 1500
15const K_MAGIC_30000: i64 = 30000
16const K_MAGIC_7000: i64 = 7000
17const K_MAGIC_140000: i64 = 140000

functions

21func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
23func train_tflops(params_M: i64, tokens_M: i64) -> i64 { return 6 * params_M * tokens_M }
25func gpu_hours(tT: i64, peak_TFLOPS: i64, mfu_permil: i64) -> i64 { let eff: i64=(peak_TFLOPS*mfu_permil)/1000; if eff<=0 { return 0-1 } return tT/(eff*K_MAGIC_3600) }
27func train_vram_gb(params_M: i64) -> i64 { return (params_M*16)/1000 }
30func row(mname: *u8, params_M: i64, tokens_M: i64, gname: *u8, peak: i64, mfu: i64, cents_hr: i64, vram_gb: i64) -> i64
40func main() -> i64