Skip to content

Conversation

@fbarchard
Copy link
Collaborator

@fbarchard fbarchard commented Dec 30, 2025

Update src/mach/init.c to be have same detects as src/windows/init.c using sysctl to detect hw.optional.arm features

isa_info on Macbook M4

./isa_info 
SIMD extensions:
	ARM SVE: no
	ARM SVE 2: no
	ARM SME: yes
	ARM SME 2: yes
	ARM SME 2P1: no
	ARM SME I16I32: yes
	ARM SME BI32I32: yes
	ARM SME B16B16: no
	ARM SME F16F16: no
ARM SVE Capabilities:
	SVE max length: 0
	SME max length: 512

For comparison on Android with ARM Lumix C1

	ARM SVE: yes
	ARM SVE 2: yes
	ARM SME: yes
	ARM SME 2: yes
	ARM SME 2P1: no
	ARM SME I16I32: yes
	ARM SME BI32I32: yes
	ARM SME B16B16: no
	ARM SME F16F16: no
ARM SVE Capabilities:
	SVE max length: 128
	SME max length: 512

Apple Macbook M4 command prompt the features can be tested

sysctl -a | grep -i sme
kern.progressmeterenable: 0
kern.progressmeter: 33
hw.optional.arm.FEAT_SME: 1
hw.optional.arm.FEAT_SME2: 1
hw.optional.arm.FEAT_SME2p1: 0
hw.optional.arm.SME_F32F32: 1
hw.optional.arm.SME_BI32I32: 1
hw.optional.arm.SME_B16F32: 1
hw.optional.arm.SME_F16F32: 1
hw.optional.arm.SME_I8I32: 1
hw.optional.arm.SME_I16I32: 1
hw.optional.arm.FEAT_SME_F64F64: 1
hw.optional.arm.FEAT_SME_I16I64: 1
hw.optional.arm.FEAT_SME_F16F16: 0
hw.optional.arm.FEAT_SME_B16B16: 0
hw.optional.arm.sme_max_svl_b: 64

Fixes #362

- similar to windows/init.c but use sysinfo
  hw.optional.arm.FEAT_SME2p1
  hw.optional.arm.sme_max_svl_b

Tested on Macbook Pro with M4
@meta-cla meta-cla bot added the cla signed label Dec 30, 2025
@GregoryComer GregoryComer merged commit 2846baf into pytorch:main Jan 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants