Dataset Viewer
Auto-converted to Parquet Duplicate
id
string
dialect
string
source_benchmark
string
source_id
string
nl
string
canonical_fn_name
string
canonical_signature
string
inputs
list
result_type
string
expected_output
float64
expected_stdout_regex
string
memref_inputs
list
memref_print
list
scalar_inputs
list
iree_inputs
list
expected_output_pattern
string
F01_arith_add
arith+func
mlir_spec_150
001_add-two-ints
Write a function `add` that takes two i32 values and returns their sum.
add
(i32, i32) -> i32
[ { "type": "i32", "value": 7 }, { "type": "i32", "value": 3 } ]
i32
10
^10\b
null
null
null
null
null
F02_arith_mul_i64
arith+func
mlir_spec_150
003_multiply-ints
Write a function `mul` that multiplies two i64 values and returns their product.
mul
(i64, i64) -> i64
[ { "type": "i64", "value": 6 }, { "type": "i64", "value": 7 } ]
i64
42
^42\b
null
null
null
null
null
F03_arith_addf_f32
arith+func
mlir_spec_150
004_add-floats
Write a function `addf` that takes two f32 values and returns their sum.
addf
(f32, f32) -> f32
[ { "type": "f32", "value": 1.5 }, { "type": "f32", "value": 2.25 } ]
f32
3.75
^3\.75\b
null
null
null
null
null
F04_arith_const42
arith+func
mlir_spec_150
005_integer-constant
Write a function that returns the constant integer 42 as an i32.
const42
() -> i32
[]
i32
42
^42\b
null
null
null
null
null
F05_arith_chain_addmul
arith+func
mlir_spec_150
008_chain-add-then-multiply
Write a function that computes `(a + b) * c` on i32 inputs and returns the i32 result.
fma_like
(i32, i32, i32) -> i32
[ { "type": "i32", "value": 2 }, { "type": "i32", "value": 3 }, { "type": "i32", "value": 4 } ]
i32
20
^20\b
null
null
null
null
null
F06_arith_band
arith+func
mlir_spec_150
016_bitwise-and
Write a function that computes the bitwise AND of two i32 values.
band
(i32, i32) -> i32
[ { "type": "i32", "value": 12 }, { "type": "i32", "value": 10 } ]
i32
8
^8\b
null
null
null
null
null
F07_arith_inc
arith+func
mlir_spec_150
033_increment-by-one
Write a function that takes an i32 and returns it incremented by 1.
inc
(i32) -> i32
[ { "type": "i32", "value": 41 } ]
i32
42
^42\b
null
null
null
null
null
F08_arith_double_f32
arith+func
mlir_spec_150
034_double-value
Write a function that doubles an f32 value.
dbl
(f32) -> f32
[ { "type": "f32", "value": 3.5 } ]
f32
7
^7(\.0+)?\b
null
null
null
null
null
F09_arith_square_i32
arith+func
mlir_spec_150
040_square
Write a function that computes x squared for an i32 x.
square
(i32) -> i32
[ { "type": "i32", "value": 7 } ]
i32
49
^49\b
null
null
null
null
null
F10_arith_cube_f32
arith+func
mlir_spec_150
041_cube
Write a function that computes x * x * x for an f32 x.
cube
(f32) -> f32
[ { "type": "f32", "value": 2 } ]
f32
8
^8(\.0+)?\b
null
null
null
null
null
F11_linalg_fill_zero_1d
linalg+memref
linalg_spec_30
06_fill-zero-1d
Write a function that fills a 1-D f32 memref with zeros.
f0
(memref<?xf32>) -> ()
null
null
null
data\s*=\s*\[\s*0(\.0+)?\s*,\s*0(\.0+)?\s*,\s*0(\.0+)?\s*,\s*0(\.0+)?\s*\]
[ { "name": "m", "shape": [ 4 ], "dtype": "f32", "init": "alloc_only" } ]
[ { "name": "m", "shape": [ 4 ], "dtype": "f32" } ]
null
null
null
F12_linalg_fill_value_2d
linalg+memref
linalg_spec_30
07_fill-value-param
Write a function that fills a 2-D f32 memref with a given f32 value passed as a parameter.
fp
(f32, memref<?x?xf32>) -> ()
null
null
null
(5(\.0+)?[^\d]+){4}
[ { "name": "m", "shape": [ 2, 2 ], "dtype": "f32", "init": "alloc_only" } ]
[ { "name": "m", "shape": [ 2, 2 ], "dtype": "f32" } ]
[ { "type": "f32", "value": 5 } ]
null
null
F13_linalg_fill_i32_const
linalg+memref
linalg_spec_30
08_fill-i32
Write a function that fills a 1-D i32 memref with the integer constant 7.
f7
(memref<?xi32>) -> ()
null
null
null
(7[^\d]+){4}
[ { "name": "m", "shape": [ 4 ], "dtype": "i32", "init": "alloc_only" } ]
[ { "name": "m", "shape": [ 4 ], "dtype": "i32" } ]
null
null
null
F14_linalg_copy_1d
linalg+memref
linalg_spec_30
09_copy-1d
Write a function that copies a 1-D f32 memref into another 1-D f32 memref of the same shape.
c1
(memref<?xf32>, memref<?xf32>) -> ()
null
null
null
(3\.5[^\d]+){4}
[ { "name": "s", "shape": [ 4 ], "dtype": "f32", "init": "fill", "fill_value": 3.5 }, { "name": "d", "shape": [ 4 ], "dtype": "f32", "init": "alloc_only" } ]
[ { "name": "d", "shape": [ 4 ], "dtype": "f32" } ]
null
null
null
F15_linalg_copy_2d_static
linalg+memref
linalg_spec_30
10_copy-2d-static
Write a function that copies a 4x4xf32 static memref into another 4x4xf32 memref.
c2
(memref<4x4xf32>, memref<4x4xf32>) -> ()
null
null
null
(1\.25[^\d]+){4}
[ { "name": "s", "shape": [ 4, 4 ], "dtype": "f32", "init": "fill", "fill_value": 1.25, "static": true }, { "name": "d", "shape": [ 4, 4 ], "dtype": "f32", "init": "alloc_only", "static": true } ]
[ { "name": "d", "shape": [ 4, 4 ], "dtype": "f32" } ]
null
null
null
F16_linalg_add_elemwise
linalg+memref
linalg_spec_30
20_add-elemwise
linalg.add elementwise on two 1-D f32 memrefs
ae
(memref<?xf32>, memref<?xf32>, memref<?xf32>) -> ()
null
null
null
(5(\.0+)?[^\d]+){4}
[ { "name": "a", "shape": [ 4 ], "dtype": "f32", "init": "fill", "fill_value": 2 }, { "name": "b", "shape": [ 4 ], "dtype": "f32", "init": "fill", "fill_value": 3 }, { "name": "c", "shape": [ 4 ], "dtype": "f32", "init": "al...
[ { "name": "c", "shape": [ 4 ], "dtype": "f32" } ]
null
null
null
F17_linalg_mul_elemwise_2d
linalg+memref
linalg_spec_30
22_mul-elemwise-2d
linalg.mul elementwise on two 2-D f32 memrefs (2x2)
me
(memref<?x?xf32>, memref<?x?xf32>, memref<?x?xf32>) -> ()
null
null
null
(12(\.0+)?[^\d]+){4}
[ { "name": "a", "shape": [ 2, 2 ], "dtype": "f32", "init": "fill", "fill_value": 3 }, { "name": "b", "shape": [ 2, 2 ], "dtype": "f32", "init": "fill", "fill_value": 4 }, { "name": "c", "shape": [ 2, 2 ], "dty...
[ { "name": "c", "shape": [ 2, 2 ], "dtype": "f32" } ]
null
null
null
F18_linalg_matmul_2x2
linalg+memref
linalg_spec_30
02_matmul-static-2x2
Write a function that performs matrix multiplication of two 2x2 f32 memrefs and writes the result into the output 2x2 f32 memref.
mm22
(memref<2x2xf32>, memref<2x2xf32>, memref<2x2xf32>) -> ()
null
null
null
(2(\.0+)?[^\d]+){4}
[ { "name": "A", "shape": [ 2, 2 ], "dtype": "f32", "init": "fill", "fill_value": 1, "static": true }, { "name": "B", "shape": [ 2, 2 ], "dtype": "f32", "init": "fill", "fill_value": 1, "static": true }, { "name": "C", "sh...
[ { "name": "C", "shape": [ 2, 2 ], "dtype": "f32" } ]
null
null
null
F19_linalg_exp_elemwise
linalg+memref
linalg_spec_30
24_exp-elemwise
linalg.exp elementwise on a 1-D f32 memref
ee
(memref<?xf32>, memref<?xf32>) -> ()
null
null
null
(1(\.0+)?[^\d]+){4}
[ { "name": "x", "shape": [ 4 ], "dtype": "f32", "init": "fill", "fill_value": 0 }, { "name": "y", "shape": [ 4 ], "dtype": "f32", "init": "alloc_only" } ]
[ { "name": "y", "shape": [ 4 ], "dtype": "f32" } ]
null
null
null
F20_linalg_abs_elemwise
linalg+memref
linalg_spec_30
26_abs-elemwise
linalg.abs elementwise on a 1-D f32 memref
ab
(memref<?xf32>, memref<?xf32>) -> ()
null
null
null
(2\.5[^\d]+){4}
[ { "name": "x", "shape": [ 4 ], "dtype": "f32", "init": "fill", "fill_value": -2.5 }, { "name": "y", "shape": [ 4 ], "dtype": "f32", "init": "alloc_only" } ]
[ { "name": "y", "shape": [ 4 ], "dtype": "f32" } ]
null
null
null
F21_stablehlo_add_1d_f32
stablehlo
stablehlo_spec_30
01_add-1d
Write a function that adds two 1-D f32 tensors of 16 elements using stablehlo.add.
a
(tensor<16xf32>, tensor<16xf32>) -> tensor<16xf32>
null
null
null
null
null
null
null
[ "16xf32=1.0", "16xf32=2.0" ]
16xf32=3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
F22_stablehlo_multiply_2d
stablehlo
stablehlo_spec_30
04_multiply-2d
Write a function that multiplies two 4x4 f32 tensors elementwise using stablehlo.multiply.
mul
(tensor<4x4xf32>, tensor<4x4xf32>) -> tensor<4x4xf32>
null
null
null
null
null
null
null
[ "4x4xf32=3.0", "4x4xf32=4.0" ]
4x4xf32=\[12 12 12 12\]\[12 12 12 12\]\[12 12 12 12\]\[12 12 12 12\]
F23_stablehlo_subtract_1d_i32
stablehlo
stablehlo_spec_30
03_subtract-1d-i32
Write a function that subtracts two 1-D i32 tensors of 16 elements using stablehlo.subtract.
s
(tensor<16xi32>, tensor<16xi32>) -> tensor<16xi32>
null
null
null
null
null
null
null
[ "16xi32=10", "16xi32=4" ]
16xi32=6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
F24_stablehlo_abs_f32
stablehlo
stablehlo_spec_30
06_abs-f32
Write a function that computes the elementwise absolute value of a 1-D f32 tensor.
ab
(tensor<16xf32>) -> tensor<16xf32>
null
null
null
null
null
null
null
[ "16xf32=-2.5" ]
16xf32=2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5
F25_stablehlo_exp_1d
stablehlo
stablehlo_spec_30
07_exp-1d
Write a function that computes the elementwise exponential of a 1-D f32 tensor.
ex
(tensor<16xf32>) -> tensor<16xf32>
null
null
null
null
null
null
null
[ "16xf32=0.0" ]
16xf32=1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
F26_stablehlo_transpose_2d
stablehlo
stablehlo_spec_30
09_transpose-2d
Write a function that transposes a 4x8 f32 tensor producing an 8x4 tensor.
t
(tensor<4x8xf32>) -> tensor<8x4xf32>
null
null
null
null
null
null
null
[ "4x8xf32=1.5" ]
8x4xf32=
F27_stablehlo_add_2d_dyn
stablehlo
stablehlo_spec_30
02_add-2d-dynamic
Write a function that adds two 2x4 f32 tensors using stablehlo.add.
a2
(tensor<2x4xf32>, tensor<2x4xf32>) -> tensor<2x4xf32>
null
null
null
null
null
null
null
[ "2x4xf32=2.0", "2x4xf32=2.5" ]
2x4xf32=\[4.5 4.5 4.5 4.5\]\[4.5 4.5 4.5 4.5\]
F28_stablehlo_divide_f64
stablehlo
stablehlo_spec_30
05_divide-f64
Write a function that divides two 1-D f64 tensors of 8 elements using stablehlo.divide.
d
(tensor<8xf64>, tensor<8xf64>) -> tensor<8xf64>
null
null
null
null
null
null
null
[ "8xf64=12.0", "8xf64=4.0" ]
8xf64=3 3 3 3 3 3 3 3
F29_stablehlo_dot_matmul
stablehlo
stablehlo_spec_30
17_dot_general-matmul
Write a function that performs a matmul of two f32 tensors via stablehlo.dot_general (lhs 4x8, rhs 8x4).
dm
(tensor<4x8xf32>, tensor<8x4xf32>) -> tensor<4x4xf32>
null
null
null
null
null
null
null
[ "4x8xf32=1.0", "8x4xf32=1.0" ]
4x4xf32=\[8 8 8 8\]\[8 8 8 8\]\[8 8 8 8\]\[8 8 8 8\]
F30_stablehlo_transpose_3d
stablehlo
stablehlo_spec_30
10_transpose-3d
Write a function that transposes a 2x3x4 f32 tensor with permutation [2, 0, 1] producing a 4x2x3 tensor.
t3
(tensor<2x3x4xf32>) -> tensor<4x2x3xf32>
null
null
null
null
null
null
null
[ "2x3x4xf32=2.5" ]
4x2x3xf32=

MLIR-Functional-Reference-30

Accepted to NeurIPS 2026 (Evaluations & Datasets Track)
Paper (arXiv) · Code (GitHub) · All six datasets (collection)

Hand-authored functional-correctness reference set for arith, linalg+memref, and stablehlo (n=30, 10 per dialect).

This dataset is one of six NL→MLIR benchmarks released with the NeurIPS 2026 Evaluations & Datasets Track paper Cross-Dialect Generalization Without Retraining: Benchmarks and Evaluation of Schema-Derived Constrained Decoding for MLIR (arXiv:2607.18254). The full suite — MLIR-Spec-150, Linalg-Spec-30, StableHLO-Spec-30, StableHLO-Held-Out-200, StableHLO-OutOfGrammar-25, MLIR-Functional-Reference-30 — totals 465 instances across three MLIR dialects.

Composition

  • Instances: 30
  • Format: one JSON record per line in data/test.jsonl
  • Schema: fields = canonical_fn_name, canonical_signature, dialect, expected_output, expected_output_pattern, expected_stdout_regex, id, inputs, iree_inputs, memref_inputs, memref_print, nl, result_type, scalar_inputs, source_benchmark, source_id
  • Verifier: dialect-specific lowering pipelines + execution comparison; see eval/functional/run_functional.py for the per-dialect runners
  • License: Apache-2.0 (SPDX: Apache-2.0). No third-party IP restrictions.

Loading

from datasets import load_dataset
ds = load_dataset("plawanrath/MLIR-Functional-Reference-30", split="test")
print(ds[0])

Each record is a self-contained natural-language→MLIR pair; verify-valid pass-rate under the dialect's verifier is the primary evaluation metric.

Source format

The JSONL file at data/test.jsonl is the canonical HuggingFace interface. It is exported 1-to-1 from the source records (references.json) in eval/functional/ of the code repository.

Datasheet

Key points (full Gebru-style datasheet: docs/datasheets/datasheet.md):

  • All reference MLIR programs are verifier-clean at the time of release.
  • Hand-authored (no crowdsourcing, no LLM-authored references).
  • Test-only — fine-tuning on these benchmarks contaminates future evaluation and is explicitly out of scope.

Croissant metadata

croissant.json in this repository is the dataset's MLCommons Croissant 1.1 metadata, including the Responsible AI (rai:) and provenance (prov:) fields required by the NeurIPS 2026 Evaluations & Datasets Track. (Hugging Face's auto-generated Croissant endpoint covers the core fields only.)

Code

Generation, verification and evaluation code: github.com/plawanrath/slm-to-mlir-constrained-emitter.

Citation

@inproceedings{rath2026crossdialect,
  title     = {Cross-Dialect Generalization Without Retraining: Benchmarks and Evaluation of Schema-Derived Constrained Decoding for {MLIR}},
  author    = {Rath, Plawan Kumar},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS), Evaluations and Datasets Track},
  year      = {2026},
  eprint    = {2607.18254},
  archivePrefix = {arXiv}
}

License

Apache-2.0 (see LICENSE). Copyright 2026 Plawan Kumar Rath.

Downloads last month
18

Collection including plawanrath/MLIR-Functional-Reference-30

Paper for plawanrath/MLIR-Functional-Reference-30