Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Apple silicon, use machdep.cpu.brand_string in preference to decoding hw.machine #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jun 17, 2024

  1. For Apple silicon, use machdep.cpu.brand_string in preference to deco…

    …ding hw.machine
    
    This functionality was implemented in pytorch#65 ("Updated package.name to also
    query machdep.cpu.brand_string if decode of hw.machine fails"), but then it was
    omitted from the subsequent pytorch#100, probably inadvertently.
    
    Adding that functionality back here, so that the package/device name can be
    shown correctly on recent devices and macOS/iOS versions.  I have reversed
    the order so that `machdep.cpu.brand_string` is checked before attempting to
    decode `hw.machine`, since the former appears to be more future-proof.
    
    Before this change, on a recent MacBook Pro:
    
        $ cpu-info
        ...
        Debug (cpuinfo): hw.machine: arm64
        Warning in cpuinfo: parsing "hw.machine" failed: Undefined error: 0
        ...
        Packages:
        	0:
    
    After this change:
    
        $ cpu-info
        ...
        Debug (cpuinfo): machdep.cpu.brand_string: Apple M2 Pro
        ...
        Packages:
        	0: Apple M2 Pro
    dlenski committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    9b32dca View commit details
    Browse the repository at this point in the history