apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.2k stars 1.14k forks source link

VNCoreMLRequest with GPU utilization conflicts with Metal while deployment on IOS 11.4.1 #1036

Closed foxen closed 6 years ago

foxen commented 6 years ago

Hello! It's looks like related to #307 If I try use GPU for classification request like: request.usesCPUOnly = false and just declare SCNScene and even not init it, app on iPhone SE with IOS 11.4.1 fails with:

validateComputeFunctionArguments:852: failed assertion `Compute Function(TARR_elementwise_mul_f16_pack4): The pixel format (MTLPixelFormatRGBA32Float) of the texture (name:) bound at index 2 is incompatible with the data type (MTLDataTypeHalf) of the texture parameter (src_b [[texture(0)]]). MTLPixelFormatRGBA32Float is compatible with the data type(s) ( float ).'

nickjong commented 6 years ago

This looks like a dupe of #146, which appears to be a framework bug that shipped with macOS 10.13 and iOS 11. From that issue, the workaround seems to be to disable Metal API validation (essentially disabling some runtime assertions). (https://github.com/apple/turicreate/issues/146#issuecomment-370189366) Does that work for you?

znation commented 6 years ago

This is a dupe of #146. Closing.

foxen commented 6 years ago

@nickjong Yes, It does work. Thank you!