Skip to main content

TritonLowering

Struct TritonLowering 

Source
pub struct TritonLowering { /* private fields */ }

Implementations§

Source§

impl TritonLowering

Source

pub fn new() -> Self

Source

pub fn with_sm_count(self, sm_count: Option<u32>) -> Self

Enables shape-adaptive tile-size selection for conv kernels, targeting sm_count thread blocks worth of parallelism per launch (see pick_adaptive_block_n). None restores the default fixed-tile-size behavior.

Source§

impl TritonLowering

Source

pub fn lower_with_mapping( &self, graph: &Graph, mode: LoweringMode, ) -> Result<(Dag<Box<dyn ExecutableOp>>, Vec<usize>)>

Like lower but also returns the graph-node-index → DAG-node-index mapping. Useful for middleware lowerings that need to patch specific DAG nodes after the base lowering runs.

Trait Implementations§

Source§

impl Debug for TritonLowering

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TritonLowering

Source§

fn default() -> TritonLowering

Returns the “default value” for a type. Read more
Source§

impl<'a> Lowering<'a> for TritonLowering

Source§

fn extra_dag_names( &self, graph: &Graph, graph_to_dag: &[usize], ) -> Vec<(usize, String)>

Conv2d-with-bias splits one graph node into two DAG nodes (conv + biasadd). graph_to_dag[graph_idx] already points at the biasadd DAG node; here we propagate the same name to the conv DAG node (biasadd_dag_idx - 1) so that the conv weight parameter can be loaded under the same name prefix.

Source§

fn lower( &self, graph: &Graph, mode: LoweringMode, ) -> Result<Dag<Box<dyn ExecutableOp>>>

Lowers graph for mode.
Source§

fn lower_with_mapping( &self, graph: &Graph, mode: LoweringMode, ) -> Result<(Dag<Box<dyn ExecutableOp>>, Vec<usize>)>

Like [lower] but also returns a graph_node_idx → dag_node_idx mapping so that graph-level metadata (e.g. names) can be propagated into the compiled DAG. Read more
Source§

fn base_lowering(&self) -> Option<&dyn Lowering<'a>>

Returns the next lowering in a middleware chain, or None if this is the final lowering. A custom lowering can call self.base_lowering() to delegate ops it does not handle.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.