A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pytorch/pytorch/issues/124497 below:

torch.compile does not work since 2.2.1 on MacOS for some models · Issue #124497 · pytorch/pytorch · GitHub

🐛 Describe the bug

The execution hangs when first calling the model to warm-up. After will never be printed. This is on an Apple M3 Max. Smaller models work sometimes.

import torch
from transformers import AutoModelForImageClassification


neural_network = AutoModelForImageClassification.from_pretrained("microsoft/resnet-50")
input_data = torch.randn(1, 3, 228, 228)
print(neural_network(input_data))
neural_network_c = torch.compile(neural_network, backend="inductor")
print("Before")
neural_network_c(input_data)
print("After")

The last version that worked was torch 2.2.0.

Versions
Collecting environment information...
PyTorch version: 2.2.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 14.4.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: version 3.28.4
Libc version: N/A

Python version: 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)] (64-bit runtime)
Python platform: macOS-14.4.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M3 Max

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] onnx==1.16.0
[pip3] torch==2.2.1
[conda] Could not collect

Thanks for your help!

cc @ezyang @gchanan @zou3519 @kadeng @malfet @albanD @msaroufim @bdhirsh @anijain2305 @chauhang


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4