nx_gen_taedec.nx
buildroot/runtime/nx_gen_taedec.nx
about
nx_gen_taedec.nx -- SOVEREIGN TAESD (tiny VAE) decoder: latent -> RGB pixels.
The last stage before an image. TAESD is 9.4MB of plain f32 3x3 convolutions where the full VAE
is 320MB with attention, so it is the cheapest honest route from a sovereign latent to a
sovereign picture.
h = tanh(z/3)*3 (the caller's fixture already starts here)
conv3x3 16->64 (+bias), relu
[TAEBlock x3] upsample2 conv3x3 64->64 (no bias)
[TAEBlock x3] upsample2 conv3x3 64->64 (no bias)
[TAEBlock x3] upsample2 conv3x3 64->64 (no bias)
[TAEBlock x1] conv3x3 64->3 (+bias)
TAEBlock: conv0 -> relu -> conv2 -> relu -> conv4, then + input, then relu
Usage: nx_gen_taedec <model_id> <taesd.safetensors> [workers] [in] [ref]
⚠WHY THIS DOES NOT CALL nx_f32_conv2d_forward
That organ's inner loop uses nx_f32_add / nx_f32_mul -- the SOFTWARE IEEE-754 pair -- not the
hardware __f32_* intrinsics beside them. At this decoder's ~20 G MACs that is the difference
between ~25 minutes and seconds. Same defect class this lane has now hit four times, here in a
pre-existing shared organ (filed separately; fixing it there is a fleet change, not a local one).
★★★★★ WHEN A SOVEREIGN KERNEL IS 10x UNDER PEAK, SUSPECT AN nx_-PREFIXED HELPER.
Layout is planar packed f32 [C][H][W], W contiguous -- the same order ggml uses ([W,H,C,N]) and
the same order safetensors stores conv weights ([C_out][C_in][KH][KW]).
license_tier: ORIGINAL
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_le.nxnx_f32.nxnx_f32_div.nxnx_f32_cvt.nxnx_f16.nxnx_strconv.nxnx_genfix.nxnx_genver.nxnx_safetensors_load.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 39 | const TD_CH: i64 = 64 |
functions
| 41 | func td_puts(s: *u8) -> i64 |
| 46 | func td_strlen(s: *u8) -> i64 called by 1: main |
| 53 | func td_conv_band(inp: *u8, out: *u8, w: *u8, bias: *u8, |
| 102 | func td_conv(inp: *u8, out: *u8, w: *u8, bias: *u8, |
| 121 | func td_relu(x: *u8, n: i64) -> i64 |
| 131 | func td_add(a: *u8, b: *u8, n: i64) -> i64 |
| 140 | func td_copy(dst: *u8, src: *u8, n: i64) -> i64 |
| 147 | func td_up2(inp: *u8, out: *u8, C: i64, H: i64, W: i64) -> i64 |
| 168 | func td_load(buf: *u8, hlen: i64, dstart: i64, name: *u8, n: i64) -> *u8 |
| 186 | func td_name(out: *u8, layer: i64, suffix: *u8) -> *u8 |
| 208 | func td_layer_conv(a: *u8, b: *u8, layer: i64, C_in: i64, C_out: i64, H: i64, W: i64, has_bias: i64) -> i64 |
| 222 | func td_block(x: *u8, t1: *u8, t2: *u8, layer: i64, C: i64, H: i64, W: i64) -> i64 |
| 246 | func main(argc: i64, argv: *i64) -> i64 |