Skip to content

Add Intel macOS check; update docs #9865

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It supports a wide range of models including LLMs (Large Language Models), CV (C
Platform Support:
- Operating Systems:
- iOS
- Mac
- MacOS (ARM64)
- Android
- Linux
- Microcontrollers
Expand Down
2 changes: 1 addition & 1 deletion docs/source/backends-xnnpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The XNNPACK delegate is the ExecuTorch solution for CPU execution on mobile CPUs
- ARM64 on Android, iOS, macOS, Linux, and Windows.
- ARMv7 (with NEON) on Android.
- ARMv6 (with VFPv2) on Linux.
- x86 and x86-64 (up to AVX512) on Windows, Linux, macOS, Android, and iOS simulator.
- x86 and x86-64 (up to AVX512) on Windows, Linux, and Android.

## Development Requirements

Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following are required to install the ExecuTorch host libraries, needed to e

- Python 3.10 - 3.12
- g++ version 7 or higher, clang++ version 5 or higher, or another C++17-compatible toolchain.
- Linux or MacOS operating system (Arm or x86).
- - Linux (x86_64 or ARM64) or macOS (ARM64).
- Windows is supported via WSL.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion docs/source/using-executorch-building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Linux (x86_64)
- Ubuntu 20.04.6 LTS+
- RHEL 8+

macOS (x86_64/M1/M2)
macOS (ARM64)
- Big Sur (11.0)+

Windows (x86_64)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/using-executorch-ios.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using ExecuTorch on iOS

ExecuTorch supports both iOS and macOS via Objective-C, Swift, and C++. ExecuTorch also provides backends to leverage Core ML and Metal Performance Shaders (MPS) for hardware-accelerated execution on Apple platforms.
ExecuTorch supports both iOS and macOS (ARM64) via Objective-C, Swift, and C++. ExecuTorch also provides backends to leverage Core ML and Metal Performance Shaders (MPS) for hardware-accelerated execution on Apple platforms.

## Integration

Expand Down
18 changes: 18 additions & 0 deletions install_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ def python_is_compatible():
return True


# PyTorch stopped building macOS x86_64 binaries starting with version 2.3.0 (January 2024).
def is_intel_mac_os():
# Returns True if running on macOS with an Intel-based CPU.
if platform.system().lower() == "darwin" and platform.machine().lower() in (
"x86",
"x86_64",
"i386",
):
print(
"ERROR: ExecuTorch does not support Intel-based macOS platforms.",
file=sys.stderr,
)
return True
return False


# The pip repository that hosts nightly torch packages.
TORCH_NIGHTLY_URL = "https://download.pytorch.org/whl/nightly/cpu"

Expand Down Expand Up @@ -153,6 +169,8 @@ def main(args):
if __name__ == "__main__":
# Before doing anything, cd to the directory containing this script.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
if is_intel_mac_os():
sys.exit(1)
if not python_is_compatible():
sys.exit(1)
main(sys.argv[1:])