执行摘要
暴露 get_scheduler_metadata torch op 以预计算 FA3 调度元数据,优化解码性能。
优化 FA3 解码性能,减少冗余计算。PR body 中说明:'Precomputes FA3 tile scheduling metadata so that the prepare_varlen_num_blocks kernel does not need to run per-layer during decode.'
建议技术管理者关注通过预计算调度元数据优化重复内核调用的设计模式,工程师可精读以学习如何暴露内核函数作为 torch op 并进行性能调优。
review 中,gemini-code-assist[bot] 指出 Python 包装器初始版本缺失多个参数(如 leftpad_k、cu_seqlens_k 等),可能导致与 flash_attn_with_kvcache 和 flash_attn_varlen_func 使用时行为不正确。但 Qiaolin-Yu 批准了 PR,且后续提交(refactor)补全了参数,解决了该问题。
参与讨论