pie 0.1.1

Programmable Inference Engine (PIE)
Documentation
interface forward {

    use core.{queue};
    use allocate.{object-id};        // Import object ID type for memory references

    // Returns a list of available PEFT (parameter-efficient fine-tuning) adapter names
    get-all-adapters: func(queue: borrow<queue>) -> list<string>;

    // Executes a forward pass using context and input embeddings
    forward: func(
        queue: borrow<queue>,                   // Queue to schedule the operation
        last-kv-page-len: u32,                  // Number of valid entries in the last KV page
        kv-page-ids: list<object-id>,           // List of context key-value memory pages
        input-emb-ids: list<object-id>,         // List of input embedding IDs
        output-emb-ids: list<object-id>         // List of output embedding IDs to be populated
    );

    // Executes a forward pass with a specified PEFT adapter
    forward-with-adapter: func(
        queue: borrow<queue>,                   // Queue to schedule the operation
        adapter: string,                        // Adapter name to apply during the pass
        last-kv-page-len: u32,                  // Number of valid entries in the last KV page
        kv-page-ids: list<object-id>,           // Context key-value memory pages
        input-emb-ids: list<object-id>,         // Input embeddings
        output-emb-ids: list<object-id>         // Output embeddings to write results into
    );

    // Applies a boolean mask to the given KV page, modifying active positions
    mask-kv-page: func(
        queue: borrow<queue>,       // Queue to schedule the operation
        kv-page-id: object-id,      // Target KV page to mask
        mask: list<bool>            // Boolean mask (true = keep, false = ignore)
    );

}