Module fp8_lut

Module fp8_lut 

Source
Expand description

2026-09-25: Load-time weight conversions: NVFP4 and NVFP4-with-E8M0 to BF16, the E8M0 lookup, dense-FFN loading, row concatenation and the BA interleave for the GDN gate kernel.

Owner: model-layers (weight loading). Invariants: none beyond the types.

Functions§

dequant_nvfp4_to_bf16
2026-09-25: Dequantize an NVFP4 weight to a new BF16 GPU buffer, on the GPU.
gpu_concat_rows
2026-09-25: GPU-concatenate two BF16 matrices row-wise: [A; B] → [A_rows + B_rows, K], in a new buffer. Both inputs must be contiguous with the same K.
interleave_ba
2026-09-25: Interleave A (alpha) and B (beta) rows on the host into the BA layout dense_gemv_ba_gates reads, and upload it.
load_dense_ffn
2026-09-25: Load a dense (non-MoE) FFN’s gate/up/down projections as NVFP4, with transposed copies of each.