diff --git a/cpp/tensorrt_llm/common/attentionOp.cpp b/cpp/tensorrt_llm/common/attentionOp.cpp index ce10de9509f5..e3ceb715916b 100644 --- a/cpp/tensorrt_llm/common/attentionOp.cpp +++ b/cpp/tensorrt_llm/common/attentionOp.cpp @@ -2288,7 +2288,15 @@ int AttentionOp::enqueueGeneration(EnqueueGenerationParams const& params, cud // self attn XQAParams xqaParams{}; this->template convertMMHAParamsToXQAParams(xqaParams, params, /*forConfigurePlugin=*/false); - if (mEnableXQA && mXqaDispatcher->shouldUse(xqaParams)) + // T5TTS/Magpie cross-attention with the attention prior must run in the MMHA kernel, which + // applies the prior mask and writes the attention_prior_scores the host focus tracker reads. + // The XQA path (TllmGen decode kernels on SM100 family) does neither, so the scores stay + // all-zero, the focus advances blindly and EOS/termination never triggers (long static tail, + // repeated phrases). mEnableXQA is also restored from the serialized engine, so it cannot be + // switched off from the constructor. + bool const xqaBypassForAttentionPrior + = isCrossAttention() && (ComputeAttentionPrior() || ApplyAttentionPrior()); + if (mEnableXQA && !xqaBypassForAttentionPrior && mXqaDispatcher->shouldUse(xqaParams)) { TLLM_LOG_DEBUG("XQA kernels are selected in the generation phase."); xqaParams.stream = stream; diff --git a/cpp/tensorrt_llm/kernels/fmhaDispatcher.cpp b/cpp/tensorrt_llm/kernels/fmhaDispatcher.cpp index 5da6b32631f8..b35b87fb0844 100644 --- a/cpp/tensorrt_llm/kernels/fmhaDispatcher.cpp +++ b/cpp/tensorrt_llm/kernels/fmhaDispatcher.cpp @@ -46,7 +46,7 @@ QkvLayout AttentionInputLayoutToQkvLayout(AttentionInputLayout layout) FmhaDispatcher::FmhaDispatcher(MHARunnerFixedParams fixedParams) : mFixedParams(fixedParams) - , mUseTllmGen(false) + , mUseTllmGen(tensorrt_llm::common::isSM100Family()) { if (mUseTllmGen) {