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

libc++abi: terminating due to uncaught exception of type std::runtime_error: [Event::stream] Cannot access stream on invalid event. #1912

Open
chopin-007 opened this issue Feb 28, 2025 · 3 comments

Comments

@chopin-007
Copy link

Running a small model on a M4 Mac and after around 60-100 epochs I keep getting:
libc++abi: terminating due to uncaught exception of type std::runtime_error: [Event::stream] Cannot access stream on invalid event.
The model runs completely fine at the beginning and the it keeps crashing.

@awni
Copy link
Member

awni commented Feb 28, 2025

Can you share code that reproduces the error you're seeing?

@chopin-007
Copy link
Author

it's not exactly the same code but it should give you an indication of more or less what could cause this incident, I've identified a part of my script with these simple calculations and after taking them out the error no longer occurs (not sure which exact line was responsible for it):

import mlx.core as mx

arr_a[start_sequence:end_idx] += mx.where((arr_b > 50) & (arr_c > 0) & (arr_d < 500) & (var_a > 3), 1, 0)
arr_a_flat = arr_a[start_idx:end_idx]
arr_x = (arr_b > 50) & (arr_d < 600)
arr_y = (arr_c < 20) | (arr_d >= 600)
arr_z = mx.sum(arr_a_flat)

@awni
Copy link
Member

awni commented Mar 3, 2025

Unfortunately that snippet isn’t sufficient for us to reproduce and debug this. If you can provide a standalone program that we can run that reproduces the issue that would be great.

Please also provide some more details on your environment like OS, MLX version and hardware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants