mcore-bridge
mcore-bridge copied to clipboard
Fix assertion error when packed_seq_params is passed without proper qkv_format
问题描述
即使没有配置 --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:
packed_seq_params is not Nonepacked_seq_params有qkv_format属性qkv_format == 'thd'cu_seqlens_q is not None
没懂,什么场景下 packed_seq_params 为非None值,但是没有 cu_seqlens_q