C++ implementation of NN operations

Hello,

I could deploy UNet on ARM based system. but I get segmentation fault when running it, the fault in “fuse_pad” operation, I need to debug the CPP code of this operation to know the reason of the fault, any idea how can I find the CPP implementation of this operation?

Can you share the crash log (stack trace)?

I am not able to get the stack trace at the moment, but after some debugging I could reach to this point, in the Run() function, op_execs_[i] is called, the crash takes place right after the second call, which is mapped to “fuse_pad” in the JSON script. I just need to know where can I find those operations in TVM source code.

Note:
In nn.h there is inline function called pad(), I added a debugging print there, but it isn’t called in the C++ framework. is there other place should I check?

The files like nn.h are limited to compiler and not part of runtime.
Hope the target is CPU not GPU, pls confirm.

pad is a simple operation, don’t understand why it could cause a fault.
Please share the in and out shapes of fuse_pad operator (look into the graph json).

Also you may try disabling compiler optimization.

The target is CPU.

The node entry is:

{
“nodes”: [
{
“op”: “null”,
“name”: “input_1”,
“inputs”: []
},
{
“op”: “tvm_op”,
“name”: “pad0”,
“attrs”: {
“flatten_data”: “0”,
“func_name”: “fuse_pad”,
“num_inputs”: “1”,
“num_outputs”: “1”
},
“inputs”: [[0, 0, 0]]
},

About the shapes

"shape": ["list_shape", [
    [1, 2, 80, 600], 
    [1, 2, 82, 602], 

what do you mean by

won’t that code be part of later generated .so file which in turn will be called during runtime? and if not, where are the source code of the runtime operations?

The source code of operations is a generated code by the compiler adding debug there is not that straight forward, also debug there is not necessary as the all checks are done on this piece of code by the compiler.

Can you share the sample script to reproduce your case ?

From another post of yours, I think your usage of C++ API is wrong. Padding never causes seg fault.

1 Like