kopitiam_gpu/ops/mod.rs
1//! The compute operations, each implemented on BOTH the GPU and the CPU.
2//!
3//! Every op here implements [`crate::ComputeOp`] (a GPU kernel + a pure-Rust
4//! twin) and is runnable through the [`crate::Executor`] cascade.
5//!
6//! * [`vector_add`] — the demonstrator that proves the cascade end to end.
7//! * [`matmul_nt`] — `y = x @ w^T`, the shape a transformer linear layer
8//! actually performs, and where a decoder-only model spends nearly all of its
9//! time. Read that module's warning before assuming it makes anything faster:
10//! it re-uploads the weight on every call, and making GPU offload *pay* needs
11//! the weight resident on the device across calls.
12
13pub mod block_q8_matmul_nt;
14pub mod matmul_nt;
15pub mod vector_add;
16
17pub use block_q8_matmul_nt::{block_q8_matmul_nt_cpu, ResidentBlockQ8Weight, BLOCK};
18pub use matmul_nt::{matmul_nt_cpu, matmul_nt_gpu, MatmulNt, MatmulNtInput};
19pub use vector_add::{vector_add_cpu, vector_add_gpu, VectorAdd, VectorAddInput};