Expand description
cuDNN v9 frontend graph builder — Rust-level “spec” objects that describe a backend descriptor DAG (tensors → ops → operation graph → engine config → execution plan) plus a plan cache keyed on op-shape signatures.
The spec layer is fully host-buildable. The actual
cudnnBackendCreateDescriptor / cudnnBackendFinalize calls live
in [Self::build_into] which only fires when a real cuDNN handle
is plumbed in. Unit tests round-trip the spec without touching FFI.
§What we build
TensorSpec* ──► OpSpec ──► OperationGraphSpec
│
▼
EngineHeurSpec ──► EnginecfgSpec
│
▼
ExecutionPlanSpec
│
▼
VariantPackSpecPlan-cache key is op-kind + dtype + tensor-spec digest, so two requests with identical shapes hit the same cached plan.
Structs§
- Cached
Plan - Cached execution-plan handle. On a host without cuDNN this is
just a marker that “this signature was prepared” — the actual
BackendDescriptorlives only on a real GPU build. - Operation
Graph Spec - Top-level operation graph.
- Plan
Cache - LRU plan cache. The cuDNN actor wraps this in a
Mutexand shares one instance across all op kinds — entries are tagged by op_kind in the key. - Plan
Cache Key - Plan-cache key: op-kind + dtype + signature digest. Compact (24 bytes) so the LRU lookup is cheap.
- Tensor
Spec - One tensor in a backend graph: unique id, dtype, dims, strides, alignment.
Enums§
- Dtype
Tag - cuDNN scalar dtype tag, decoupled from a
T: CudaDtypeparameter so spec-level objects are dyn-friendly. - Norm
Mode - Normalisation kind.
- Norm
Phase - Normalisation training phase.
- OpSpec
- One op in a backend graph. Each
OpSpecreferences TensorSpecs by theiruid; the actual TensorSpec values live on the parentOperationGraphSpec. - Pointwise
Mode - Pointwise op mode.
- Pool
Kind - Pooling kind.
- Reduce
Op - Reduction op tag.
- Tensor
Layout - Tensor layout: NCHW, NHWC, or fully arbitrary nd-strided.
Constants§
- DEFAULT_
PLAN_ CACHE_ SIZE - Default LRU capacity for the plan cache (matches the existing cuDNN ConvForward cache + cuBLASLt heuristic cache).
Functions§
- cache_
key - Build a
PlanCacheKeyfrom an op-kind tag + dtype + anOperationGraphSpec. The signature is the full graph digest.