Skip to content
KernelIndex
Search⌘K

submission 688184

AlexNebula · python · License unknown

Use it

Vendorable · source mirrored · license unknownView source →

No package. Vendor the mirrored source: 37 lines, June 9 Researcher Reciprocity License v1.0.

submission.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-moe-mxfp4-688184?include=source"
interfacepython
Compatibility
measured onAMD Instinct MI355X
declared hardwareAMD Instinct MI355X
architecturesgfx950
dtypesbf16, fp32, fp8_e8m0, int32, mxfp4

Benchmark evidence

1 measurement across 1 GPU, fastest first.

Operation / workload
Hardware
Latency
Rank
Observed
AMD MXFP4 MoEsuite of 7 cases
AMD Instinct MI355X
169.7µs
#309 of 782
2026-04-01

Reported · How evidence levels are derived →

Source and license

sourceavailable
revision digestsha256:75725ec3c98f0c9a165ba3f19525fa163e766727350adba53e961abe4829802b
license declaredunknown
license concludedunknown
authorsAlexNebula
imported2026-08-15

Techniques

Extracted from the mirrored source by pattern, never inferred. Each row cites its line.

split-kLarge M → KSPLIT=0 (default CK, no split-K)

Kernel source

submission.py37 lines
"""
Dynamic AITER_KSPLIT: set per-call based on problem shape.
Small M (token*topk <= expert*2) → KSPLIT=2 (cktile, faster)
Large M → KSPLIT=0 (default CK, no split-K)
"""
import os
import torch
from task import input_t, output_t
from aiter import ActivationType, QuantType
from aiter.fused_moe import fused_moe

_ACT = ActivationType.Silu
_QT = QuantType.per_1x32

def custom_kernel(data: input_t) -> output_t:
    (hs, _, _, _, _, w1, w2, w1s, w2s, tw, ti, cfg) = data
    M = hs.shape[0]
    topk = ti.shape[1]
    E = w1.shape[0]

    # Dynamic split-K: beneficial for small batch (low parallelism)
    # Harmful for large batch (already enough parallelism, split-K adds overhead)
    # Split-K benefits small batch + few experts (more CU parallelism)
    # Harmful for large batch (enough parallelism, split-K adds overhead)
    if M <= 128 and E <= 64:
        os.environ['AITER_KSPLIT'] = '2'
    else:
        os.environ['AITER_KSPLIT'] = '0'

    return fused_moe(
        hs, w1, w2, tw, ti,
        activation=_ACT, quant_type=_QT,
        w1_scale=w1s, w2_scale=w2s,
        hidden_pad=cfg["d_hidden_pad"] - cfg["d_hidden"],
        intermediate_pad=cfg["d_expert_pad"] - cfg["d_expert"],
    )
scrolls · 37 lines total

Source code from GPU Mode and the KernelBot dataset · June 9 Researcher Reciprocity License v1.0

Best evidence level for this revision: reported

JSON