pub struct CompilationConfig {
pub logger: LoggerConfig<CompilationLogLevel>,
pub cache: bool,
pub check_mode: BoundsCheckMode,
pub f16_evaluation: Option<F16Evaluation>,
pub dump_dir: Option<PathBuf>,
pub time_passes: bool,
pub debug_info: Option<DebugInfo>,
pub spirv_debug_format: SpirvDebugFormat,
pub source_cache: Option<PathBuf>,
pub parallelism: Option<usize>,
}Expand description
Configuration for compilation settings in CubeCL.
Fields§
§logger: LoggerConfig<CompilationLogLevel>Logger configuration for compilation logs, using binary log levels.
cache: boolWhether compiled kernels are cached in the active environment.
check_mode: BoundsCheckModeControls whether kernel launches enforce bounds checks.
f16_evaluation: Option<F16Evaluation>How far the CPU runtime carries an f16 intermediate in f32 before rounding it. None
chooses by whether the host computes in f16 directly. Other runtimes ignore it.
dump_dir: Option<PathBuf>Directory for compiler dumps. Each kernel writes its IR after every compiler pass, and
its final source, to a subdirectory named after the kernel. Set by CUBECL_DEBUG_PLIRON.
time_passes: boolLog how long each compiler pass takes, at the info level. Set by CUBECL_TIME_PASSES.
debug_info: Option<DebugInfo>The most debug data a kernel may carry. None keeps what the cargo profile and the kernel
ask for. It can only lower that level. Set by CUBECL_DEBUG_INFO.
spirv_debug_format: SpirvDebugFormatThe format of the debug data in SPIR-V kernels. Set by CUBECL_SPIRV_DEBUG_FORMAT.
source_cache: Option<PathBuf>A directory for the source text of kernels with full debug data. When no directory on this
computer has the source files of a kernel, cubecl writes the texts into this directory, and
the debug data points to them. None writes no files. Set by CUBECL_SOURCE_CACHE.
parallelism: Option<usize>How many threads a server compiles a queue of kernels on — see
LaunchMode::Queue. The
queue itself is as long as what was queued; each thread takes the next
kernel as it finishes one. None uses every core the process may run
on; a smaller number leaves cores to other work. It does not bound
memory: a batch holds every queued kernel’s artifacts until it ends.
Implementations§
Source§impl CompilationConfig
impl CompilationConfig
Sourcepub fn resolve_debug_info(&self, requested: DebugInfo) -> DebugInfo
pub fn resolve_debug_info(&self, requested: DebugInfo) -> DebugInfo
The debug data of a kernel that asks for requested: at least PROFILE_DEBUG_INFO, at
most debug_info.
Sourcepub fn parallelism(&self) -> usize
pub fn parallelism(&self) -> usize
How many threads compile at once: the configured count, or every core the process may run on. Never zero, and one without threads — on wasm too, whatever is configured, since it cannot spawn them.
Trait Implementations§
Source§impl Clone for CompilationConfig
impl Clone for CompilationConfig
Source§impl Debug for CompilationConfig
impl Debug for CompilationConfig
Source§impl Default for CompilationConfig
impl Default for CompilationConfig
Source§impl<'de> Deserialize<'de> for CompilationConfig
impl<'de> Deserialize<'de> for CompilationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CompilationConfig
impl RefUnwindSafe for CompilationConfig
impl Send for CompilationConfig
impl Sync for CompilationConfig
impl Unpin for CompilationConfig
impl UnsafeUnpin for CompilationConfig
impl UnwindSafe for CompilationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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