Function(depthwiseConvolution): missing threadgroupMemory binding at index 0 for lM[0]
up vote
0
down vote
favorite
I'm trying to execute a simple DepthwiseConvolution kernel with Metal Performance Shaders on MacOS and have problems with it. First I initialize an MPSImage
(called debugInputImage
) with proper size filled with some number, say 1.0
. Then I create my convolutional kernel:
convolution_depthwise_0 = MPSCNNConvolution(device: device,
weights: datasource_depthwise_0)
Where datasource_depthwise_0
is an instance of MPSCNNConvolutionDataSource
with the following descriptor:
func descriptor() -> MPSCNNConvolutionDescriptor {
var desc = MPSCNNDepthWiseConvolutionDescriptor(kernelWidth: 3,
kernelHeight: 3,
inputFeatureChannels: 32,
outputFeatureChannels: 32)
return desc
}
This is how I initialise the input image:
let imageDescriptor = MPSImageDescriptor(channelFormat: .float16,
width: 256, height: 256, featureChannels: 32)
debugInputImage = MPSImage(device: device,
imageDescriptor: imageDescriptor)
var arrayOfOnes = Array(repeating: Float(1.0),
count: imageDescriptor.width * imageDescriptor.height
* imageDescriptor.featureChannels)
let arrayOfOnes16 = toFloat16(&arrayOfOnes, size: arrayOfOnes.count)
debugInputImage.writeBytes(arrayOfOnes16,
dataLayout: MPSDataLayout.HeightxWidthxFeatureChannels, imageIndex: 0)
When I run all of this:
let commandBuffer = commandQueue.makeCommandBuffer()!
let outImage = convolution_depthwise_0.encode(commandBuffer: commandBuffer,
sourceImage: debugInputImage)
And get this error (at this line let outImage = convolution_depthwise_0.encode(...
):
validateComputeFunctionArguments:860: failed assertion `Compute
Function(depthwiseConvolution): missing threadgroupMemory binding
at index 0 for lM[0].'
For regular convolution everything is fine, only for Depthwise I get this problem.
What could be the reason for that error?
System: MacOS 10.14, XCode 10.1 beta 3
Only MPSCNNDepthWiseConvolutionDescriptor doesn't work. I have no problems with MPSCNNConvolutionDescriptor. I also have no problems on iOS, only Mac OS.
metal metal-performance-shaders
|
show 5 more comments
up vote
0
down vote
favorite
I'm trying to execute a simple DepthwiseConvolution kernel with Metal Performance Shaders on MacOS and have problems with it. First I initialize an MPSImage
(called debugInputImage
) with proper size filled with some number, say 1.0
. Then I create my convolutional kernel:
convolution_depthwise_0 = MPSCNNConvolution(device: device,
weights: datasource_depthwise_0)
Where datasource_depthwise_0
is an instance of MPSCNNConvolutionDataSource
with the following descriptor:
func descriptor() -> MPSCNNConvolutionDescriptor {
var desc = MPSCNNDepthWiseConvolutionDescriptor(kernelWidth: 3,
kernelHeight: 3,
inputFeatureChannels: 32,
outputFeatureChannels: 32)
return desc
}
This is how I initialise the input image:
let imageDescriptor = MPSImageDescriptor(channelFormat: .float16,
width: 256, height: 256, featureChannels: 32)
debugInputImage = MPSImage(device: device,
imageDescriptor: imageDescriptor)
var arrayOfOnes = Array(repeating: Float(1.0),
count: imageDescriptor.width * imageDescriptor.height
* imageDescriptor.featureChannels)
let arrayOfOnes16 = toFloat16(&arrayOfOnes, size: arrayOfOnes.count)
debugInputImage.writeBytes(arrayOfOnes16,
dataLayout: MPSDataLayout.HeightxWidthxFeatureChannels, imageIndex: 0)
When I run all of this:
let commandBuffer = commandQueue.makeCommandBuffer()!
let outImage = convolution_depthwise_0.encode(commandBuffer: commandBuffer,
sourceImage: debugInputImage)
And get this error (at this line let outImage = convolution_depthwise_0.encode(...
):
validateComputeFunctionArguments:860: failed assertion `Compute
Function(depthwiseConvolution): missing threadgroupMemory binding
at index 0 for lM[0].'
For regular convolution everything is fine, only for Depthwise I get this problem.
What could be the reason for that error?
System: MacOS 10.14, XCode 10.1 beta 3
Only MPSCNNDepthWiseConvolutionDescriptor doesn't work. I have no problems with MPSCNNConvolutionDescriptor. I also have no problems on iOS, only Mac OS.
metal metal-performance-shaders
1
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
1
Are yourinputFeatureChannels
andoutputFeatureChannels
the same value?
– Matthijs Hollemans
Nov 8 at 10:58
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
1
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39
|
show 5 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to execute a simple DepthwiseConvolution kernel with Metal Performance Shaders on MacOS and have problems with it. First I initialize an MPSImage
(called debugInputImage
) with proper size filled with some number, say 1.0
. Then I create my convolutional kernel:
convolution_depthwise_0 = MPSCNNConvolution(device: device,
weights: datasource_depthwise_0)
Where datasource_depthwise_0
is an instance of MPSCNNConvolutionDataSource
with the following descriptor:
func descriptor() -> MPSCNNConvolutionDescriptor {
var desc = MPSCNNDepthWiseConvolutionDescriptor(kernelWidth: 3,
kernelHeight: 3,
inputFeatureChannels: 32,
outputFeatureChannels: 32)
return desc
}
This is how I initialise the input image:
let imageDescriptor = MPSImageDescriptor(channelFormat: .float16,
width: 256, height: 256, featureChannels: 32)
debugInputImage = MPSImage(device: device,
imageDescriptor: imageDescriptor)
var arrayOfOnes = Array(repeating: Float(1.0),
count: imageDescriptor.width * imageDescriptor.height
* imageDescriptor.featureChannels)
let arrayOfOnes16 = toFloat16(&arrayOfOnes, size: arrayOfOnes.count)
debugInputImage.writeBytes(arrayOfOnes16,
dataLayout: MPSDataLayout.HeightxWidthxFeatureChannels, imageIndex: 0)
When I run all of this:
let commandBuffer = commandQueue.makeCommandBuffer()!
let outImage = convolution_depthwise_0.encode(commandBuffer: commandBuffer,
sourceImage: debugInputImage)
And get this error (at this line let outImage = convolution_depthwise_0.encode(...
):
validateComputeFunctionArguments:860: failed assertion `Compute
Function(depthwiseConvolution): missing threadgroupMemory binding
at index 0 for lM[0].'
For regular convolution everything is fine, only for Depthwise I get this problem.
What could be the reason for that error?
System: MacOS 10.14, XCode 10.1 beta 3
Only MPSCNNDepthWiseConvolutionDescriptor doesn't work. I have no problems with MPSCNNConvolutionDescriptor. I also have no problems on iOS, only Mac OS.
metal metal-performance-shaders
I'm trying to execute a simple DepthwiseConvolution kernel with Metal Performance Shaders on MacOS and have problems with it. First I initialize an MPSImage
(called debugInputImage
) with proper size filled with some number, say 1.0
. Then I create my convolutional kernel:
convolution_depthwise_0 = MPSCNNConvolution(device: device,
weights: datasource_depthwise_0)
Where datasource_depthwise_0
is an instance of MPSCNNConvolutionDataSource
with the following descriptor:
func descriptor() -> MPSCNNConvolutionDescriptor {
var desc = MPSCNNDepthWiseConvolutionDescriptor(kernelWidth: 3,
kernelHeight: 3,
inputFeatureChannels: 32,
outputFeatureChannels: 32)
return desc
}
This is how I initialise the input image:
let imageDescriptor = MPSImageDescriptor(channelFormat: .float16,
width: 256, height: 256, featureChannels: 32)
debugInputImage = MPSImage(device: device,
imageDescriptor: imageDescriptor)
var arrayOfOnes = Array(repeating: Float(1.0),
count: imageDescriptor.width * imageDescriptor.height
* imageDescriptor.featureChannels)
let arrayOfOnes16 = toFloat16(&arrayOfOnes, size: arrayOfOnes.count)
debugInputImage.writeBytes(arrayOfOnes16,
dataLayout: MPSDataLayout.HeightxWidthxFeatureChannels, imageIndex: 0)
When I run all of this:
let commandBuffer = commandQueue.makeCommandBuffer()!
let outImage = convolution_depthwise_0.encode(commandBuffer: commandBuffer,
sourceImage: debugInputImage)
And get this error (at this line let outImage = convolution_depthwise_0.encode(...
):
validateComputeFunctionArguments:860: failed assertion `Compute
Function(depthwiseConvolution): missing threadgroupMemory binding
at index 0 for lM[0].'
For regular convolution everything is fine, only for Depthwise I get this problem.
What could be the reason for that error?
System: MacOS 10.14, XCode 10.1 beta 3
Only MPSCNNDepthWiseConvolutionDescriptor doesn't work. I have no problems with MPSCNNConvolutionDescriptor. I also have no problems on iOS, only Mac OS.
metal metal-performance-shaders
metal metal-performance-shaders
edited Nov 9 at 10:06
asked Nov 7 at 16:55
Alexander Ponomarev
98211121
98211121
1
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
1
Are yourinputFeatureChannels
andoutputFeatureChannels
the same value?
– Matthijs Hollemans
Nov 8 at 10:58
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
1
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39
|
show 5 more comments
1
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
1
Are yourinputFeatureChannels
andoutputFeatureChannels
the same value?
– Matthijs Hollemans
Nov 8 at 10:58
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
1
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39
1
1
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
1
1
Are your
inputFeatureChannels
and outputFeatureChannels
the same value?– Matthijs Hollemans
Nov 8 at 10:58
Are your
inputFeatureChannels
and outputFeatureChannels
the same value?– Matthijs Hollemans
Nov 8 at 10:58
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
1
1
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39
|
show 5 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194202%2ffunctiondepthwiseconvolution-missing-threadgroupmemory-binding-at-index-0-for%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What OS are you running this on? I've been using depthwise convolutions a lot but haven't come across this error yet (on iOS anyway). It seems like an error in MPS. The only other thing I can think of is that perhaps your MPSImage is in a format not supported by the depthwise convolution.
– Matthijs Hollemans
Nov 8 at 10:02
@MatthijsHollemans I am running it on MacOS. I have added it to the question. I haven't tried it on IOS yet but probably it's something I have to do.
– Alexander Ponomarev
Nov 8 at 10:44
1
Are your
inputFeatureChannels
andoutputFeatureChannels
the same value?– Matthijs Hollemans
Nov 8 at 10:58
@MatthijsHollemans yes, they are the same. Updated values in the question. Otherwise (just for example) I get two kind of errors: "multipler not 1 is not supported" or "output should be multiple of input". :) So those errors look easily understandable.
– Alexander Ponomarev
Nov 8 at 11:08
1
Is the validation layer enabled for a playground?
– Ken Thomases
Nov 8 at 16:39