已合并
refactor: remove legacy custom ops feature #1389
refactor: remove legacy custom ops feature #1389
已合并
hedongdong创建于 9月10日
hedongdong成员
9月10日

Paired: GitHub #32 ↔ GitCode !1389

What type of PR is this?

/kind refactor


What does this PR do / why do we need it:

清理 HyperParallel 中已废弃的 legacy Custom Ops 特性:

  • 删除 hyper_parallel/custom_ops 实验接口、MindSpore Custom Ops 实现及其编译入口。
  • 删除 Platform 层 custom_ops 接口、缓存以及 Torch 未实现占位接口。
  • 下架 ISSUE #150 引入的 LightningIndexer、SparseFlashAttention、Grad-KL 和 MHC 分布式算子,包括实现、YAML、UT 和 MindSpore ST。
  • 完整删除 npu_mhc_pre_clamp_sinkhorn 的实验接口、DFunction、分布式规则、C++ 前反向实现和测试;与其共用文件的 npu_mhc_pre_sinkhorn 支持一并下架。
  • 将 DFunction 改为直接继承 torch.autograd.Function,删除 MindSpore DFunction ST,不再通过 Platform 选择自动微分基类。
  • 修复仲景安全扫描 ZJ-2026-3917:删除 OpDispatcher 基于环境变量自动加载外部 YAML/Python 模块的入口;YAML 固定从包内目录读取,模块名仅允许简单标识符,并校验模块真实来源及 DistributedOp 继承关系。
  • 清理根构建脚本、Docker、安装/发布文档和 CI 过滤配置中的 Custom Ops 入口。

KDA/GDN 当前仍被生产代码引用,旧目录暂时保留;待负责迁移到 core/context_parallel 的变更合入后再删除。Platform 其他能力由 ISSUE #377 的后续子任务继续清理。


Which issue(s) this PR fixes:

Related to #377

Fixes mindspore/org-issues#43352


Test Plan and Test result:What scenarios were tested, and what were the verification results(Function, performance, reliability, etc.):

  • Shard UT:1230 passed,38 subtests passed。
  • OpDispatcher/Stack 定向 UT:66 passed,29 subtests passed;覆盖环境变量不可覆盖包内 YAML、模块名/来源校验、DistributedOp 类型校验及包内合法加载。
  • DFunction UT:16 passed。
  • DSA Context Parallel UT:27 passed。
  • DFunction Torch CPU/Gloo ST:1 passed,覆盖两组四进程用例。
  • 已确认被删除的分布式算子无法再从 YAML registry 中解析。
  • 已确认活跃代码、测试和资料中不存在 mhc_pre_clamp_sinkhorn 残留。
  • 本次安全修复新增/修改行未引入 Pylint 告警,git diff --check 通过。
  • Multicore/SHMEM 编译、wheel payload、ELF 和导入检查通过。

Self-checklist:(请自检,在[ ]内打上x,我们将检视你的完成情况,否则会导致pr无法合入)

likedislike
Pull Request已成功合入, 合并人@MindSpore-Bot
(感谢 hedongdong 的贡献)
Hhedongdong成员
9月10日 创建了 pull request,commit 70e59625
Hhedongdong成员
9月10日 关联了issue:[RFC]: 删除platform
atomgit-bot
atomgit-bot
9月10日 评论:

🤖 正在生成合并请求摘要,请稍候…

likedislike
不准确?
atomgit-bot
atomgit-bot
9月10日 评论:

🤖 AI 代码检视正在进行中,请稍候…

likedislike
不准确?
MindSpore-BotMindSpore-Bot成员
9月10日 添加了label:mindspore-cla/yes
此处折叠了109条消息 查看更多
阿苏
阿苏成员9月11日进行代码检视1
hyper_parallel/core/context_parallel/dsa_context_parallel.py
已过期
@@ -14,11 +14,9 @@
1414# ============================================================================
1515"""Context parallel style for DeepSeek Sparse Attention (DSA).
1616 
17-These PyNative module-level styles are companions to the DSA distributed
阿苏
阿苏9月11日评论:

不要叫Pynative ,叫eager

likedislike
阿苏阿苏成员
9月11日 通过审查
Yyangzhenzhang成员
9月11日 通过审查
Yyao_yf成员
9月11日 通过审查
MindSpore-BotMindSpore-Bot成员
9月11日 合入了pull request,合并节点 SHA:d03f7630046914042ff4c349453fd46b40ead14f