code wiki / _hdl_build / nx_engineer_profile.nx

nx_engineer_profile.nx

buildroot/runtime/_hdl_build/nx_engineer_profile.nx

1785 B30 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind librarytopic engineer
docsdependenciesstructsconstsfunctions

about

nx_engineer_profile.nx -- the ENGINEER's bottleneck-diagnosis feature (RACI: the Engineer MEASURES + VERIFIES; it does not fix or decide the trade-off -- it hands a verdict to the Builder). Given a kernel's flops + bytes-moved and the chip's peak flops + bandwidth, the Engineer diagnoses which constraint binds (the roofline read) and reports the LEVER CLASS the Builder should reach for -- data-movement (memory-bound) or compute (compute-bound). This is the team's "measure before you optimise", so no one polishes a memory-bound kernel's SIMD. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_roofline.nx nx_engineer_profile.nx nx_builder_quant.nx

imports: nx_roofline.nx

imported by: nx_builder_quant.nx

structs

none

consts

11const ENG_LEVER_NONE: i64 = 0 // could not diagnose (invalid inputs)
12const ENG_LEVER_DATA: i64 = 1 // MEMORY-bound -> reduce bytes moved (quantize/sparsify/fuse)
13const ENG_LEVER_COMPUTE: i64 = 2 // COMPUTE-bound -> optimise the inner loop (the search governor)

functions

17func eng_diagnose_kernel(flops: i64, bytes: i64, peak_flops: i64, peak_bw: i64) -> i64
23func eng_recommend_lever(bound: i64) -> i64
30func eng_kernel_ai_milli(flops: i64, bytes: i64) -> i64 { return rf_ai_milli(flops, bytes) }
calls 1: rf_ai_milli