Skip to content

Registry presets

Bundled presets register selected custom operation forms for structural parsing and lowering. Each includes the core module and function grammar. Use them to expose operands, result types, attributes, and supported regions to queries.

Load a preset in the CLI with zirium --preset stablehlo --strict QUERY INPUT. Use --list-presets to discover names. Repeat --preset to combine dialects; it can also be combined with --registry files. --strict rejects recovered custom operations instead of warning about incomplete query information.

Load a preset in Python with DialectRegistry.from_name("stablehlo"), or combine presets in a JSON registry:

{
"presets": ["scf", "arith", "memref"],
"builtins": [],
"operation_shapes": []
}

Pass the file to zirium --registry registry.json ... or DialectRegistry.from_file("registry.json"). See custom formats for configuration and API details.

Use these exact names in configuration. Each links to the registered operations and their grammars.

Area Presets
Machine learning stablehlo, tosa
Functions and control flow func, cf, scf, affine, async
Arithmetic arith, math, complex, index, quant
Tensors and memory linalg, tensor, memref, bufferization, shape, sparse_tensor, vector, ptr
Parallel and distributed execution acc (OpenACC), omp (OpenMP), gpu, mpi, shard
GPU targets amdgpu, nvgpu, nvvm, rocdl, spirv, xegpu, xevm
CPU targets amx, arm_neon, arm_sme, arm_sve, x86vector
Lowering and program representation llvm, emitc, ml_program, wasmssa, ub
Transformation and constraints transform, smt
Core-only placeholders dlti, irdl, pdl, pdl_interp

For the installed release’s names, use DialectRegistry.preset_names() in Python or DialectRegistry::preset_names() in Rust. Core-only placeholders add no dialect-specific custom grammar; their operations continue through recovery. The func preset is also equivalent to core, which already includes its registered function forms.

Registration covers the spellings matched by an operation’s grammar; optional clauses or other variants may require recovery. Generic quoted operations need no preset. Dialect types and attributes generally retain balanced payloads as opaque values.

Some presets cover broad groups of operations: StableHLO includes elementwise operations, typed signatures, and region-bearing forms such as reduce, sort, and while; SCF includes structured regions and loop header bindings; Linalg includes structured and generated named operations. Other presets cover a small subset. For example, wasmssa registers only wasmssa.return beyond core.

Common limits affect how you can use these presets:

  • Compact signatures that infer operand or result types may require recovery. A printed container or operand type cannot safely be treated as a result type.
  • Positional modifiers, mixed static/dynamic indices, and dictionaries after regions or type trailers may fall outside the registered grammar. For example, several Arith operations accept their default form but recover variants with positional overflow, exact, or fast-math modifiers.
  • Unsupported custom forms use best-effort recovery. Inspect parsing and lowering diagnostics before relying on semantic structure or editing output.
  • Compact StableHLO reductions using applies retain their explicit textual structure without synthesizing an implicit reducer body. Dot dimension pairs retain both sides in attribute projection and print generically as nested arrays. These are structural representations of the custom clauses.

Presets provide structural support. Full dialect verification, type inference, execution, target checks, and serialization are outside their scope. StableHLO support does not include VHLO or portable-artifact compatibility.

The preset definitions were checked against LLVM 22.1.0, except StableHLO, which was checked against StableHLO 1.20.1. Preset names are unversioned and track Zirium releases; they do not claim complete coverage of those upstream versions.