Skip to main content

VulkanExecutable

Struct VulkanExecutable 

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

Implementations§

Source§

impl VulkanExecutable

Source

pub fn compile(graph: Graph) -> Self

Source

pub fn compile_rng(graph: Graph, rng: RngOptions) -> Self

Prepare the graph (legalize → primitive set), plan the arena, and build the dispatch schedule. Panics with a clear message if the graph contains an op no decomposition rule can reduce to SUPPORTED_OPS.

Source

pub fn set_param(&mut self, name: &str, data: &[f32])

Source

pub fn set_param_bytes(&mut self, name: &str, data: &[u8])

Raw-byte param upload (packed weights). The arena is f32-uniform, so callers should normally use [set_param]; this exists for symmetry.

Source

pub fn output_dtypes(&self) -> Vec<DType>

Source

pub fn set_active_extent(&mut self, extent: Option<(usize, usize)>)

Source

pub fn bind_gpu_handle(&mut self, name: &str, data: &[f32]) -> bool

Persistent input buffer for KV-cache style graphs. Writes data into the input’s arena slot once; subsequent decode steps reuse it (and, with a feed wired, update it in place on-device). Returns false if name is not a graph input. Mirrors the rlx-metal handle semantics.

Source

pub fn has_gpu_handle(&self, name: &str) -> bool

Source

pub fn set_gpu_handle_feed(&mut self, handle_name: &str, output_index: usize)

Source

pub fn register_kv_row_feed(&mut self, handle_name: &str, output_index: usize)

Register a row feed (vs the generic prefix feed): after a decode run, row src_row of output output_index is folded into handle handle_name’s input slot at row dst_row. For decode graphs that emit the new K/V token at the last bucket-padded output row (llama32). Driven explicitly via [feed_kv_row]; does NOT trigger the auto-propagation in run_read_outputs.

Source

pub fn feed_kv_row(&mut self, src_row: usize, dst_row: usize, row_elems: usize)

Fold each registered row-feed’s new-token row into its resident handle slot, in-place on the arena (no host round-trip). Call after a logits-only run_read_outputs(.., Some(&[0])). row_elems is kv_dim.

Source

pub fn read_gpu_handle(&self, name: &str) -> Option<Vec<f32>>

Read a handle back to host: from its fed output slot if wired, else the resident arena slot, else the host mirror. Used on bucket change / sync.

Source

pub fn read_output_row( &self, out_idx: usize, row: usize, row_inner: usize, ) -> Option<Vec<f32>>

Read one row (row_inner f32 elements at row) from graph output out_idx, directly from the arena. Used by resident KV decode to pull just the new-token K/V row to the host cache (for bucket transitions) without a full-output readback.

Source

pub fn set_rng(&mut self, rng: RngOptions)

Source

pub fn rng(&self) -> RngOptions

Source

pub fn run(&mut self, inputs: &[(&str, &[f32])]) -> Vec<Vec<f32>>

Source

pub fn run_read_outputs( &mut self, inputs: &[(&str, &[f32])], read_indices: Option<&[usize]>, ) -> Vec<Vec<f32>>

Source

pub fn clone_for_cache(&self) -> Self

Deep copy for clone_box: fresh arena/descriptors with the same params and constants already resident.

Trait Implementations§

Source§

impl Drop for VulkanExecutable

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for VulkanExecutable

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.