Safety Attention Kernels#
-
struct AttentionLaunch#
Fixed launch dimensions validated against the plugin descriptors before execution.
- uint64_t trt_edgellm::safety::attentionWorkspaceBytes(
- AttentionLaunch const &launch
Workspace includes validation/cumulative lengths followed by aligned FP16 rotated Q storage.
-
cudaError_t trt_edgellm::safety::prepareAttentionKernels() noexcept#
Initialization only: prepare statically compiled helpers after explicit FMHA module preparation.
- cudaError_t trt_edgellm::safety::launchSafetyLlmAttention(
- SafetyAttentionModules &modules,
- fmha::PreparedBindings &bindings,
- AttentionLaunch const &launchShape,
- half const *qkv,
- half const *past,
- int32_t const *lengths,
- float const *rope,
- int32_t const *starts,
- half *output,
- half *present,
- void *workspace,
- uint64_t *errorMask,
- cudaStream_t stream
Execute batch-one FP16 causal attention with contiguous KV, without allocating resources. errorMask is the GPU-accessible bitMask of LWE’s mapped pinned error storage. Host inspection uses its host address after GPU completion.
- cudaError_t trt_edgellm::safety::launchSafetyVisualAttention(
- SafetyAttentionModules &modules,
- fmha::PreparedBindings &bindings,
- AttentionLaunch const &launch,
- half const *q,
- half const *k,
- half const *v,
- int32_t const *sequenceEnds,
- half *output,
- void *workspace,
- uint64_t *errorMask,
- cudaStream_t stream
Execute FP16 bidirectional ragged attention with no KV cache.