Repository navigation
List the Neural Engine as npu on Apple silicon Macs - #102
Open
piotrekno1 wants to merge 1 commit into
Open
piotrekno1 wants to merge 1 commit into
piotrekno1 wants to merge 1 commit into
Conversation
The device's accelerators only ever added GPUs to cpu, so an Apple silicon Mac reported ["cpu", "mps"] and never its Neural Engine. The Swift SDK lists npu on Apple devices. Platforms get npu_accelerators(), empty by default, and macOS returns npu on arm64. gpu_accelerators() is unchanged, so GPU offload detection is not affected.
Coverage report
Top uncovered files
|
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
Apple silicon Macs now list the Neural Engine as
npuin the device's accelerators:["cpu", "mps", "npu"]instead of["cpu", "mps"].The device's list was built as
cpuplus whatevergpu_accelerators()found, so a Neural Engine could never appear. The Swift SDK already listsnpuon Apple devices, and the Android SDK uses the same name.wildedge.accelerators.NPU = "npu"Platform.npu_accelerators(), empty by default. macOS returns["npu"]on arm64, since every Apple silicon Mac has a Neural Engine.gpu_accelerators()andgpu_accelerator_for_offload()are unchanged, so GPU offload detection isn't affected.Related
NPUconstant, with an identical line in the same place, so either PR can merge first. The two changelog entries will need a trivial merge, since both add to Unreleased.accelerator_actual = npu. This PR makes the device list match.Not covered
NPUs on other platforms (Intel, AMD and Qualcomm NPUs on Windows and Linux) are still not detected. Each needs its own probe, and no integration reports running on one yet.
Testing
npuon arm64 only, other platforms list none, and an Apple silicon device's accelerators are["cpu", "mps", "npu"].detect_device()returns['cpu', 'mps', 'npu'].🤖 Generated with Claude Code