Request Identity#

namespace trt_edgellm

Argument bundles for the CuTe DSL FMHA launchers.

Each public run* entry point fills one of these once from its own arguments and members, and the launcher then spreads it across the generated descriptors. One struct per wrapper shape rather than a single superset: a superset would let a field that matters on one path (kvCacheCapacity on the dense path, tokensPerPage on the paged one) sit silently at zero on another.

These carry no generated types, so this header is safe to include from translation units that use the required FMHA-v2 runner, the optional CUTE_DSL_FMHA_BLACKWELL_ENABLED runner, or both. The descriptor-filling machinery itself lives in cuteDslTensorDescriptors.h, which stays free of any FMHA concept.

Helpers for populating the tensor descriptors emitted by the CuTe DSL C exporter.

Every AOT variant exports its own nominally distinct but layout-identical descriptor structs (fmha_d64_Tensor_q_tensor_t vs fmha_d128_Tensor_q_tensor_t) plus a cute_dsl_<variant>_wrapper entry point. There is no umbrella C type, so descriptor types are recovered here from the signature of the wrapper that consumes them: a call site names only the wrapper and the kernel module, and pairing a descriptor with the wrong variant is not expressible.

The exporter (cutlass/cute/export/c_header_generator.py) always names the members data, dynamic_shapes and dynamic_strides, but emits each array only when its dynamic mask is non-empty. A rank-1 descriptor therefore has no dynamic_strides member at all and needs makeCuSeqLenTensor() rather than the strided builders below.

Small-vocabulary specialisations of the DSpark sampling and verification kernels.

They differ in how the top-k set is found. DSpark selects it in topK passes over the row, each a block-wide max-scan, and drops to a single-threaded walk when top-p is used without top-k or topK exceeds its parallel bound; that cost scales with topK. A residual-VQ codebook row is small enough to stage in shared memory, so these kernels instead run one MSB-radix select plus a bitonic sort over the surviving candidates — a single pass whose cost is independent of topK.

Semantics, tensor layouts, and accept/residual/bonus behaviour are identical to the DSpark entry points named in each declaration, which remain the fallback above kCpSpecMaxVocab.

namespace rt
namespace scheduler#

Request scheduling: the engine that owns a runtime, the handles callers hold, and the channels between them. These types live in their own namespace because rt already has a ContextCacheCoordinator::RequestHandle, which is unrelated to the handle callers hold.

Typedefs

using RequestId = uint64_t#

Assigned by RequestEngine::submit() and never reused.

Reuse would be a correctness bug, not just untidy: cancel() is asynchronous, so a request may already have retired by the time the actor drains the command. A recycled id would let a late cancel terminate a different request. A monotonic 64-bit counter makes a stale cancel a lookup miss instead.

Enums

enum class TerminalStatus : uint8_t#

How a request stopped, from the actor’s point of view.

Coarser than FinishReason in streaming.h, which describes the generation outcome carried on each chunk: a request whose status is kCompleted may still carry kEndId, kLength or kStopWords.

Values:

enumerator kCompleted#

Generation ended on its own terms.

enumerator kCancelled#

A cancel command was drained before generation ended.

enumerator kExecutionError#

The step that carried this request failed.

Variables

RequestId kInvalidRequestId = 0#

Reserved value for “no request”; submit() never returns it.