pub struct MetraleRegistry { /* private fields */ }Expand description
2026-09-25: The kernel modules of one loaded model.
The blob set is the model’s own (the caller passes the modules for this
checkpoint). Obtain one with MetraleRegistry::load and pass the
Arc<MetraleRegistry> along; there is no global accessor. Dropping the last
handle drops the registry’s module handles.
Implementations§
Source§impl MetraleRegistry
impl MetraleRegistry
Sourcepub fn load(
ordinal: usize,
kernel_blobs: &[(&'static str, &'static [u8])],
) -> Result<Arc<Self>>
pub fn load( ordinal: usize, kernel_blobs: &[(&'static str, &'static [u8])], ) -> Result<Arc<Self>>
2026-09-25: Load this model’s kernel modules into the process CUDA context.
Each call produces a fresh, independent module set; it shares only the context and stream with a previously loaded model.
Sourcepub fn host(&self) -> &Arc<CudaHost>
pub fn host(&self) -> &Arc<CudaHost>
2026-09-25: The process CUDA host this registry’s modules live in.
pub fn ctx(&self) -> &Arc<CudaContext>
pub fn stream(&self) -> &Arc<CudaStream>
Sourcepub fn module_names(&self) -> impl Iterator<Item = &'static str> + '_
pub fn module_names(&self) -> impl Iterator<Item = &'static str> + '_
2026-09-25: Module names this registry loaded.
Sourcepub fn function(
&self,
module_name: &str,
func_name: &str,
) -> Result<CudaFunction>
pub fn function( &self, module_name: &str, func_name: &str, ) -> Result<CudaFunction>
2026-09-25: Look up func_name in module_name through cudarc. Not memoized;
see Self::function_cached.
Sourcepub fn function_cached(
&self,
cache: &OnceLock<CudaFunction>,
module_name: &str,
func_name: &str,
) -> Result<CudaFunction>
pub fn function_cached( &self, cache: &OnceLock<CudaFunction>, module_name: &str, func_name: &str, ) -> Result<CudaFunction>
2026-09-25: Self::function, memoized in the caller’s OnceLock.
Sourcepub fn has_module(&self, module_name: &str) -> bool
pub fn has_module(&self, module_name: &str) -> bool
2026-09-25: Whether a module of this name was loaded for this run.
Sourcepub fn raw_function_cached(
&self,
cache: &OnceLock<RawCudaFunc>,
module_name: &str,
func_name: &str,
) -> Result<RawCudaFunc>
pub fn raw_function_cached( &self, cache: &OnceLock<RawCudaFunc>, module_name: &str, func_name: &str, ) -> Result<RawCudaFunc>
2026-09-25: Look up func_name through the raw driver API
(cuModuleGetFunction), memoized in the caller’s OnceLock.
Sourcepub fn raw_stream(&self) -> u64
pub fn raw_stream(&self) -> u64
2026-09-25: The raw CUstream of the process stream held by CudaHost.
Sourcepub fn device_symbol(
&self,
module_name: &str,
symbol: &str,
) -> Result<(u64, usize)>
pub fn device_symbol( &self, module_name: &str, symbol: &str, ) -> Result<(u64, usize)>
2026-09-25: Resolve a __device__ symbol of a loaded module to its device
pointer and byte length, for drivers that read or write device globals
without a kernel (the InnerQ calibration state). symbol is the
linker-visible name, so C++ namespace symbols are Itanium-mangled
(_ZN7tq_plus14d_innerq_scaleE).
Sourcepub unsafe fn copy_h2d_async(
&self,
dst: u64,
src: *const c_void,
bytes: usize,
stream: u64,
) -> Result<()>
pub unsafe fn copy_h2d_async( &self, dst: u64, src: *const c_void, bytes: usize, stream: u64, ) -> Result<()>
2026-09-25: Async H2D copy into a device pointer.
§Safety
dst must be a valid device pointer, and the bytes at src must outlive
the copy (keep the host buffer until the next sync on stream).
Sourcepub unsafe fn copy_d2h_async(
&self,
dst: *mut c_void,
src: u64,
bytes: usize,
stream: u64,
) -> Result<()>
pub unsafe fn copy_d2h_async( &self, dst: *mut c_void, src: u64, bytes: usize, stream: u64, ) -> Result<()>
2026-09-25: Async D2H copy from a device pointer.
§Safety
dst must stay alive until stream is synchronised.
Sourcepub fn stream_synchronize(&self, stream: u64) -> Result<()>
pub fn stream_synchronize(&self, stream: u64) -> Result<()>
2026-09-25: Block the calling thread until all prior work on stream completes.
Sourcepub unsafe fn launch_on_stream(
&self,
raw_func: RawCudaFunc,
cfg: LaunchConfig,
stream_ptr: u64,
kernel_params: &mut [*mut c_void],
) -> Result<()>
pub unsafe fn launch_on_stream( &self, raw_func: RawCudaFunc, cfg: LaunchConfig, stream_ptr: u64, kernel_params: &mut [*mut c_void], ) -> Result<()>
2026-09-25: Launch a kernel on the raw CUDA stream stream_ptr.
§Safety
kernel_paramsmust contain valid pointers to arguments matching the kernel signature.stream_ptrmust be a valid CUstream handle, or 0 for the legacy default stream.raw_funcmust be a valid CUfunction obtained fromraw_function_cached.