IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo struct

Struct_ep_fused_silu_nvfp4

struct Struct_ep_fused_silu_nvfp4

Implemented traitsโ€‹

AnyType, ImplicitlyDestructible

Methodsโ€‹

executeโ€‹

static def execute[fp4_dtype: DType, scales_dtype: DType, input_dtype: DType, target: StringSlice[StaticConstantOrigin]](output: ManagedTensorSlice[Output, static_spec=output.static_spec], scales: ManagedTensorSlice[Output, static_spec=scales.static_spec], input: ManagedTensorSlice[Input, static_spec=input.static_spec], row_offsets: ManagedTensorSlice[Input, static_spec=row_offsets.static_spec], scales_offsets: ManagedTensorSlice[Input, static_spec=scales_offsets.static_spec], input_scales: ManagedTensorSlice[Input, static_spec=input_scales.static_spec], context: DeviceContext)

Execute the Expert Parallelism fused SILU kernel with NVFP4 quantization.

This function launches the fused_silu_nvfp4 kernel to perform the SILU operation for all the MLPs in the EP MoE module.

This kernel will read the row offsets to determine the actual number of received tokens in the input tensor, and then only perform the SILU operation on the received tokens. Once the SILU operation is performed, the output will be quantized to the NVFP4 format. The scales tensor will be padded and zero-filled.