| refactor(flash_attn): reorganize pytests structure and consolidate mask mode to 0/3/4
Co-authored-by: haijie_699874<zhanghaijie4@hisilicon.com>
# message auto-generated for no-merge-commit merge:
!5877 merge master into master
refactor(flash_attn): reorganize pytests structure and consolidate mask mode to 0/3/4
Created-by: haijie_699874
Commit-by: haijie_699874
Merged-by: cann-robot
Description: ## 描述
重构 flash_attn pytests 目录结构,将工具模块按职责拆分到 test_utils/ 和 tools/ 子目录;统一 mask_mode 语义为 0/3/4,移除 keep_prob 参数。
## 改动
- 修复负载均衡算子在sparse mode3场景的精度bug
- 新增 推理场景的性能红线用例
- 新增 test_utils/data.py:mask 生成、QKV 数据构造、block_table、layout 转换逻辑
- 新增 test_utils/io.py:tensor 读写工具
- 移动 precision_visual.py → test_utils/precision_visual.py(仅路径变更)
- 移动 xlsx_to_testcase.py → tools/xlsx_to_testcase.py,并重命名 pre_tokens/next_tokens → win_left/win_right,移除 keep_prob
- 重构 precision_compare.py → test_utils/precision_compare.py,新增 check_result() 和 analyze_fail_distribution() 精度分析函数
- 精简 mask_mode,仅保留 0/3/4,对齐现有实现
## 关联的Issue
#2653
## 测试
- 重构仅涉及目录组织和参数重命名,不改变原有测试逻辑
- 不传新参数时原有行为不变
## 类型标签
- [ ] 🐛 Bug 修复
- [ ] ✨ 新特性
- [ ] ⚡ 性能优化
- [x] ♻️ 重构
- [ ] 🧪 测试
- [ ] 📦 构建/CI
- [ ] 🔧 配置变更
- [ ] 📝 文档更新
- [ ] ⬆️ 依赖升级
- [ ] 🔒 安全修复
- [ ] 🧹 代码清理
- [ ] ❓ 其他,请描述:
See merge request: cann/ops-transformer!5877 | 5 天前 |