Skip to main content

HOST_CALLBACK

Static HOST_CALLBACK 

Source
pub static HOST_CALLBACK: Prim
Expand description

Calls a Rust function on host arrays (Params::HostCallback): the interpreter calls it directly, XLA through the FFI handler ruxla_host_callback of ruxla-pjrt (on CUDA, around copies to the host), which finds it by its id. The function must be pure (it may run any number of times). Not differentiable; batched by a loop over the examples (scan, as pure_callback with vmap_method="sequential"). Programs with host callbacks cannot be serialized, embedded in JAX, or compiled to Rust.