feat(npu): add Ascend NPU support via npu-smi (nvitop-npu) - #227
Open
Ruijie-Ysp wants to merge 5 commits into
Open
feat(npu): add Ascend NPU support via npu-smi (nvitop-npu)#227Ruijie-Ysp wants to merge 5 commits into
Ruijie-Ysp wants to merge 5 commits into
Conversation
- nvitop/api/libnpu.py: dependency-free npu-smi parsing layer with TTL caches and parallel batch queries - nvitop/api/npu_device.py: NpuDevice / NpuProcess data model mirroring the Device / GpuProcess API of nvitop - nvitop/cli_npu.py: nvitop-npu CLI (one-shot report, monitor mode, device/process filtering, ASCII and colorful output) - tests_npu/: 12 unit tests against real npu-smi samples (8x Ascend 910B3) - pyproject.toml: register the nvitop-npu console script - README.md: document the Ascend NPU support
The previous test file referenced the early dashboard design (render_summary / refresh_devices) which no longer exists, and ran silently without exercising anything. Rewrite it against the final render_header / render_devices_table / collect_processes APIs: 12 tests covering table borders, ASCII fallback, terminal-width fitting, process merging and filtering (24/24 with test_libnpu.py).
Author
Ruijie-Ysp
marked this pull request as ready for review
August 3, 2026 08:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add Ascend NPU support to nvitop. A new
nvitop-npucommand monitorsHuawei Ascend NPUs through the
npu-smiCLI (no extra runtime dependencies),mirroring the nvitop
Device/GpuProcessAPI and rendering annvidia-smi-style report, plus a full-screen monitoring dashboard.Changes
nvitop/api/libnpu.py: dependency-freenpu-smiparsing layer with TTLcaches and parallel per-card batch queries
nvitop/api/npu_device.py:NpuDevice/NpuProcessdata model mirroringthe
Device/GpuProcessAPI of nvitopnvitop/cli_npu.py:nvitop-npuCLI (one-shot report, monitor mode,device/process filtering, ASCII & colorful output)
nvitop/npu_ui.py/nvitop/npu_monitor.py: responsive renderers and thefull-screen monitoring dashboard
tests_npu/: 41 unit tests against realnpu-smisamples (8x Ascend 910B3)pyproject.toml: register thenvitop-npuconsole scriptREADME.md: document Ascend NPU supportTest
pytest tests_npu/, stub-based, no NPU required)~5.4s; monitor mode refreshes every 2 seconds
Implementation notes
npu-smi infocall covers all cards (health / memory /power / temperature / process table incl. per-process memory)
npu-smirequires-ifor per-card detail queries; these are parallelizedwith a thread pool
batches of
npu-smicalls