| [dev]添加PR模板 Co-authored-by: mazhixin<mazhixin7@huawei.com> # message auto-generated for no-merge-commit merge: !44 merge dev into dev [dev]添加PR模板 Created-by: mazhixin00_00 Commit-by: mazhixin Merged-by: ascend-robot Description: [dev]添加PR模板 See merge request: Ascend/MindIE-SD!44 | 9 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [feature]新增SparseBlockEstimate算子以及plugin和UT Co-authored-by: lanwangli<lanwangli@huawei.com> # message auto-generated for no-merge-commit merge: !67 merge bsa_op1 into dev [feature]新增SparseBlockEstimate算子以及plugin和UT Created-by: mazhixin00_00 Commit-by: lanwangli Merged-by: ascend-robot Description: [feature]新增SparseBlockEstimate算子  **调用该算子plugin** import torch torch.ops.load_library("mindiesd/plugin/libPTAExtensionOPS.so") stride = 8 scale_value=query.shape[-1] ** -0.5 / stride smask, sct = torch.ops.mindie.sparse_block_estimate_mindie_sd( query=query, key=key, actual_seq_lengths=None, actual_seq_lengths_kv=None, input_layout="BNSD", stride=stride, sparse_size=128, num_heads=query.shape[1], num_key_value_heads=key.shape[1], scale_value=scale_value, threshold=1.0, causal=False, keep_sink=True, keep_recent=True, row_sparse=1.0 ) - query:支持fp16和bf16 - key:支持fp16和bf16 - actual_seq_lengths:目前只接受None - actual_seq_lengths_kv:目前只接受None - input_layout:目前只支持“BNSD”、“BSND”、“BSH” - stride:目前只支持8 - sparse_size:目前只支持128 - num_heads:query的head - num_key_value_heads:key和value的head - scale_value:headdim ** -0.5 / stride - threshold:1.0 时表示计算完整的注意力(完全不稀疏)。 - causal:为 True 时只计算 Attention Map 矩阵下三角部分,否则计算完整 Attention Map,默认值为True。 - keep_sink:为 True 时 Attention Map 矩阵的第一列必选,默认值为True。 - keep_recent:为 True 时 Attention Map 矩阵对角线上的 block 必选,默认值为True。 - row_sparse:取值为 0-1 之间的小数,用以强制保证每个 block 行的稀疏率大于 (1-row_sparse),当 TopCDF 选择的稀疏率小于 (1-row_sparse) 时,使用 Topk进行选取,默认值为1。 **单算子测试结果:**  See merge request: Ascend/MindIE-SD!67 | 9 个月前 |
| [feature]新增SparseBlockEstimate算子以及plugin和UT Co-authored-by: lanwangli<lanwangli@huawei.com> # message auto-generated for no-merge-commit merge: !67 merge bsa_op1 into dev [feature]新增SparseBlockEstimate算子以及plugin和UT Created-by: mazhixin00_00 Commit-by: lanwangli Merged-by: ascend-robot Description: [feature]新增SparseBlockEstimate算子  **调用该算子plugin** import torch torch.ops.load_library("mindiesd/plugin/libPTAExtensionOPS.so") stride = 8 scale_value=query.shape[-1] ** -0.5 / stride smask, sct = torch.ops.mindie.sparse_block_estimate_mindie_sd( query=query, key=key, actual_seq_lengths=None, actual_seq_lengths_kv=None, input_layout="BNSD", stride=stride, sparse_size=128, num_heads=query.shape[1], num_key_value_heads=key.shape[1], scale_value=scale_value, threshold=1.0, causal=False, keep_sink=True, keep_recent=True, row_sparse=1.0 ) - query:支持fp16和bf16 - key:支持fp16和bf16 - actual_seq_lengths:目前只接受None - actual_seq_lengths_kv:目前只接受None - input_layout:目前只支持“BNSD”、“BSND”、“BSH” - stride:目前只支持8 - sparse_size:目前只支持128 - num_heads:query的head - num_key_value_heads:key和value的head - scale_value:headdim ** -0.5 / stride - threshold:1.0 时表示计算完整的注意力(完全不稀疏)。 - causal:为 True 时只计算 Attention Map 矩阵下三角部分,否则计算完整 Attention Map,默认值为True。 - keep_sink:为 True 时 Attention Map 矩阵的第一列必选,默认值为True。 - keep_recent:为 True 时 Attention Map 矩阵对角线上的 block 必选,默认值为True。 - row_sparse:取值为 0-1 之间的小数,用以强制保证每个 block 行的稀疏率大于 (1-row_sparse),当 TopCDF 选择的稀疏率小于 (1-row_sparse) 时,使用 Topk进行选取,默认值为1。 **单算子测试结果:**  See merge request: Ascend/MindIE-SD!67 | 9 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| 修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !57 merge dev into dev [BUGFIX]修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Created-by: changetheway Commit-by: changetheway Merged-by: lanwangli Description: 1、之前出包名称是mindie_sd,安装卸载都是pip install/show/uninstall mindie_sd,调用时却需要import mindiesd。统一成mindiesd的命名。 2、支持依赖非默认的cann toolkit安装路径 See merge request: Ascend/MindIE-SD!57 | 9 个月前 |
| [Refactor]移除冗余模块代码,与模型解耦,删除和模型相关代码 Co-authored-by: weixin_44144262<lijinxi2@huawei.com> # message auto-generated for no-merge-commit merge: !15 merge del into dev [Refactor]移除冗余模块代码,与模型解耦,删除和模型相关代码 Created-by: weixin_44144262 Commit-by: weixin_44144262 Merged-by: ascend-robot Description: 移除冗余代码,与模型解耦,删除和模型相关代码  See merge request: Ascend/MindIE-SD!15 | 9 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [feature]新增customop,custom op通过统一的注册机制,提供了自定义算子的接入方式 Co-authored-by: lijinxi<lijinxi2@huawei.com> # message auto-generated for no-merge-commit merge: !46 merge custom_op into dev [feature]新增customop,custom op通过统一的注册机制,提供了自定义算子的接入方式 Created-by: weixin_44144262 Commit-by: lijinxi Merged-by: ascend-robot Description: # 背景 新增customop,custom op通过统一的注册机制,提供了自定义算子的接入方式,并支持多个torch版本兼容的register fake,用于fx图推导meta类型数据的shape # 方案 _load_mindie_ops_library做统一注册 register_mindie_fake_op f做统一的fake注册,注册通过定义相应算子的fake实现添加装饰器与真实算子绑定,如 @register_ops.register_mindie_fake_op("rope_mindie_sd") def rope_fake( x: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor, mode: int ) -> torch.Tensor: return torch.empty_like(x) 原来的算子调用方式则被custom op的调用统一替换 def rope( x: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor, mode: int ) -> torch.Tensor: if any(t.device.type == "meta" for t in [x, cos, sin]): return rope_fake(x, cos, sin, mode) return getattr(torch.ops.mindie, "rope_mindie_sd")(x, cos, sin, mode) # 测试结果 compile和原有算子功能正常 See merge request: Ascend/MindIE-SD!46 | 9 个月前 |
| [feature]新增SparseBlockEstimate算子以及plugin和UT Co-authored-by: lanwangli<lanwangli@huawei.com> # message auto-generated for no-merge-commit merge: !67 merge bsa_op1 into dev [feature]新增SparseBlockEstimate算子以及plugin和UT Created-by: mazhixin00_00 Commit-by: lanwangli Merged-by: ascend-robot Description: [feature]新增SparseBlockEstimate算子  **调用该算子plugin** import torch torch.ops.load_library("mindiesd/plugin/libPTAExtensionOPS.so") stride = 8 scale_value=query.shape[-1] ** -0.5 / stride smask, sct = torch.ops.mindie.sparse_block_estimate_mindie_sd( query=query, key=key, actual_seq_lengths=None, actual_seq_lengths_kv=None, input_layout="BNSD", stride=stride, sparse_size=128, num_heads=query.shape[1], num_key_value_heads=key.shape[1], scale_value=scale_value, threshold=1.0, causal=False, keep_sink=True, keep_recent=True, row_sparse=1.0 ) - query:支持fp16和bf16 - key:支持fp16和bf16 - actual_seq_lengths:目前只接受None - actual_seq_lengths_kv:目前只接受None - input_layout:目前只支持“BNSD”、“BSND”、“BSH” - stride:目前只支持8 - sparse_size:目前只支持128 - num_heads:query的head - num_key_value_heads:key和value的head - scale_value:headdim ** -0.5 / stride - threshold:1.0 时表示计算完整的注意力(完全不稀疏)。 - causal:为 True 时只计算 Attention Map 矩阵下三角部分,否则计算完整 Attention Map,默认值为True。 - keep_sink:为 True 时 Attention Map 矩阵的第一列必选,默认值为True。 - keep_recent:为 True 时 Attention Map 矩阵对角线上的 block 必选,默认值为True。 - row_sparse:取值为 0-1 之间的小数,用以强制保证每个 block 行的稀疏率大于 (1-row_sparse),当 TopCDF 选择的稀疏率小于 (1-row_sparse) 时,使用 Topk进行选取,默认值为1。 **单算子测试结果:**  See merge request: Ascend/MindIE-SD!67 | 9 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| 修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !57 merge dev into dev [BUGFIX]修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Created-by: changetheway Commit-by: changetheway Merged-by: lanwangli Description: 1、之前出包名称是mindie_sd,安装卸载都是pip install/show/uninstall mindie_sd,调用时却需要import mindiesd。统一成mindiesd的命名。 2、支持依赖非默认的cann toolkit安装路径 See merge request: Ascend/MindIE-SD!57 | 9 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| [dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 |
| 修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Co-authored-by: changetheway<guotaoyuan1@h-partners.com> # message auto-generated for no-merge-commit merge: !57 merge dev into dev [BUGFIX]修改出包名称为mindiesd、支持非默认cann toolkit安装路径 Created-by: changetheway Commit-by: changetheway Merged-by: lanwangli Description: 1、之前出包名称是mindie_sd,安装卸载都是pip install/show/uninstall mindie_sd,调用时却需要import mindiesd。统一成mindiesd的命名。 2、支持依赖非默认的cann toolkit安装路径 See merge request: Ascend/MindIE-SD!57 | 9 个月前 |