flashinfer.quantization.nvfp4_4over6_code

flashinfer.quantization.nvfp4_4over6_code(config: NVFP44Over6Config | None) → int

Pack a resolved recipe into the int64 the custom ops / TVM-FFI take.

Takes the resolved value, so FlashInfer’s own Python can never emit NVFP4_4OVER6_CODE_FROM_ENV. Layout (decoder: resolveNVFP4Recipe in nvfp4Recipe.h):

  • None -> 0 (4over6 off)

  • bit 0: always 1 (4over6 on)

  • bit 1: e4m3_max == 256

  • bits 2..3: err_mode (0 = MAE, 1 = MSE)

  • bit 4: err_use_fast_math