You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug std::bad_alloc when python calls convolution() in libintel_npu_acceleration_library.so
Maybe caused by the wrong argtype definition in bindings.py
To Reproduce
Steps to reproduce the behavior: python==3.10, torch==2.4.1+cpu, torchvision==0.19.1+cpu, openvino==2024.3.0, intel_npu_acceleration_library==1.3.0
run the following python code:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
Possible Reason
stack trace:
ps: -O0 -ggdb is added in CMakeLists.txt to export debug symbols and install the lib from src by python setup.py install
run python with gdb and get the following stack backtrace when throwing std::bad_alloc:
[BUG]: in stack 15 convolution, argument pad_begins_size=140733193388034 (it is 0x7fff00000002)
In the source of 1.3.0 and later, the argtypes in intel_npu_acceleration_library/backend/bindings.py do not match with the ones in src/bindings.cpp.
In the python file, the sizes are defined as ctypes.c_int, while in the c++ source, they are defined as size_t, which are incompatible with each other.
Possible Solution
Change the argtypes to ctypes.c_uint64 will fix the bug.
BTW, many other argtypes are wrong in bindings.py, e.g. dim0 & dim1 in linear(), they have not been fixed yet in the latest commit.
Platform
HW: Intel Ultra 9 185H (Meteor Lake)
OS: Ubuntu 22.04
Version 1.3.0 and later.
The text was updated successfully, but these errors were encountered:
Describe the bug
std::bad_alloc
when python callsconvolution()
inlibintel_npu_acceleration_library.so
Maybe caused by the wrong argtype definition in
bindings.py
To Reproduce
Steps to reproduce the behavior:
python==3.10, torch==2.4.1+cpu, torchvision==0.19.1+cpu, openvino==2024.3.0, intel_npu_acceleration_library==1.3.0
run the following python code:
output:
Possible Reason
stack trace:
ps:
-O0 -ggdb
is added inCMakeLists.txt
to export debug symbols and install the lib from src bypython setup.py install
run python with gdb and get the following stack backtrace when throwing
std::bad_alloc
:[BUG]: in stack 15
convolution
, argumentpad_begins_size=140733193388034
(it is0x7fff00000002
)In the source of 1.3.0 and later, the argtypes in
intel_npu_acceleration_library/backend/bindings.py
do not match with the ones insrc/bindings.cpp
.In the python file, the sizes are defined as
ctypes.c_int
, while in the c++ source, they are defined assize_t
, which are incompatible with each other.Possible Solution
Change the argtypes to
ctypes.c_uint64
will fix the bug.BTW, many other argtypes are wrong in
bindings.py
, e.g.dim0
&dim1
inlinear()
, they have not been fixed yet in the latest commit.Platform
The text was updated successfully, but these errors were encountered: