A method of generating, at a computer system comprising a neural network accelerator, gradients of a loss metric for a neural network (NN) with respect to weights of a convolution layer of the NN, the convolution layer of the NN configured to receive an input tensor of input values and a weight tensor of weights, and generate an output tensor of output values, the method comprising: performing , using a plurality of convolution engines of the neural network accelerator, a group convolution between a first y -dimensional tensor and a second z-dimensional tensor wherein z = y + 1 and the second z-dimensional tensor comprises one or more filters and each filter comprises a single channel, the first y -dimensional tensor being formed of a set of values from the input tensor, and the second z-dimensional tensor being formed of a set of values from an output gradient tensor comprising gradients of the loss metric for the NN with respect to the output values, each convolution engine of the plurality of convolution engines being dedicated hardware configured to perform convolution operations; wherein the first y -dimensional tensor , the second z -dimensional tensor and the group convolution are configured to generate an output of a convolution operation between each channel of the set of values of the input tensor and each channel of the set of values of the output gradient tensor; wherein the group convolution between the first y -dimensional tensor and the second z -dimensional tensor is divided into a plurality of distinct sub-convolutions, and performing the group convolution using the plurality of convolution engines of the neural network accelerator comprises processing in parallel multiple sub-convolutions of the plurality of sub-convolutions by separate convolution engines of the plurality of convolution engines. performing , using a plurality of convolution engines of the neural network accelerator, a group convolution between a first y -dimensional tensor and a second z-dimensional tensor wherein z = y + 1 and the second z-dimensional tensor comprises one or more filters and each filter comprises a single channel, the first y -dimensional tensor being formed of a set of values from the input tensor, and the second z-dimensional tensor being formed of a set of values from an output gradient tensor comprising gradients of the loss metric for the NN with respect to the output values, each convolution engine of the plurality of convolution engines being dedicated hardware configured to perform convolution operations; wherein the first y -dimensional tensor , the second z -dimensional tensor and the group convolution are configured to generate an output of a convolution operation between each channel of the set of values of the input tensor and each channel of the set of values of the output gradient tensor; wherein the group convolution between the first y -dimensional tensor and the second z -dimensional tensor is divided into a plurality of distinct sub-convolutions, and performing the group convolution using the plurality of convolution engines of the neural network accelerator comprises processing in parallel multiple sub-convolutions of the plurality of sub-convolutions by separate convolution engines of the plurality of convolution engines. <EOS>