Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<pos: list<item: string>, kw: struct<has_mla: string, use_pdl: string, page_size: string, score_mod: string, aux_tensors: string>, out_slots: struct<3: list<item: string>, 4: list<item: string>>>
to
{'b1': Value('string'), 'b2': Value('string'), 'inplace': Value('string'), 'activation': Value('string'), 'is_gated': Value('string'), 'apply_router_weight_on_input': Value('string'), 'use_fp8_w8a8': Value('string'), 'use_int8_w8a8': Value('string'), 'use_int8_w8a16': Value('string'), 'use_int4_w4a16': Value('string'), 'per_channel_quant': Value('string'), 'w1_zp': Value('string'), 'w2_zp': Value('string'), 'a1_scale': Value('string'), 'a2_scale': Value('string'), 'block_shape': List(Value('string')), 'no_combine': Value('string'), 'routed_scaling_factor': Value('string'), 'gemm1_alpha': Value('string'), 'gemm1_limit': Value('string'), 'filter_expert': Value('string'), 'a1_q': Value('string'), 'fuse_swiglu_interleaved': Value('string'), 'gate_up_interleaved': Value('string'), 'swiglu_limit': Value('string'), 'hidden_states': Value('string'), 'w1': Value('string'), 'w2': Value('string'), 'topk_weights': Value('string'), 'topk_ids': Value('string'), 'w1_scale': Value('string'), 'w2_scale': Value('string')}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 544, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3052, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2559, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2584, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 558, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 440, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 361, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2381, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2315, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2121, in cast_array_to_feature
                  casted_array_values = _c(array.values, feature.feature)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
                  return func(array, *args, **kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2071, in cast_array_to_feature
                  _c(children[name] if name in array_fields else null_array, subfeature)
                  ~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
                  return func(array, *args, **kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2161, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<pos: list<item: string>, kw: struct<has_mla: string, use_pdl: string, page_size: string, score_mod: string, aux_tensors: string>, out_slots: struct<3: list<item: string>, 4: list<item: string>>>
              to
              {'b1': Value('string'), 'b2': Value('string'), 'inplace': Value('string'), 'activation': Value('string'), 'is_gated': Value('string'), 'apply_router_weight_on_input': Value('string'), 'use_fp8_w8a8': Value('string'), 'use_int8_w8a8': Value('string'), 'use_int8_w8a16': Value('string'), 'use_int4_w4a16': Value('string'), 'per_channel_quant': Value('string'), 'w1_zp': Value('string'), 'w2_zp': Value('string'), 'a1_scale': Value('string'), 'a2_scale': Value('string'), 'block_shape': List(Value('string')), 'no_combine': Value('string'), 'routed_scaling_factor': Value('string'), 'gemm1_alpha': Value('string'), 'gemm1_limit': Value('string'), 'filter_expert': Value('string'), 'a1_q': Value('string'), 'fuse_swiglu_interleaved': Value('string'), 'gate_up_interleaved': Value('string'), 'swiglu_limit': Value('string'), 'hidden_states': Value('string'), 'w1': Value('string'), 'w2': Value('string'), 'topk_weights': Value('string'), 'topk_ids': Value('string'), 'w1_scale': Value('string'), 'w2_scale': Value('string')}

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

headkernel-mi308-bench

Five head kernels from AgentKernelArena (head_kernels_top5_20260920, commit 8fa0d73c81e5), packaged to run on AMD Instinct MI308X (gfx942) with seeded synthetic inputs and independent PyTorch references. Intended as the starting point for source-level kernel optimization (AVO).

Task Kernel Shapes
glm-5.3-flash__fused_moe_kernel Triton FP8 W8A8 block-scale fused MoE 4
minimax-m3__gqa_share_sparse_fwd_kernel Triton sparse GQA prefill attention 38
kimi-k3__fwd_grouped_kernel_stage1 Triton MLA decode, stage 1 4
qwen3.8-2.4t__fused_recurrent_gated_delta_rule_decode Triton gated delta-rule state update 2
qwen3.8-2.4t__gemma_fused_add_rmsnorm Triton fused add + Gemma RMSNorm 2

Source

  • Tasks: AMD-AGI/AgentKernelArena, branch head_kernels_top5_20260920, commit 8fa0d73c81e55100d8e32d1963d6b247764fe56a (Apache-2.0). The upstream tasks target MI355X (gfx950), an internal MI355 image, and non-public captured inputs (reference_io.pt).
  • Selection: 16 upstream tasks were screened on MI308X; 10 run and pass, 6 need gfx950-only instructions (FP4, scaled MFMA) or do not compile for gfx942. Five of the 10 are packaged here (docs/2026-10-26_headkernel-mi308-筛选报告.md).
  • Adaptation for MI308X: seeded synthetic inputs, independent PyTorch references, a negative control, a public runtime image, and the changes listed in "Differences from the upstream tasks". The kernel sources (tasks/<task>/source/) are unchanged.

Requirements

  • MI308X (gfx942) GPU, Docker with access to /dev/kfd and /dev/dri.
  • Image lmsysorg/sglang:v0.5.18-rocm720-mi30x (public, about 23 GB compressed). It supplies every dependency. Exact versions are in versions.lock.
docker pull lmsysorg/sglang@sha256:2a4b6896f2d69e5562545b5abaaf00e8d8dbb14da736fa2f5f5bd47ce00bfb0f

Validated platform

Item Value
GPU AMD Instinct MI308X (gfx942), 80 CUs, max 1850 MHz, 192 GB HBM3
Host Linux 5.15, amdgpu driver 6.16.13, ROCm 7.2.0
Image lmsysorg/sglang@sha256:2a4b6896f2d69e5562545b5abaaf00e8d8dbb14da736fa2f5f5bd47ce00bfb0f (versions.lock)
GPU selection ROCR_VISIBLE_DEVICES (HIP_VISIBLE_DEVICES does not filter HSA agents)

Run

# correctness for all five tasks on GPU 7
GPU=7 bash scripts/run_in_container.sh python3 harness/run.py --mode correctness

# timing (runs the correctness check first for every shape)
GPU=7 bash scripts/run_in_container.sh python3 harness/run.py --mode performance

# one task, keep per-task JSON and logs
GPU=7 bash scripts/run_in_container.sh python3 harness/run.py --mode performance \
    --task qwen3.8-2.4t__gemma_fused_add_rmsnorm --out runs/rmsnorm

scripts/run_in_container.sh starts a throwaway container (--rm), mounts only this directory at /bench, selects the GPU with ROCR_VISIBLE_DEVICES, and returns file ownership to the caller. harness/run.py exits nonzero if any task fails.

Under rocprofv3 (detected via LD_PRELOAD / ROCP_TOOL_LIBRARIES), harness/run.py replaces itself with the child instead of spawning it: a GPU child process deadlocks at start-up under the profiler, which then waits forever. Profile one task at a time (--task <name>).

Inside an existing container of the same image, run python3 harness/run.py ... from the repository root. Each task also has its own entry, python3 tasks/<task>/ut/unittest.py [--mode correctness] (default: performance), which is the same run as harness/run.py --task <task>.

What is checked

For each task and each shape:

  1. The code under test is tasks/<task>/source/. The harness restores the ut/kernel_src/* symlinks to source/ (a Hugging Face download turns them into plain copies), copies the source into ut/_cand_overlay/, and verifies that the target function resolves to that copy, not to the library in the image.
  2. Inputs are generated from torch.Generator(device="cuda").manual_seed(0) at the task's real shapes (ut/meta.json, never shrunk). Index inputs (page tables, top-k blocks, expert ids) follow the kernel's contract; rules are documented in adapters/<task>.py. RMSNorm and the gated delta rule use the task's own ut/cases.py builders.
  3. Outputs must be finite and match refs/<task>.py, a plain-PyTorch reference, under the task rule |out-ref| <= tol*RMS(ref) + tol*|ref| with tol from meta.json. In-place state updates are compared too.
  4. Negative control: corrupting one element of each output must be rejected.

Performance mode then times each shape with the task's own ut/harness_lib.py:time_op (CUDA events, 10 warmup, 50 samples, median, cache flushed before each sample, graph replay when the deployment regime uses graphs) and prints

GEAK_RESULT_LATENCY_MS=<ms> (<shape id>)

Timing uses the same inputs with verify_inputs=False where the task supports it (RMSNorm): the input-integrity probe clones and compares every input, which would add device work to the timed window and block graph capture. If a task requests graph timing and capture fails, the harness prints HK_WARNING graph capture failed ... and the per-shape JSON records timer=cuda_event instead of cuda_event_graph.

Baseline (original kernels)

Medians of three performance runs on one idle MI308X (results/baseline_mi308x.csv, one row per shape, with the run-to-run spread and the source run). GLM uses the FNUZ-weight run of 2026-11-03; the other tasks use the fixed-timing run of 2026-10-29.

Task Shapes Timer Fastest shape (ms) Slowest shape (ms) Geomean (ms)
glm-5.3-flash__fused_moe_kernel 4 eager 0.537 6.310 1.085
minimax-m3__gqa_share_sparse_fwd_kernel 38 graph 0.025 26.25 15.80
kimi-k3__fwd_grouped_kernel_stage1 4 graph 0.037 2.523 0.351
qwen3.8-2.4t__fused_recurrent_gated_delta_rule_decode 2 graph 0.258 0.310 0.283
qwen3.8-2.4t__gemma_fused_add_rmsnorm 2 graph 0.017 0.262 0.067

How to compare:

  • Absolute latencies depend on the node and on load from neighbouring GPUs (differences of tens of percent have been seen). Use the table to check that a setup is sane (within about 10%), not as a target.
  • To measure a speedup, time the original and the candidate on the same GPU in the same session, interleaved (A B B A), and report per-shape ratios and their geomean.
  • Shapes of a few tens of microseconds vary by up to about 8% between runs (Kimi oracle_bs1_ctx395); GLM decode under eager timing had one 39% outlier run (rand_m19_decode), so take the median of at least three runs.

AVO reference results

The five tasks were optimized at source level with AVO. Optimized kernels are not distributed: rerun AVO with the version and configuration below, and verify the result as described here.

AVO version:

Item Value
Repository AMD-BRAIN-Internal/PerfSkills-avo (AMD internal)
Branch GEAK-v4-integrated
Commit 01b60f937a24b3235f2ea897fda9bdc868f0d9bf
Entry python3 avo-workflow/run_geak_avo.py handoff.json result.json (validate first with --dry-run)
Agent Claude Code 2.1.308 (Claude Opus 5.5), Node 22

Configuration (one AVO run per task, two tasks in parallel on one 8-GPU node):

Setting Value
operator team (default start_policy=diverse)
GPUs per task 4 (gpu_ids 0,1,2,3 or 4,5,6,7)
budget_s 43200 (12 h, counted from workflow start; 10% is reserved for finalization)
kernel_path the repository root (AVO copies it; the harness needs harness/, refs/, adapters/)
hw gfx942
apply_to_original false
task see docs/avo_task_template.md

Results (speedup = original latency / optimized latency; per-shape median of five interleaved rounds on one GPU, then the geomean over all shapes; every shape passed the correctness check and the negative control):

Task Speedup
minimax-m3__gqa_share_sparse_fwd_kernel 4.39x
glm-5.3-flash__fused_moe_kernel 3.19x
kimi-k3__fwd_grouped_kernel_stage1 2.64x
qwen3.8-2.4t__gemma_fused_add_rmsnorm 1.26x
qwen3.8-2.4t__fused_recurrent_gated_delta_rule_decode 1.02x

Notes for rerunning AVO on MI308X with this commit:

  • Tell AVO the GPU has 80 CUs. Its knowledge file reads the CU count with rocminfo | grep -m1, which returns the CPU core count on this node, and its roofline table for gfx942 is MI300X.
  • Tasks with many shapes (MiniMax, 38) can stop with TypeError: (perCase || []).map is not a function after a commit. Committed versions stay in avo_repo (tags avo-vN) and can be verified.
  • Review every patch: no output caching, no work skipped on repeated inputs or the fixed seed, no shape-specialised branches, no lowered precision.

Differences from the upstream tasks

  • No reference_io.pt: the upstream captured tensors are in non-public OCI storage. Synthetic inputs change timing (sparse attention selections are more spread out; MoE routing is uniform or synthetic), not whether a kernel runs and is correct. Speedups are valid for these inputs only.
  • Hardware is MI308X, not MI355X. Shapes are kept as captured on MI355X (Kimi split counts assume 256 CUs).
  • GLM fused MoE: activations are quantized to e4m3fnuz on gfx942 (MI355X uses e4m3fn). Since 2026-11-03 the expert weights are also given to the kernel as e4m3fnuz on gfx942, converted with sglang's normalize_e4m3fn_to_e4m3fnuz, as sglang does at model load on MI300-series GPUs. Before that date they were e4m3fn, and the original ran about 30x slower than in deployment; GLM speedups measured before that date are not comparable (results/validation_20261103_glm_fnuz). The model path points to model_cfg/GLM-5.2-FP8-config (configuration only). SGLANG_USE_AITER=0 is forced by harness/run.py: the image defaults to 1, and that path drops routed_scaling_factor.
  • kimi-k3__fwd_grouped_kernel_stage1 starts from a prior optimized candidate, not upstream code.
  • qwen3.8-2.4t__gemma_fused_add_rmsnorm: the upstream contract text rounds the residual sum to BF16 before the norm, while the source computes the norm from the unrounded FP32 sum. The reference follows the source. Optimized versions must keep the source behavior.
  • Each task's ut/unittest.py is the benchmark entry described in "Run". The upstream scripts that need the non-public captured data (ut/unittest.py, ut/leg_runner.py, scripts/task_runner.py) were removed; the Kimi seam helpers they held are in ut/cases.py.
  • config.yaml commands call harness/run.py.

Layout

tasks/      five task directories (source/ is the editable kernel; ut/unittest.py is the entry)
adapters/   synthetic input builders (GLM, Kimi, MiniMax)
refs/       PyTorch references
harness/    run.py (entry) and child.py (one task per fresh process)
scripts/    run_in_container.sh, compare_runs.py (timing spread across runs)
model_cfg/  GLM configuration files used by the GLM task
results/    screening_20261026 (16 tasks, rocm/atom image), validation runs, baseline_mi308x.csv
docs/       screening plan/report (Chinese), avo_task_template.md (AVO task prompt)
Downloads last month
193