nx_f32_resblock.nx
buildroot/runtime/nx_f32_resblock.nx
about
nx_f32_resblock.nx -- software-f32 ResBlock (GroupNorm->SiLU->Conv 3x3, twice, + residual), R3/R7 rung.
sd-server -> Nishi migration: the canonical conv ResBlock is the repeating unit of the VAE decoder and
the SD/UNet stages. This composes the now-gated sovereign f32 bricks:
nx_f32_groupnorm + nx_f32_silu (nx_f32_activations) + nx_f32_conv2d
into: out = x + Conv2( SiLU( GN2( Conv1( SiLU( GN1(x) ) ) ) ) )
v1: C_in == C_out, 3x3 convs (pad 1, stride 1), same spatial dims, no time-embedding (the i64 ref
nx_unet_block also omits it; time-embed injection is the next addition). Real dequantized weights flow.
Buffers: flat *i64 of f32 bits. x [N,C,H,W] (preserved), out [N,C,H,W] (result), scratch [N,C,H,W]
(caller-provided intermediate). x, out, scratch MUST be three distinct buffers. gamma/beta [C], conv
weights [C,C,3,3], conv bias [C] (nullable=0).
license_tier: ORIGINAL
dependencies 6 imports · 1 importers
imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nxnx_f32_groupnorm.nxnx_f32_conv2d.nxnx_f32_activations.nx
imported by: nx_f32_vae_decode_tiny.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 21 | const NX_F32RB_OK: i64 = 0 |
functions
| 24 | func nx_f32rb_silu_inplace(buf: *i64, nel: i64) -> i64 |
| 30 | func nx_f32_resblock_forward(x: *i64, N: i64, C: i64, H: i64, W: i64, n_groups: i64, |
| 58 | func main() -> i64 |