Expand description
§baracuda-kernels-types
Shared type vocabulary for the baracuda ML kernel facade.
This crate has no behavior of its own — it ships pure-data types that are common to every member of the kernel facade ecosystem:
- The
KernelDtypeumbrella marker trait + theElement/IntElement/FpElement/BinElement/BiasElementtrait hierarchy plus theScalarTypealpha/beta projection. - Wrapper types (
S8,U8,S4,U4,Bin,F32Strict,Fp8E4M3,Fp8E5M2) that drive kernel selection at the Rust type level. - Tag enums (
ElementKind,MathPrecision,BiasElementKind,LayoutSku,ArchSku,EpilogueKind,ActivationKind). - Borrowed device-buffer views (
MatrixRef,MatrixMut,VectorRef). - Plan-layer descriptors (
PlanPreference,PrecisionGuarantee,Workspace).
§1.0-freeze stability (Phase 28)
Most op-family discriminant enums (BinaryKind, UnaryKind,
ReduceKind, ScanKind, SoftmaxKind, NormalizationKind,
LossKind, LinalgKind, ConvKind, PoolKind, AttentionKind,
IndexingKind, SegmentKind, EmbeddingKind, QuantizeKind,
GgufBlockFormat, MoeKind, SortKind, ImageKind, FftKind,
RandomKind, ShapeLayoutKind, BinaryCmpKind, TernaryKind,
GatedActivationKind, ArgReduceKind, PadMode) plus the category
/ backend tag enums (OpCategory, BackendKind) and the auxiliary
index-dtype tag enums (IndexElementKind, IndexOutputKind) are
marked #[non_exhaustive] as of Phase 28. Downstream match arms
must include a _ => catch-all to remain forward-compatible with
new variants.
The kernel-dispatch-keying enums ElementKind, BiasElementKind,
LayoutSku, ArchSku, EpilogueKind, ActivationKind, and
Workspace<'a> are intentionally left exhaustive — they’re
the keys per-arch / per-layout / per-epilogue / per-bias-dtype
kernel dispatchers exhaustively match on, so adding a new variant
is a deliberate workspace-wide event that ought to surface as a
build break across every match site.
The types here were previously defined in baracuda-cutlass::types;
they were lifted out so that baracuda-kernels (the unified ML op
facade) and any sibling wrapper crate (baracuda-cublas,
baracuda-cudnn, …) can share one vocabulary instead of each
re-declaring its own.
The trait Element was previously named CutlassElement;
baracuda-cutlass keeps the old name available as a re-export for
back-compat. The semantics are unchanged.
Re-exports§
pub use element::BiasElement;pub use element::BiasElementKind;pub use element::Bin;pub use element::BinElement;pub use element::Bool;pub use element::Complex32;pub use element::Complex64;pub use element::Element;pub use element::ElementKind;pub use element::F32Strict;pub use element::Fp8E4M3;pub use element::Fp8E5M2;pub use element::FpElement;pub use element::IndexElement;pub use element::IndexElementKind;pub use element::IndexOutputElement;pub use element::IndexOutputKind;pub use element::IntElement;pub use element::KernelDtype;pub use element::MathPrecision;pub use element::S4;pub use element::S8;pub use element::ScalarType;pub use element::U4;pub use element::U8;pub use layout::ActivationKind;pub use layout::ArchSku;pub use layout::EpilogueKind;pub use layout::LayoutSku;pub use matrix::MatrixMut;pub use matrix::MatrixRef;pub use matrix::VectorRef;pub use ops::ArgReduceKind;pub use ops::AttentionKind;pub use ops::BinaryCmpKind;pub use ops::BinaryKind;pub use ops::ConvKind;pub use ops::CrossEntropyTargetKind;pub use ops::EmbeddingKind;pub use ops::FftKind;pub use ops::FillMode;pub use ops::GatedActivationKind;pub use ops::GgufBlockFormat;pub use ops::ImageKind;pub use ops::IndexingKind;pub use ops::LinalgKind;pub use ops::LossKind;pub use ops::LossReduction;pub use ops::MoeKind;pub use ops::NormalizationKind;pub use ops::PadMode;pub use ops::PoolKind;pub use ops::QuantizeKind;pub use ops::RandomKind;pub use ops::ReduceKind;pub use ops::ReduceToOp;pub use ops::ScanKind;pub use ops::SegmentKind;pub use ops::ShapeLayoutKind;pub use ops::SoftmaxKind;pub use ops::SortKind;pub use ops::TernaryKind;pub use ops::UnaryKind;pub use plan::PlanPreference;pub use plan::PrecisionGuarantee;pub use plan::Workspace;pub use sku::BackendKind;pub use sku::KernelSku;pub use sku::OpCategory;pub use tensor::contiguous_stride;pub use tensor::strides_equal;pub use tensor::TensorMut;pub use tensor::TensorRef;
Modules§
- element
- Element types and trait hierarchy shared across baracuda kernel wrappers.
- layout
- Layout / arch / epilogue / activation tags shared across kernel families.
- matrix
- Borrowed views of device-resident matrices and vectors.
- ops
- Per-category op discriminant enums.
- plan
- Plan-layer descriptors shared across kernel families: caller preferences, workspace handles, and the numerical-guarantee record every plan exposes.
- sku
- Generalized kernel SKU descriptor — covers every op category.
- tensor
- Borrowed views of device-resident N-dimensional tensors.