| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 | |
[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 | 10 个月前 | |
增加compile兼容性 Co-authored-by: lijinxi<lijinxi2@huawei.com> # message auto-generated for no-merge-commit merge: !47 merge custom_op1 into dev 增加compile兼容性 Created-by: weixin_44144262 Commit-by: lijinxi Merged-by: ascend-robot Description: **背景** MindIE SD适配模型过程中,需要手动替换layer,此时需要对模型的前端进行大量修改,不利于与客户侧的优化和自定义改动叠加。随着pytorch的compile接口能力逐步完善,可以利用fx graph实现pattern的替换,从而减少手工layer替换的过程。 当前实现方案只能在torch2.8运行,缺乏兼容性 **方案** 通过实现低版本torch缺少的符号实现兼容性 get_compatible_decomp_table decompose_auto_functionalized GraphTransformObserver PatternMatcherPass torch._inductor.pattern_matcher的fwd_only属性 aot_autograd返回值兼容 **测试结果** compile编译功能正常 See merge request: Ascend/MindIE-SD!47 | 10 个月前 | |
[feature]新增custom op ut,通过统一的注册机制,提供了自定义算子的接入方式 Co-authored-by: lijinxi<lijinxi2@huawei.com> # message auto-generated for no-merge-commit merge: !48 merge custom_op_ut into dev [feature]新增custom op ut,通过统一的注册机制,提供了自定义算子的接入方式 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_all_mindie_fake_implementations做统一的register fake注册,注册通过定义相应算子的fake实现添加装饰器与真实算子绑定,如 @register_mindie_fake_op("matmul_v2") def matmul_v2_fake( input_x1: torch.Tensor, input_x2: torch.Tensor, bias: torch.Tensor = None, offset_w: torch.Tensor = None, transpose_x1: bool = False, transpose_x2: bool = False, offset_x: int = 0 ) -> torch.Tensor: """Fake implementation of matmul (v2) for shape inference. Matches the output shape of the actual matmul operator with transposition support. Args: input_x1: First input tensor (Meta device) input_x2: Second input tensor (Meta device) bias: Optional bias tensor (Meta device) offset_w: Optional weight offset tensor (Meta device) transpose_x1: Transpose flag for input_x1 transpose_x2: Transpose flag for input_x2 offset_x: Sequence offset Returns: Matmul result tensor (Meta device) with correct shape. """ a_clone = input_x1 b_clone = input_x2 # Apply transposition if transpose_x1: a_clone = a_clone.transpose(-2, -1) if transpose_x2: b_clone = b_clone.transpose(-2, -1) # Matmul calculation result = torch.matmul(a_clone, b_clone) # Apply bias if bias is not None: while bias.dim() < result.dim(): bias = bias.unsqueeze(0) bias = bias.expand(result.shape) result = result + bias return result 原来的算子调用方式则被custom op的调用统一替换 # 测试结果 compile和原有算子功能正常 See merge request: Ascend/MindIE-SD!48 | 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 | 10 个月前 | |
[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 个月前 | |
[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 个月前 | |
[dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 | |
[dev]同步最新代码 Co-authored-by: mazhixin00_00<mazhixin7@huawei.com> | 10 个月前 | |
[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 | 10 个月前 | |
[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 | 10 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 10 个月前 |