Beaver.MLIR.Transform.Schedule (beaver v0.4.8)

Copy Markdown

Deterministic discovery and resolution of Transform Tune schedules.

Schedules can be authored using Elixir DSL (Beaver.MLIR.Transform.Schedule.DSL) or supplied as raw MLIR modules. A resolved schedule is immutable BEAM data: MLIR bytecode, printable text, the active choices, and a stable digest. Resolution writes choices back to transform.tune.knob and transform.tune.alternatives, so replay does not invoke the resolver or repeat a search.

Summary

Functions

Discovers Tune choices and SMT constraints without executing the schedule.

Returns the stable identity included in incremental compilation cache keys.

Returns exported SMT constraints even when no solver is configured.

Enumerates active Tune choices in stable IR and option order.

Resolves active Tune choices from a map, function, or resolver behaviour.

Returns the entry-point symbol carried by a resolved schedule.

Serializes a resolved schedule as replayable MLIR bytecode or text.

Types

input()

@type input() ::
  Beaver.MLIR.Module.t()
  | Beaver.MLIR.Operation.t()
  | binary()
  | {:text, binary()}
  | {:bytecode, binary()}
  | Beaver.MLIR.Transform.Schedule.Resolved.t()

Functions

analyze(input, opts \\ [])

Discovers Tune choices and SMT constraints without executing the schedule.

cache_identity(schedule)

@spec cache_identity(Beaver.MLIR.Transform.Schedule.Resolved.t() | binary()) ::
  tuple()

Returns the stable identity included in incremental compilation cache keys.

constraints(input, opts \\ [])

@spec constraints(
  input(),
  keyword()
) ::
  {:ok, [Beaver.MLIR.Transform.Schedule.Constraint.t()]}
  | {:error, Beaver.MLIR.Transform.Error.t()}

Returns exported SMT constraints even when no solver is configured.

enumerate(input, opts \\ [])

@spec enumerate(
  input(),
  keyword()
) :: {:ok, [map()]} | {:error, Beaver.MLIR.Transform.Error.t()}

Enumerates active Tune choices in stable IR and option order.

Existing selections remain fixed. Choices nested in an alternatives region are included only when that region is selected by the candidate. Arbitrary non-array knob domains remain inspectable but require an explicit resolver.

resolve(input, resolver, opts \\ [])

@spec resolve(input(), map() | function() | module() | {module(), term()}, keyword()) ::
  {:ok, Beaver.MLIR.Transform.Schedule.Resolved.t()}
  | {:error, Beaver.MLIR.Transform.Error.t()}

Resolves active Tune choices from a map, function, or resolver behaviour.

resolve!(input, resolver, opts \\ [])

@spec resolve!(input(), map() | function() | module() | {module(), term()}, keyword()) ::
  Beaver.MLIR.Transform.Schedule.Resolved.t()

Bang variant of resolve/3.

sequence(arg1)

Returns the entry-point symbol carried by a resolved schedule.

serialize(resolved, atom)

@spec serialize(Beaver.MLIR.Transform.Schedule.Resolved.t(), :bytecode | :text) ::
  binary()

Serializes a resolved schedule as replayable MLIR bytecode or text.