Hi, I am using Unreal Engine(5.4.4/5.5.1) Neural Network Extension (NNE) with RDG HLSL, which works fine for a simple denoising neural network. However, I’m now creating a network for a super-resolution task and utilizing the ConvTranspose operator. Unfortunately, the RDG HLSL compilation is throwing the following error.
LogNNE: Warning: Found unsupported attribute ‘kernel_shape’.
LogNNE: Warning: RDG MLOperatorRegistry failed to validate operator:ConvTranspose
LogNNE: Warning: Model validator ‘RDG Model validator’ detected an error.
LogNNE: Warning: Model is not valid.
LogNNE: Warning: UNNERuntimeRDGHlsl cannot create a model from the model data with id 2D3254744755AB7C28B918878B33B370
LogTemp: Error: Could not create the RDG model
Upon investigating the Unreal Engine source code (located at E:\UnrealEngine\Engine\Plugins\Experimental\NNERuntimeRDG\Source\NNERuntimeRDG\Private\Hlsl\NNERuntimeRDGConvTranspose.cpp), I noticed that the kernel_shape attribute is commented out. Could you explain why this is the case and help me resolve the issue?
bool ValidateConvTransposeOperator(const NNE::FAttributeMap& AttributeMap, TConstArrayView InputTypes, TConstArrayViewNNE::FSymbolicTensorShape InputShapes)
{
bool bIsValid = true;
FAttributeValidator AttributeValidator;
AttributeValidator.AddOptional(TEXT("auto_pad"), ENNEAttributeDataType::String);
AttributeValidator.AddOptional(TEXT("dilations"), ENNEAttributeDataType::Int32Array);
AttributeValidator.AddOptional(TEXT("group"), ENNEAttributeDataType::Int32);
//AttributeValidator.AddOptional(TEXT("kernel_shape"), ENNEAttributeDataType::Int32Array);
AttributeValidator.AddOptional(TEXT("output_padding"), ENNEAttributeDataType::Int32Array);
//AttributeValidator.AddOptional(TEXT("output_shape"), ENNEAttributeDataType::Int32Array);
AttributeValidator.AddOptional(TEXT("pads"), ENNEAttributeDataType::Int32Array);
AttributeValidator.AddOptional(TEXT("strides"), ENNEAttributeDataType::Int32Array);
bIsValid &= AttributeValidator.Validate(AttributeMap);
FInputValidator InputValidator;
InputValidator.AddSupportedType(ENNETensorDataType::Float);
InputValidator.AddRequired();
InputValidator.AddRequired();
InputValidator.AddOptional();
bIsValid &= InputValidator.Validate(InputTypes);
return bIsValid;
}
As far as I understand, while creating a neural network in pytorch with convtranspose operator, the kernel_size attribute needs to be used. It is then renamed to kernel_shape in onnx after conversion.
So, I uncomment the above line (kernel shape one), rebuild UE, and the model compiles fine, but the output is a black screen (so the output is incorrect). And, then I use the stat GPU memory command for profiling and it shows that the ConvTranspose operator is extremely slow. So, I am wondering now if it was commented out on purpose.