pub struct CompileOptions {
pub precision: Precision,
pub policy: Option<PrecisionPolicy>,
pub dce: bool,
pub constant_folding: bool,
pub verbose: bool,
pub fusion_target: Option<FusionTarget>,
pub fusion_opts: FusionOptions,
pub arena_alignment: usize,
pub assert_fusion_clean: bool,
pub supported_ops: Option<&'static [OpKind]>,
pub dim_binding: Option<DimBinding>,
pub kernel_dispatch: KernelDispatchConfig,
}Expand description
All knobs the compile pipeline understands. Add new fields here rather than introducing new compile entry points.
Fields§
§precision: PrecisionTarget numeric precision for execution. Default: F32.
policy: Option<PrecisionPolicy>Optional per-op precision policy (mixed precision rewrite).
dce: boolRun dead-code elimination as part of compile. Default: true.
constant_folding: boolRun constant folding. Default: true (cheap, only helps).
verbose: boolVerbose pass logging. Equivalent to RLX_VERBOSE=1 or
[rlx_ir::env::set("RLX_VERBOSE", "1")].
fusion_target: Option<FusionTarget>Override fusion pipeline target (default: inferred from device).
fusion_opts: FusionOptionsPer-target fusion toggles (Metal env overrides, skip fusion, …).
arena_alignment: usizeArena alignment for buffer planning. Default: 64.
assert_fusion_clean: boolPanic at compile time if fusion diagnostics report missed patterns.
supported_ops: Option<&'static [OpKind]>Backend op claim set for backend-aware fusion + post-fusion
legalization. Set by [Backend::compile] implementations.
dim_binding: Option<DimBinding>When set, specialize symbolic dims before backend lowering.
kernel_dispatch: KernelDispatchConfigNative vs common IR lowering (KernelDispatchConfig, RLX_KERNEL_DISPATCH=common).
Implementations§
Source§impl CompileOptions
impl CompileOptions
pub fn new() -> Self
pub fn precision(self, p: Precision) -> Self
pub fn policy(self, p: PrecisionPolicy) -> Self
pub fn no_policy(self) -> Self
pub fn with_dce(self, on: bool) -> Self
pub fn with_constant_folding(self, on: bool) -> Self
pub fn with_verbose(self, on: bool) -> Self
pub fn fusion_target(self, target: FusionTarget) -> Self
pub fn fusion_opts(self, opts: FusionOptions) -> Self
pub fn arena_alignment(self, bytes: usize) -> Self
pub fn supported_ops(self, ops: &'static [OpKind]) -> Self
pub fn assert_fusion_clean(self, on: bool) -> Self
pub fn dim_binding(self, binding: DimBinding) -> Self
pub fn kernel_dispatch(self, policy: KernelDispatchPolicy) -> Self
pub fn kernel_dispatch_config(self, config: KernelDispatchConfig) -> Self
Sourcepub fn force_common_kinds(self, kinds: &'static [OpKind]) -> Self
pub fn force_common_kinds(self, kinds: &'static [OpKind]) -> Self
Force listed logical kernels to use common IR even when native is in supported_ops.
Sourcepub fn force_native_kinds(self, kinds: &'static [OpKind]) -> Self
pub fn force_native_kinds(self, kinds: &'static [OpKind]) -> Self
Keep listed logical kernels native even under ForceCommon / missing from supported_ops.
Trait Implementations§
Source§impl Clone for CompileOptions
impl Clone for CompileOptions
Source§fn clone(&self) -> CompileOptions
fn clone(&self) -> CompileOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompileOptions
impl Debug for CompileOptions
Auto Trait Implementations§
impl Freeze for CompileOptions
impl RefUnwindSafe for CompileOptions
impl Send for CompileOptions
impl Sync for CompileOptions
impl Unpin for CompileOptions
impl UnsafeUnpin for CompileOptions
impl UnwindSafe for CompileOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more