Help Troubleshooting #160
Replies: 3 comments 9 replies
-
I am not sure the shape of value, but I wonder if let v = value[0].asArray(Float.self)[0] Anyway, to your question: a segmentation fault with a stack depth of 6000 sounds like a stack overflow trying to either evaluate or deallocate a very large graph. There is code in @awni or @angeloskath do you see anything that stands out here? We might need more context to reproduce this and track it down. |
Beta Was this translation helpful? Give feedback.
-
The let vector_pair = mlx_closure_value_and_grad_apply(valueAndGrad, input_vector)! is to handle the fact that the C API can't indicate if a return value is optional (and thus everything is optional). We use the |
Beta Was this translation helpful? Give feedback.
-
It's not implausible that you are hitting a stack overflow in Perhaps you could provide more information so we can help out / reproduce? |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm implementing t-SNE using MLX as a learning exercise. I have setup a simple gradient descent loop using the following code:
It works great! Until I feed it ~893 documents, at which point I'm getting "EXC_BAD_ACCESS (code=2, address=0x16ff1bff8)" from valueAndGradient (Transforms+Internal, line 14) (plus about 6,000 calls down the stack into C land). The fact that the Swift call ends with a ! makes me wonder if this is something that we should be handling that snuck through the cracks, or maybe it's just me.
I'm new to this, trying to understand how to best debug from here -- can anyone provide me a nudge in the right direction? (Not sure how to create a minimal example without sharing all the data too ... but I've tried with multiple data sets and the error pops up at the same number of documents for different data sets... works from 3 all the way up to about 893, then crashes).
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions