submission 655326
SwordHoly · python · License unknown
Use it
Vendorable · source mirrored · license unknownView source →
No package. Vendor the mirrored source: 60 lines, June 9 Researcher Reciprocity License v1.0.
v9_online_tune_v3.py
curl "https://kernelindex.com/api/v1/implementations/kernelbot-amd-moe-mxfp4-655326?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
Reported · How evidence levels are derived →
Source and license
sourceavailable
revision digestsha256:c23c531d59481947180d906db1d0a6fdd1620530425efe17a831eff7ab179bf7
license declaredunknown
license concludedunknown
authorsSwordHoly
imported2026-08-26
Kernel source
v9_online_tune_v3.py60 lines
"""MoE v19: KSPLIT=4 for small d_expert, KSPLIT=2 for medium, none for large."""
import os
import sys
import torch
from task import input_t, output_t
from aiter import ActivationType, QuantType
from aiter.fused_moe import fused_moe
_first = True
def _setup():
global _first
if not _first:
return
_first = False
os.environ["AITER_USE_OPUS_MOE_SORTING"] = "1"
os.environ["AITER_USE_NT"] = "1"
try:
import aiter as _a
r = os.path.dirname(os.path.dirname(_a.__file__))
d = os.path.join(r, "aiter", "configs", "model_configs", "dsv3_fp4_tuned_fmoe.csv")
b = os.path.join(r, "aiter", "configs", "tuned_fmoe.csv")
p = [x for x in [b, d] if os.path.exists(x)]
if p:
os.environ["AITER_CONFIG_FMOE"] = ":".join(p)
except:
pass
def custom_kernel(data: input_t) -> output_t:
_setup()
(
hidden_states, guw, dw, gus, ds,
guw_sh, dw_sh, gus_sh, ds_sh,
topk_weights, topk_ids, config,
) = data
hp = config["d_hidden_pad"] - config["d_hidden"]
ip = config["d_expert_pad"] - config["d_expert"]
de = config["d_expert"]
# Finer-grained KSPLIT: more aggressive for very small expert dims
if de <= 256:
os.environ["AITER_KSPLIT"] = "4"
elif de <= 512:
os.environ["AITER_KSPLIT"] = "2"
else:
os.environ.pop("AITER_KSPLIT", None)
return fused_moe(
hidden_states, guw_sh, dw_sh,
topk_weights, topk_ids,
expert_mask=None,
activation=ActivationType.Silu,
quant_type=QuantType.per_1x32,
w1_scale=gus_sh, w2_scale=ds_sh,
a1_scale=None, a2_scale=None,
hidden_pad=hp, intermediate_pad=ip,
)
scrolls · 60 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