Skip to content

Seg fault when running hcl.build() #472

@sjz38

Description

@sjz38

In the HCL Ultranet implementation https://github.com/sjz38/my_ultranet/tree/yolo_conv, I made changes to the convolution function I created to support the inclusion of a bias term (so that the convolution in the YOLO layer could be added to the FPGA/hardware side). After making these modifications, I was able to verify on CPU that the implementation produces the correct results. However, when I run hls_test.py to generate the HLS CPP code from the HCL code, a seg fault will result quite often (sometimes it is able to run successfully though). I was able to isolate the seg fault to the hcl.build() function call on line 219 (https://github.com/sjz38/my_ultranet/blob/yolo_conv/hls_test.py#L219). To further isolate the issue, I used gdb to get a stack trace of the code execution and got the following error:

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
std::string::compare (this=<optimized out>, __s=0x7fff898ed995 "_top")
    at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/build/build-cc-gcc-final/x86_64-conda_cos6-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1422
1422    /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/build/build-cc-gcc-final/x86_64-conda_cos6-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc: No such file or directory.
Missing separate debuginfos, use: debuginfo-install libX11-1.6.7-4.el7_9.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libglvnd-1.0.1-0.8.git5baa1e5.el7.x86_64 libglvnd-glx-1.0.1-0.8.git5baa1e5.el7.x86_64 ncurses-libs-5.9-14.20130511.el7_4.x86_64

It seems as though there is a std::string::compare call from a non-existent directory. Looking at the stack trace below, it looks like this is coming from an HCL function which invokes a TVM::schedule::move_to call.

#0  std::string::compare (this=<optimized out>, __s=0x7fff898ed995 "_top")
    at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/build/build-cc-gcc-final/x86_64-conda_cos6-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1422
#1  0x00007fff86f4dffe in TVM::Schedule::move_to(TVM::Tensor const&, TVM::Stage, Halide::Internal::DeviceType, Halide::Internal::StreamType, int, TVM::Array<Halide::Expr, void>) ()
   from /home/sjz38/.local/lib/python3.7/site-packages/heterocl-0.3-py3.7.egg/lib/libhcl.so
#2  0x00007fff86f91cd7 in std::_Function_handler<void (TVM::runtime::TVMArgs, TVM::runtime::TVMRetValue*), TVM::{lambda(TVM::runtime::TVMArgs, TVM::runtime::TVMRetValue*)#59}>::_M_invoke(std::_Any_data const&, TVM::runtime::TVMArgs&&, TVM::runtime::TVMRetValue*&&) () from /home/sjz38/.local/lib/python3.7/site-packages/heterocl-0.3-py3.7.egg/lib/libhcl.so
#3  0x00007fff87263f08 in HCLTVMFuncCall ()
   from /home/sjz38/.local/lib/python3.7/site-packages/heterocl-0.3-py3.7.egg/lib/libhcl.so

I am not sure what the solution to this issue is. Any advice would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions