Audio Utils#

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.

namespace rt
namespace audioUtils#

Variables

float kParakeetZScoreEps = 1e-5f#

Per-feature z-score epsilon for the parakeet log-mel normalise (HF ParakeetFeatureExtractor norm_eps == 1e-5). Matches the CPU MelExtractor’s per-feature epsilon (runtime/melSpectrogram.cpp).

struct ChunkInfo#
#include <audioUtils.h>

Chunk metadata for Qwen3-Omni audio preprocessing.

Public Members

int64_t numChunks#
std::vector<int64_t> chunkLengths#
std::vector<int64_t> chunkOffsets#
int64_t maxChunkLength#
struct FbankResourcesParakeet#
#include <audioUtils.h>

Persistent parakeet fbank resources, built once by NemotronOmniAudioRunner::initFbankResources and reused across clips. Every device tensor is allocated exactly once — the weight/table tensors at their natural shapes, the workspace below at the engine kMAX bound; per-clip steady state performs no device allocation — only a capacity-checked reshape of the workspace.

The scalar STFT/mel params are populated from the bound CPU MelExtractor’s MelExtractorConfig (single source of truth), except normEps, which is not a MelExtractorConfig field and comes from kParakeetZScoreEps above. initFbankResources validates the config is parakeet-spec before filling these.

Public Members

rt::Tensor melFilterFp16Kmajor#

[nMel, round_up(nFreq,16)] Half — Slaney weights, K-padded

rt::Tensor windowF32#

[nFft] Float — symmetric Hann (win_length) centered in nFft

rt::Tensor fftTwiddle#

[nFft, 2] Float — outer-stage W_512^k table

rt::Tensor framedF32#

[T_out, nFft] Float

rt::Tensor magFp16#

[N_pad, K_pad] Half — GEMM B-matrix

rt::Tensor melPowerF32#

[nMel, N_pad] Float — GEMM C-matrix (FP32, not FP16)

rt::Tensor mean#

[nMel] Float — per-feature ln mean

rt::Tensor invDenom#

[nMel] Float — per-feature 1/(std + eps)

int32_t nFft = {0}#

STFT size (== MelExtractorConfig::nFFT; kernels require 512)

int32_t hopLength = {0}#

STFT hop (== MelExtractorConfig::hopLength == 160)

int32_t centerPad = {0}#

center zero-pad each side (== nFft / 2 == 256)

int32_t nMel = {0}#

mel bins (== MelExtractorConfig::nMel == 128)

int32_t nFreq = {0}#

FFT bins == nFft / 2 + 1 == 257 (active K-window before K-pad)

int32_t maxFrames = {0}#

workspace capacity in mel frames (engine input_features kMAX bound)

float preemph = {0.0f}#

preemphasis coefficient (== 0.97)

float logGuard = {0.0f}#

natural-log input floor (== 2^-24)

float normEps = {0.0f}#

per-feature std epsilon (== kParakeetZScoreEps)