You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a program with 3 inputs, all have a flexible enumerated shape, two share the same shape. The input shapes are:
shapes_1 = [(1, 3, 64, 16), (1, 3, 64, 32)] # last dimension shape varies, called Length1
shapes_2 = [(1, 3, 64, 256), (1, 3, 64, 512)] # last dimension shape varies, called Length2
After building, the model runs correctly with Length1=16 and Length2=256, or Length1=32 and Length2=512, but when I try to run with Length1=32 and Length2=256 it fails.
I tried extending the enumerated shapes, to match different combinations (setting shape_1=[(1, 3, 64, 16), (1, 3, 64, 32), (1, 3, 64, 32), (1, 3, 64, 16)]) and analogous for shape_2), but it does not work.
System environment (please complete the following information):
coremltools version: 8.0b1
OS (e.g. MacOS version or Linux type): 15.0 beta 2
Additional context
Also, when I remove the last comment in the program (#, key_cache), when running a prediction it does not raise an exception when running with different shapes, but all inputs all converted to 0s (query is an array of only 0 and same of key_cache and value_cache). I'll report this issue in Apple Forums and Feedback Assistant. But I wasn't sure if the first part of the problem is just a conversion issue or intrinsic CoreML issue, thus why I reported here also.
Additional Swift trace
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There is no function in the program library for the provided input=query = MultiArray :Float161×3×64×16 array
key_cache = MultiArray : Float161×3×64×512 array
value_cache = MultiArray : Float161×3×64×512 array
.'
*** First throw call stack:(0 CoreFoundation 0x00000001998f6920 __exceptionPreprocess +1761 libobjc.A.dylib 0x00000001993deb1c objc_exception_throw+762 CoreFoundation 0x00000001998f6810+[NSException exceptionWithName:reason:userInfo:]+03 CoreML 0x00000001a3745a98-[MLE5EnumeratedShapeExecutionStreamOperationPool takeOutOperationForFeatures:error:]+4804 CoreML 0x00000001a3845a78-[MLE5ExecutionStream setupOperationForInputFeatures:operationPool:error:]+925 CoreML 0x00000001a37f58d0-[MLE5Engine _cleanUpAndReconfigureStream:forInputFeatures:error:]+1086 CoreML 0x00000001a37f4be8-[MLE5Engine _predictionFromFeatures:options:completionHandler:]+2567 CoreML 0x00000001a37f511c-[MLE5Engine submitPredictionRequest:completionHandler:]+1248 CoreML 0x00000001a37cc780 __62-[MLDelegateModel _submitPredictionRequest:completionHandler:]_block_invoke +4209 libdispatch.dylib 0x00000001001b0b6c _dispatch_call_block_and_release +3210 libdispatch.dylib 0x00000001001b28ac _dispatch_client_callout +2011 libdispatch.dylib 0x00000001001b6110 _dispatch_continuation_pop +70012 libdispatch.dylib 0x00000001001b50ac _dispatch_async_redirect_invoke +61613 libdispatch.dylib 0x00000001001ca9b8 _dispatch_root_queue_drain +40414 libdispatch.dylib 0x00000001001cb5c4 _dispatch_worker_thread2+18815 libsystem_pthread.dylib 0x000000010024d0c4 _pthread_wqthread +22816 libsystem_pthread.dylib 0x0000000100254cf0 start_wqthread +8)
libc++abi: terminating due to uncaught exception of type NSException
The text was updated successfully, but these errors were encountered:
0seba
added
the
bug
Unexpected behaviour that should be corrected (type)
label
Jul 9, 2024
Hi @0seba, there appears to be some wrong deduplication going on in Core ML framework... So yes it is correct to file issue on Apple forum
Concretely, I tried your reproduce, and it errors out indeed. Repeating enumerated shapes with different orders does not help. Only reverting enumerated shapes works (i.e. only one of 16 x 256 or 16 x 512 works...)
This turns out to be more involved. Some progress has been made: We have 2 fixes for our protobuf. Can continue to investigate this issue once those protobuf fixes land
🐞Describing the bug
I have a program with 3 inputs, all have a flexible enumerated shape, two share the same shape. The input shapes are:
shapes_1 = [(1, 3, 64, 16), (1, 3, 64, 32)] # last dimension shape varies, called Length1
shapes_2 = [(1, 3, 64, 256), (1, 3, 64, 512)] # last dimension shape varies, called Length2
After building, the model runs correctly with Length1=16 and Length2=256, or Length1=32 and Length2=512, but when I try to run with
Length1=32
andLength2=256
it fails.I tried extending the enumerated shapes, to match different combinations (setting
shape_1=[(1, 3, 64, 16), (1, 3, 64, 32), (1, 3, 64, 32), (1, 3, 64, 16)])
and analogous forshape_2
), but it does not work.Stack Trace
Running on Python trace
To Reproduce
System environment (please complete the following information):
Additional context
Also, when I remove the last comment in the program (
#, key_cache
), when running a prediction it does not raise an exception when running with different shapes, but all inputs all converted to0
s (query
is an array of only0
and same ofkey_cache
andvalue_cache
). I'll report this issue in Apple Forums and Feedback Assistant. But I wasn't sure if the first part of the problem is just a conversion issue or intrinsic CoreML issue, thus why I reported here also.Additional Swift trace
The text was updated successfully, but these errors were encountered: