mcore-bridge icon indicating copy to clipboard operation
mcore-bridge copied to clipboard

Fix assertion error when packed_seq_params is passed without proper qkv_format

Open tomzw11 opened this issue 5 months ago • 1 comments

问题描述

即使没有配置 --reset-attention-mask,也会有 packed_seq_params 被传入,但缺少 qkv_format 或 cu_seqlens_q,导致 assertion 错误:AssertionError: Packed sequences are not supported when fla is not available.

修复方案

修改 cu_seqlens 的初始化逻辑,仅在满足以下所有条件时才设置 cu_seqlens:

  1. packed_seq_params is not None
  2. packed_seq_params 有 qkv_format 属性
  3. qkv_format == 'thd'
  4. cu_seqlens_q is not None

tomzw11 avatar Jun 04 '26 07:06 tomzw11

没懂,什么场景下 packed_seq_params 为非None值,但是没有 cu_seqlens_q

Jintao-Huang avatar Jun 04 '26 08:06 Jintao-Huang