Skip to content

Segmentation Fault using MSELoss on PyTorch on MPS #139723

@BhavyeMathur

Description

@BhavyeMathur

🐛 Describe the bug

Running some very fundamental code using PyTorch on my M1 Mac MPS backend throws a segmentation fault.

import torch

loss = torch.nn.MSELoss()

a = torch.tensor([0]).to("mps")
b = torch.tensor([0]).to("mps")

loss(a, b)

Leads to a segmentation fault (the full report is given at the end of the post).

2024-11-05 01:28:04.933 Python[20475:6692381] Error getting visible function: 
 (null) Function square_i64 was not found in the library
/AppleInternal/Library/BuildRoots/91a344b1-f985-11ee-b563-fe8bc7981bff/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Utility/MPSKernelDAG.mm:805: failed assertion `Error getting visible function: 
 (null) Function square_i64 was not found in the library'

When running on the CPU, we instead get:

RuntimeError: "mse_cpu" not implemented for 'Long'

Error Report

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process:   Python [19816]

Thread 0 Crashed::  Dispatch queue: metal gpu stream
0   libsystem_kernel.dylib        	       0x1874caa60 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x187502c20 pthread_kill + 288
2   libsystem_c.dylib             	       0x18740fa30 abort + 180
3   libsystem_c.dylib             	       0x18740ed20 __assert_rtn + 284
4   Metal                         	       0x1919c1194 MTLReportFailure.cold.1 + 48
5   Metal                         	       0x19199ddb0 MTLReportFailure + 464
6   MPSCore                       	       0x192767fc4 0x192716000 + 335812
7   MPSCore                       	       0x19271e60c 0x192716000 + 34316
8   MPSCore                       	       0x192718dfc MPSKernelDAG::getDAGAndHash(id<MTLLibrary>, MPSDAGKernelOp*, NSMutableDictionary<NSString*, id<MTLFunction>>*, NSMutableArray<NSString>*, unsigned long long vector[4]&, bool*) + 796
9   MPSCore                       	       0x19271ba4c 0x192716000 + 23116
10  MPSCore                       	       0x19279e114 MPSLibrary::CreateUberShaderKey(NSString*, MPSFunctionConstantList const&, unsigned long long, id<MTLFunction> (*)(id<MTLLibrary>, MPSKernelInfo const*, MPSFunctionConstantList const&, MPSFunctionConstructorExtraParams const&, NSError**), unsigned long long, MPSThreadGroupSizeMultipleType, MPSDriverCompilerOptions, MPSKernelDAGObject*, NSString*, unsigned long, MPSKernelUserDAGInfo*, NSArray<objc_object<MTLFunction>>*) + 940
11  MPSNDArray                    	       0x193ba4160 0x193b16000 + 581984
12  MPSNDArray                    	       0x193b8b1a8 0x193b16000 + 479656
13  MPSNDArray                    	       0x193b8d620 0x193b16000 + 488992
14  MPSNDArray                    	       0x193ba0f88 0x193b16000 + 569224
15  MPSNDArray                    	       0x193b8b1a8 0x193b16000 + 479656
16  MPSNDArray                    	       0x193b8d620 0x193b16000 + 488992
17  MetalPerformanceShadersGraph  	       0x1e59a64dc 0x1e4919000 + 17355996
18  MetalPerformanceShadersGraph  	       0x1e58a7c1c 0x1e4919000 + 16313372
19  MetalPerformanceShadersGraph  	       0x1e5913448 0x1e4919000 + 16753736
20  MetalPerformanceShadersGraph  	       0x1e590b930 0x1e4919000 + 16722224
21  MetalPerformanceShadersGraph  	       0x1e591af98 0x1e4919000 + 16785304
22  MetalPerformanceShadersGraph  	       0x1e5908a7c 0x1e4919000 + 16710268
23  MetalPerformanceShadersGraph  	       0x1e59fd734 0x1e4919000 + 17712948
24  MetalPerformanceShadersGraph  	       0x1e59fcab0 0x1e4919000 + 17709744
25  MetalPerformanceShadersGraph  	       0x1e58520e4 0x1e4919000 + 15962340
26  MetalPerformanceShadersGraph  	       0x1e585115c 0x1e4919000 + 15958364
27  libtorch_cpu.dylib            	       0x15f6cb1d4 invocation function for block in at::mps::MPSStream::executeMPSGraph(MPSGraph*, NSDictionary*, NSDictionary*, at::mps::SyncType) + 128
28  libdispatch.dylib             	       0x1873523e8 _dispatch_client_callout + 20
29  libdispatch.dylib             	       0x1873618d8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
30  libtorch_cpu.dylib            	       0x15f6cb13c at::mps::MPSStream::executeMPSGraph(MPSGraph*, NSDictionary*, NSDictionary*, at::mps::SyncType) + 160
31  libtorch_cpu.dylib            	       0x15f76f34c at::native::structured_mse_loss_out_mps::impl(at::Tensor const&, at::Tensor const&, long long, at::Tensor const&) + 1624
32  libtorch_cpu.dylib            	       0x15c7da790 c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, at::Tensor const&, long long), &at::(anonymous namespace)::wrapper_MPS_mse_loss(at::Tensor const&, at::Tensor const&, long long)>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, at::Tensor const&, long long>>, at::Tensor (at::Tensor const&, at::Tensor const&, long long)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long) + 148
33  libtorch_cpu.dylib            	       0x15dbccb2c c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long), &torch::autograd::VariableType::(anonymous namespace)::mse_loss(c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long)>, at::Tensor, c10::guts::typelist::typelist<c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long>>, at::Tensor (c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, at::Tensor const&, long long) + 1056
34  libtorch_cpu.dylib            	       0x15b77e230 at::_ops::mse_loss::call(at::Tensor const&, at::Tensor const&, long long) + 304
35  libtorch_python.dylib         	       0x114c38600 torch::autograd::THPVariable_mse_loss(_object*, _object*, _object*) + 772
36  Python                        	       0x10539dc34 cfunction_call + 60
37  Python                        	       0x105339a94 _PyObject_MakeTpCall + 128
38  Python                        	       0x10545ce34 _PyEval_EvalFrameDefault + 53004
39  Python                        	       0x10546289c _PyEval_Vector + 156
40  Python                        	       0x10533dd6c method_vectorcall + 164
41  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
42  Python                        	       0x10546289c _PyEval_Vector + 156
43  Python                        	       0x10533dd6c method_vectorcall + 164
44  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
45  Python                        	       0x10546289c _PyEval_Vector + 156
46  Python                        	       0x105339db4 _PyObject_FastCallDictTstate + 96
47  Python                        	       0x1053c5340 slot_tp_call + 180
48  Python                        	       0x105339a94 _PyObject_MakeTpCall + 128
49  Python                        	       0x10545ce34 _PyEval_EvalFrameDefault + 53004
50  Python                        	       0x10544ecac PyEval_EvalCode + 276
51  Python                        	       0x10544950c builtin_exec + 428
52  Python                        	       0x10545eae0 _PyEval_EvalFrameDefault + 60344
53  Python                        	       0x1053583e4 gen_send_ex2 + 204
54  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
55  Python                        	       0x1053583e4 gen_send_ex2 + 204
56  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
57  Python                        	       0x1053583e4 gen_send_ex2 + 204
58  Python                        	       0x105358bf4 gen_send + 36
59  Python                        	       0x10545f158 _PyEval_EvalFrameDefault + 62000
60  Python                        	       0x10546289c _PyEval_Vector + 156
61  Python                        	       0x10533ddd8 method_vectorcall + 272
62  Python                        	       0x10533a840 _PyVectorcall_Call + 116
63  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
64  Python                        	       0x1053583e4 gen_send_ex2 + 204
65  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
66  Python                        	       0x1053583e4 gen_send_ex2 + 204
67  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
68  Python                        	       0x1053583e4 gen_send_ex2 + 204
69  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
70  Python                        	       0x1053583e4 gen_send_ex2 + 204
71  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
72  Python                        	       0x1053583e4 gen_send_ex2 + 204
73  Python                        	       0x105453a7c _PyEval_EvalFrameDefault + 15188
74  Python                        	       0x1053583e4 gen_send_ex2 + 204
75  _asyncio.cpython-311-darwin.so	       0x104a084e8 task_step_impl + 440
76  _asyncio.cpython-311-darwin.so	       0x104a082bc task_step + 52
77  _asyncio.cpython-311-darwin.so	       0x104a08d5c task_wakeup + 148
78  Python                        	       0x10539e904 cfunction_vectorcall_O + 92
79  Python                        	       0x1054884f4 _PyObject_VectorcallTstate.4587 + 96
80  Python                        	       0x1054883dc context_run + 216
81  Python                        	       0x10539e644 cfunction_vectorcall_FASTCALL_KEYWORDS + 80
82  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
83  Python                        	       0x10544ecac PyEval_EvalCode + 276
84  Python                        	       0x10544950c builtin_exec + 428
85  Python                        	       0x10539e644 cfunction_vectorcall_FASTCALL_KEYWORDS + 80
86  Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
87  Python                        	       0x10546289c _PyEval_Vector + 156
88  Python                        	       0x1054ef84c pymain_run_module + 256
89  Python                        	       0x1054ef2ec Py_RunMain + 1784
90  Python                        	       0x1054f049c pymain_main + 52
91  Python                        	       0x1054f0cd4 Py_BytesMain + 40
92  dyld                          	       0x18717a0e0 start + 2360

Thread 1:: */Reaper
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 2:: */0
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 3:
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   select.cpython-311-darwin.so  	       0x104400b90 select_kqueue_control_impl + 592
2   Python                        	       0x10545f77c _PyEval_EvalFrameDefault + 63572
3   Python                        	       0x10546289c _PyEval_Vector + 156
4   Python                        	       0x10533de4c method_vectorcall + 388
5   Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
6   Python                        	       0x10546289c _PyEval_Vector + 156
7   Python                        	       0x10533de4c method_vectorcall + 388
8   Python                        	       0x10555fa50 thread_run + 200
9   Python                        	       0x1054dbcbc pythread_wrapper + 48
10  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
11  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 4:
0   libsystem_kernel.dylib        	       0x1874cab70 poll + 8
1   libzmq.5.dylib                	       0x104afc72c zmq_poll + 888
2   libzmq.5.dylib                	       0x104aa77f4 zmq::proxy_steerable(zmq::socket_base_t*, zmq::socket_base_t*, zmq::socket_base_t*, zmq::socket_base_t*) + 308
3   libzmq.5.dylib                	       0x104aa76b4 zmq::proxy(zmq::socket_base_t*, zmq::socket_base_t*, zmq::socket_base_t*) + 44
4   libzmq.5.dylib                	       0x104afed10 zmq_proxy + 104
5   _zmq.cpython-311-darwin.so    	       0x1046fee88 0x1046d8000 + 159368
6   _zmq.cpython-311-darwin.so    	       0x1046fe784 0x1046d8000 + 157572
7   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
8   Python                        	       0x10546289c _PyEval_Vector + 156
9   Python                        	       0x10533de4c method_vectorcall + 388
10  Python                        	       0x10555fa50 thread_run + 200
11  Python                        	       0x1054dbcbc pythread_wrapper + 48
12  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
13  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 5:: */Reaper
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 6:: */0
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 7:
0   libsystem_kernel.dylib        	       0x1874c2db4 read + 8
1   Python                        	       0x1054ed360 _Py_read + 116
2   Python                        	       0x105503db8 os_read + 172
3   Python                        	       0x10539e4e4 cfunction_vectorcall_FASTCALL + 80
4   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
5   Python                        	       0x10546289c _PyEval_Vector + 156
6   Python                        	       0x10533de4c method_vectorcall + 388
7   Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
8   Python                        	       0x10546289c _PyEval_Vector + 156
9   Python                        	       0x10533de4c method_vectorcall + 388
10  Python                        	       0x10555fa50 thread_run + 200
11  Python                        	       0x1054dbcbc pythread_wrapper + 48
12  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
13  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 8:
0   _zmq.cpython-311-darwin.so    	       0x1046f9c34 0x1046d8000 + 138292
1   Python                        	       0x1053a48fc _PyObject_GenericGetAttrWithDict + 308
2   Python                        	       0x1053c55b8 slot_tp_getattr_hook + 176
3   Python                        	       0x105456dcc _PyEval_EvalFrameDefault + 28324
4   Python                        	       0x10546289c _PyEval_Vector + 156
5   Python                        	       0x10534a0f8 property_descr_get + 124
6   Python                        	       0x1053a48fc _PyObject_GenericGetAttrWithDict + 308
7   Python                        	       0x105456dcc _PyEval_EvalFrameDefault + 28324
8   Python                        	       0x10546289c _PyEval_Vector + 156
9   Python                        	       0x10533de4c method_vectorcall + 388
10  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
11  Python                        	       0x10546289c _PyEval_Vector + 156
12  Python                        	       0x10533de4c method_vectorcall + 388
13  Python                        	       0x10555fa50 thread_run + 200
14  Python                        	       0x1054dbcbc pythread_wrapper + 48
15  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
16  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 9:
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   select.cpython-311-darwin.so  	       0x104400c0c select_kqueue_control_impl + 716
2   Python                        	       0x10545f77c _PyEval_EvalFrameDefault + 63572
3   Python                        	       0x10546289c _PyEval_Vector + 156
4   Python                        	       0x10533de4c method_vectorcall + 388
5   Python                        	       0x10555fa50 thread_run + 200
6   Python                        	       0x1054dbcbc pythread_wrapper + 48
7   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
8   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 10:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   Python                        	       0x1054dc0c4 PyThread_acquire_lock_timed + 412
3   Python                        	       0x10555ebec acquire_timed + 308
4   Python                        	       0x10555ee30 lock_PyThread_acquire_lock + 56
5   Python                        	       0x10534ad84 method_vectorcall_VARARGS_KEYWORDS + 148
6   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
7   Python                        	       0x10546289c _PyEval_Vector + 156
8   Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
9   Python                        	       0x10546289c _PyEval_Vector + 156
10  Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
11  Python                        	       0x10546289c _PyEval_Vector + 156
12  Python                        	       0x10533de4c method_vectorcall + 388
13  Python                        	       0x10555fa50 thread_run + 200
14  Python                        	       0x1054dbcbc pythread_wrapper + 48
15  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
16  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 11:
0   libsystem_kernel.dylib        	       0x1874c57e8 __semwait_signal + 8
1   libsystem_c.dylib             	       0x1873a6568 nanosleep + 220
2   Python                        	       0x105560ff8 time_sleep + 200
3   Python                        	       0x10545e728 _PyEval_EvalFrameDefault + 59392
4   Python                        	       0x10546289c _PyEval_Vector + 156
5   Python                        	       0x10533de4c method_vectorcall + 388
6   Python                        	       0x10555fa50 thread_run + 200
7   Python                        	       0x1054dbcbc pythread_wrapper + 48
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 12:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   Python                        	       0x1054dc078 PyThread_acquire_lock_timed + 336
3   Python                        	       0x10555ebec acquire_timed + 308
4   Python                        	       0x10555ee30 lock_PyThread_acquire_lock + 56
5   Python                        	       0x10534ad84 method_vectorcall_VARARGS_KEYWORDS + 148
6   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
7   Python                        	       0x10546289c _PyEval_Vector + 156
8   Python                        	       0x10533de4c method_vectorcall + 388
9   Python                        	       0x10555fa50 thread_run + 200
10  Python                        	       0x1054dbcbc pythread_wrapper + 48
11  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
12  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 13:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 14:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 15:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 16:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 17:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 18:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 19:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   libomp.dylib                  	       0x112150b3c void __kmp_suspend_64<false, true>(int, kmp_flag_64<false, true>*) + 504
3   libomp.dylib                  	       0x112135520 kmp_flag_64<false, true>::wait(kmp_info*, int, void*) + 1880
4   libomp.dylib                  	       0x112130560 __kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 184
5   libomp.dylib                  	       0x1121340e8 __kmp_fork_barrier(int, int) + 628
6   libomp.dylib                  	       0x112110e14 __kmp_launch_thread + 340
7   libomp.dylib                  	       0x11214f00c __kmp_launch_worker(void*) + 280
8   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
9   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 20:
0   libsystem_kernel.dylib        	       0x1874cab70 poll + 8
1   libzmq.5.dylib                	       0x104abcfac zmq::signaler_t::wait(int) const + 132
2   libzmq.5.dylib                	       0x104a85360 zmq::mailbox_t::recv(zmq::command_t*, int) + 116
3   libzmq.5.dylib                	       0x104ac0590 zmq::socket_base_t::process_commands(int, bool) + 248
4   libzmq.5.dylib                	       0x104ac45c0 zmq::socket_base_t::recv(zmq::msg_t*, int) + 988
5   libzmq.5.dylib                	       0x104afbb38 s_recvmsg(zmq::socket_base_t*, zmq_msg_t*, int) + 40
6   libzmq.5.dylib                	       0x104afb798 zmq_msg_recv + 84
7   _zmq.cpython-311-darwin.so    	       0x1046e6e7c 0x1046d8000 + 61052
8   _zmq.cpython-311-darwin.so    	       0x1046f0b94 0x1046d8000 + 101268
9   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
10  Python                        	       0x10546289c _PyEval_Vector + 156
11  Python                        	       0x10533de4c method_vectorcall + 388
12  Python                        	       0x10555fa50 thread_run + 200
13  Python                        	       0x1054dbcbc pythread_wrapper + 48
14  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
15  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 21:: */Reaper
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 22:: */0
0   libsystem_kernel.dylib        	       0x1874c8340 kevent + 8
1   libzmq.5.dylib                	       0x104a825ac zmq::kqueue_t::loop() + 284
2   libzmq.5.dylib                	       0x104aa5d80 zmq::worker_poller_base_t::worker_routine(void*) + 32
3   libzmq.5.dylib                	       0x104ad92d0 thread_routine(void*) + 340
4   libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
5   libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 23:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   Python                        	       0x1054dc0c4 PyThread_acquire_lock_timed + 412
3   Python                        	       0x10555ebec acquire_timed + 308
4   Python                        	       0x10555ee30 lock_PyThread_acquire_lock + 56
5   Python                        	       0x10534ad84 method_vectorcall_VARARGS_KEYWORDS + 148
6   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
7   Python                        	       0x10546289c _PyEval_Vector + 156
8   Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
9   Python                        	       0x10546289c _PyEval_Vector + 156
10  Python                        	       0x10533de4c method_vectorcall + 388
11  Python                        	       0x10555fa50 thread_run + 200
12  Python                        	       0x1054dbcbc pythread_wrapper + 48
13  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
14  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 24:
0   libsystem_kernel.dylib        	       0x1874c59ec __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x18750355c _pthread_cond_wait + 1228
2   Python                        	       0x1054dc0c4 PyThread_acquire_lock_timed + 412
3   Python                        	       0x10555ebec acquire_timed + 308
4   Python                        	       0x10555ee30 lock_PyThread_acquire_lock + 56
5   Python                        	       0x10534ad84 method_vectorcall_VARARGS_KEYWORDS + 148
6   Python                        	       0x10545cd4c _PyEval_EvalFrameDefault + 52772
7   Python                        	       0x10546289c _PyEval_Vector + 156
8   Python                        	       0x10545f980 _PyEval_EvalFrameDefault + 64088
9   Python                        	       0x10546289c _PyEval_Vector + 156
10  Python                        	       0x10533de4c method_vectorcall + 388
11  Python                        	       0x10555fa50 thread_run + 200
12  Python                        	       0x1054dbcbc pythread_wrapper + 48
13  libsystem_pthread.dylib       	       0x187502f94 _pthread_start + 136
14  libsystem_pthread.dylib       	       0x1874fdd34 thread_start + 8

Thread 25:
0   libsystem_pthread.dylib       	       0x1874fdd20 start_wqthread + 0

Thread 26:
0   libsystem_pthread.dylib       	       0x1874fdd20 start_wqthread + 0

Versions

PyTorch version: 2.5.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

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

Python version: 3.11.1 (v3.11.1:a7a450f84a, Dec  6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] (64-bit runtime)
Python platform: macOS-14.5-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 M1 Max

Versions of relevant libraries:
[pip3] efficientnet-pytorch==0.7.1
[pip3] numpy==1.26.4
[pip3] segmentation-models-pytorch==0.3.4
[pip3] torch==2.5.0
[pip3] torchaudio==2.5.0.dev20241020
[pip3] torchmetrics==1.5.0
[pip3] torchview==0.2.6
[pip3] torchvision==0.20.0
[conda] No relevant packages

cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen

Metadata

Metadata

Assignees

Labels

high prioritymodule: crashProblem manifests as a hard crash, as opposed to a RuntimeErrormodule: edge casesAdversarial inputs unlikely to occur in practicemodule: error checkingBugs related to incorrect/lacking error checkingmodule: lossProblem is related to loss functionmodule: mpsRelated to Apple Metal Performance Shaders frameworktriage review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions