Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Does NPU or GPU support accumulator data type INT32 in convolution? #28193

Open
3 tasks done
wenxuanxie opened this issue Dec 24, 2024 · 1 comment
Open
3 tasks done
Assignees
Labels
bug Something isn't working support_request

Comments

@wenxuanxie
Copy link

OpenVINO Version

2024.6.0

Operating System

Windows System

Device used for inference

NPU

Framework

None

Model used

Custom (1 conv + 1 convert, see below)

Issue description

I want to perform integer-based convolution and have designed a simple test case for this purpose. The network consists of a single convolution layer, where both the input tensor and the weight tensor have the shape [1, 11111, 1, 1] and are filled with the value 127. The output is then converted to INT32. The expected output of this operation should be 127 * 127 * 11111 = 179209319. However, I have tested 3 different configurations as shown below, and none of them produced the expected output.

Note that ('NPU', np.int8) appears to be an invalid configuration and will raise errors.

import openvino as ov
from openvino.runtime import opset15
import numpy as np

# configurations
device, dtype = ('NPU', np.int32)    # output: 65504
# device, dtype = ('GPU', np.int32)  # output: 179199248
# device, dtype = ('GPU', np.int8)   # output: 179209312

shape = (1, 11111, 1, 1)
np_array = np.full(shape, 127, dtype=dtype)

input = opset15.parameter(shape, dtype)
weight = opset15.constant(np_array)
conv = opset15.convolution(input, weight, (1, 1), (0, 0), (0, 0), (1, 1))
conv = opset15.convert(conv, np.int32)

model = ov.Model(conv, [input], "conv_model")
compiled_model = ov.Core().compile_model(model, device)

output_layer = compiled_model.output(0)
output_data = compiled_model(np_array)[output_layer]
print(output_data.item())

Step-by-step reproduction

  1. Prepare OpenVINO package. For example, pip install openvino==2024.6.0.
  2. Save the code snippet above as a local file, e.g., test_case.py.
  3. python test_case.py.
  4. A single integer will appear in the command line: either 65504, 179199248, or 179209312, depending on the configuration.

Relevant log output

No response

Issue submission checklist

  • I'm reporting an issue. It's not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.
@Aznie-Intel
Copy link

Hi, @wenxuanxie I observed the same value from my end. Can you share the error when configuring with NPU?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support_request
Projects
None yet
Development

No branches or pull requests

3 participants