Skip to main content

rlx_model

Attribute Macro rlx_model 

Source
#[rlx_model]
Expand description

AOT compilation macro for RLX models.

Wraps a tracing function with a static OnceCell cache that:

  1. On first call: traces the function → builds IR graph → fuses → compiles thunks
  2. On subsequent calls: executes pre-compiled thunks (zero overhead)

The original function becomes the “graph builder”. A new _compiled function is generated that manages the cache and execution.