flashinfer.comm._ulysses_lowp.quant_v_fp8_with_scale

flashinfer.comm._ulysses_lowp.quant_v_fp8_with_scale(v: Tensor, v_scale_global: Tensor, scale_max: float = 2.25, *, enable_pdl: bool | None = None) → Tensor

Quantize canonical NHD V to canonical E4M3 bit patterns.

Parameters:
  • v – Contiguous [B, S, H, D] BF16/FP16 CUDA tensor with a 16-byte-aligned data pointer.

  • v_scale_global – Contiguous [B, H, D] FP32 global per-channel divisor. The payload contract requires it to be produced as global_amax / 2.25 from BF16/FP16 V values; this preserves pinned Sage FP8 bits. Its data pointer must be 16-byte aligned.

  • scale_max – Format guard. Only 2.25 is supported.

  • enable_pdl – Whether to enable Programmatic Dependent Launch. None selects according to device support.

Returns:

A contiguous [B, S, H, D] uint8 tensor containing raw torch.float8_e4m3fn bit patterns.