Skip to content

feat(device): support Zhenwu PPU - #588

Merged
SigureMo merged 1 commit into
redai-studio:mainfrom
juliantsok:feat/ppu-device-detection
Nov 7, 2026
Merged

SigureMo merged 1 commit into
redai-studio:mainfrom
juliantsok:feat/ppu-device-detection

Conversation

@juliantsok

@juliantsok juliantsok commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What

1/4 of #587

PPU (Zhenwu ZW-M890P and ZW-810E) runs on torch.cuda with PCCL registered as "nccl": devices come from CUDA_VISIBLE_DEVICES and Ray reports GPU. Its row instead claimed eccl / PPU_VISIBLE_DEVICES / PPU / ppu, a torch namespace that does not exist, so detection always fell through to cuda.

Why

How

Make it probed on /dev/alixpu, keep the expandable-segments and NUMA gates on it, and enable the per-chunk weight-push barrier. Only the reported identity moves.

Testing

  • pre-commit run --all-files passes
  • Tests pass (pytest tests/)
  • New tests added (if applicable)
  • Documentation updated (if applicable)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

PPU (Zhenwu ZW-M890P) runs on torch.cuda with PCCL registered as "nccl":
devices come from CUDA_VISIBLE_DEVICES and Ray reports GPU. Its row instead
claimed eccl / PPU_VISIBLE_DEVICES / PPU / ppu, a torch namespace that does
not exist, so detection always fell through to cuda.

Make it a cuda-family row probed on /dev/alixpu, keep the expandable-segments
and NUMA gates on it, and enable the per-chunk weight-push barrier. Only the
reported identity moves.
@juliantsok
juliantsok requested a review from a team November 7, 2026 14:58
@rai-studio-bot

rai-studio-bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for contributing to Relax, @juliantsok! 感谢你为 Relax 做出贡献!

📚 Contribution guide / 贡献指南

Describe the problem, your changes, and how you validated them. Keep each PR focused and run pre-commit run --all-files before submitting.

请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 pre-commit run --all-files。

English contribution guide · 中文贡献指南

🛠️ CI commands / CI 指令
Command / 指令 Usage / 用途
/rerun Retry failed CI / 重跑失败的 CI
/rerun <target> Rerun a workflow or check / 重跑指定 workflow 或检查
/cancel <workflow> Cancel an entire workflow / 取消整个 workflow
/help Show commands and targets / 查看指令和 target
/review Request a code review / 请求代码 review

Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access.

在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。

CI usage and targets · CI 用法与 target

🔎 Merge requirements / 合入条件

GitHub:⏳ 合入条件未满足

Requirement / 条件 Status / 状态
审批人数 ⏳ 0/1 · 至少 1 位有仓库 write 或更高权限的人 Approve
团队审批(relax-block-reviewers) ⏳ 0/1 · 可联系:Aurelius84, Yangruipis, yuanlehome, SigureMo, NINGBENZHE
CI ✅ 已通过

@rai-studio-bot

rai-studio-bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 0338211

目标分支: main

常规与深度审查已完成;未发现需要修改的问题。PPU CUDA-compatible 探测、后端规格、NUMA/allocator 分支与分块权重同步 barrier 均已核对。

审查阶段进度范围与结果
常规审查 ✅ 已完成 已检查固定 diff、设备抽象调用方、Ray 资源映射及 SGLang/Megatron 相关分支;未发现回归。
深度审查 ✅ 已完成 已验证 /dev/alixpu CUDA family probe、PPU gates 和 per-chunk barrier;6 个定向 CPU 用例通过,git diff --check 通过。真实 PPU/Ray 多节点运行未在本环境执行。

没有未解决的审查问题。

提交范围 · 接收 2 · 建议移出 0 · 待确认 0

接收 2 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。

文件结论仓库维护必要性依据替代去向或方案
relax/utils/device.py
接收 实现设备探测与 PPU 回退逻辑,直接位于现有 device 工具模块,属于请求的生产代码变更。 PR #588 的目标是为 PPU 设备增加设备类型检测与回退;该路径是现有设备选择调用方使用的实现位置。 无需迁移;可继续复用现有 relax.utils.device API,避免新建重复模块。
tests/cpu/utils/test_device.py
接收 为设备探测和环境变量覆盖增加 CPU 可运行的持久回归测试,位置与现有 CPU 工具测试布局一致。 仓库测试约定要求纯 CPU 测试放置于 tests/cpu;该文件覆盖本次生产行为。 无需迁移;保留在 tests/cpu/utils 可直接验证无 GPU 环境分支。
Powered by Nyanpasu with gpt-6-astra xhigh, please check the suggestions carefully.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论

审查完成,未发现需要修改的问题。已核对 PPU 的 /dev/alixpu 探测、CUDA-compatible 后端规格、NUMA/allocator 分支、分块权重同步 barrier 及相关调用方;6 个定向 CPU 用例通过,git diff --check 通过。真实 PPU/Ray 多节点运行未在本环境执行。

审查看板:#588 (comment)

Powered by Nyanpasu with gpt-6-astra xhigh, please check the suggestions carefully.

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo
SigureMo merged commit adc2c27 into redai-studio:main Nov 7, 2026
17 checks passed
kkodoo added a commit to flytiger-eco/miles-for-sail that referenced this pull request Nov 23, 2026
SAIL (Zhenwu-M890 / Zhenwu-810E) runs on torch.cuda with PCCL registered
as "nccl": devices come from CUDA_VISIBLE_DEVICES and Ray reports GPU, so
it silently fell through to the plain CUDA platform.

Probe /dev/alixpu under the cuda default and report SailPlatform. Only the
identity moves: device_type stays "cuda", and the NVML NUMA affinity bind,
the expandable-segments allocator setting and the per-bucket colocated IPC
weight-push barrier all apply unchanged.

Naming follows sgl-project/sglang#43826; semantics mirror
redai-studio/Relax#588.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants