IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

nvfp4_kv_group_scale

def nvfp4_kv_group_scale(amax: Float32) -> Float32

Returns the E4M3 scale of one 16-element NVFP4 KV cache group.

The scale is E4M3(max(amax, 1e-12) / 6) clamped to [2^-9, 448], with the per-tensor scale fixed at 1. It is returned widened to float32.

Args:

  • ​amax (Float32): The largest magnitude in the group.

Returns:

Float32: The group scale, exactly representable in E4M3.

Was this page helpful?