Forums - Why does the blob_size / blob.size() depend on the layer type value I first packed in?

8 posts / 0 new
Last post
Why does the blob_size / blob.size() depend on the layer type value I first packed in?
gino0
Join Date: 26 May 19
Posts: 12
Posted: Mon, 2019-06-24 00:36

I am using SNPE 1.25.1.310 and I am trying to follow the UDL tutorial from here: https://developer.qualcomm.com/docs/snpe/udl_tutorial.html. 

I am confused with the value of blob_size (by snpe-dlc-info) and the blob.size() of the UDLContext object.

In preparing the blob, I followed the tutorial and first packed an int for the layer type:

packed = struct.pack('i', layer_type)   # layer_type=5, will result in '\x05\x00\x00\x00' getting packed 

After generating the DLC, I then used snpe-dlc-info to check the output, and I noticed that for my UDL, it displays "blob_size: 1", which is not correct because I am sure I packed the rest of the weights data and the total packed size should be around 589,852 for my UDL (checked with len(packed)). I then checked the code for snpe-dlc-info, I found that it actually gets the packed layer_type to compute the blob_size.

# in snpe-1.25.1.310/lib/python/snpe/dlc_utils/snpe_dlc_utils.py
 
def extract_user_defined(self, layer):
    print(repr(layer))   # dict, with u'blob': '\x05'
    self.add_parm("blob_size", len(layer['blob']))
Is that code correct? Of course, the resulting "blob_size" would then be 1 because "\x05" is just 1 byte. If I use layer_type = 6843009, the layer['blob'] value would be u'blob': '\x81jh' resulting in blob_size of 3. It seems the blob_size value depends on the number of bytes of layer_type that I packed-in (I checked with different values). That doesn't look right.
 
Now, on to the C++ code. I am also getting a similar problem because the UDLContext object is returning a blob.size() same as the blob_size value displayed by snpe-dlc-info. When I checked the code in UDLContext.hpp, I found this:
// in /snpe-1.25.1.310/include/zdl/DlSystem/UDLContext.hpp
 
UDLContext(const std::string& name,
           const std::string& type,
           int32_t id,
           const std::string& blob) :
   m_Name(name), m_Type(type), m_Size(blob.size()), m_Id(id) {
   // FIXME not dealing with alloc error
   m_Buffer = new uint8_t[m_Size];
   std::memcpy(m_Buffer, blob.data(), m_Size);
}

Notice that m_Size is based on the length of the blob object. Using the sample layer_type values I used above, I again get m_Size of 1 and 3 for layer_type=5 and layer_type=6843009, respectively. This also does not look right. Furthermore, I might be wrong, but size() should not be the appropriate way to measure the length of C-style strings (which I assume is the data type of the packed bytes from the Python code).

So my main question is, are the 1st bytes packed into the blob used for computing the blob size? Why am I getting blob_size / blob.size() based on the layer type value I put in? 

  • Up0
  • Down0
gino0
Join Date: 26 May 19
Posts: 12
Posted: Thu, 2019-07-11 18:54

I think this is related to my other issue:

If I use SNPE 1.24, it is working correct.

If I use SNPE 1.25 - 1.27 (latest at the time of writing), it is bugged.

  • Up0
  • Down0
huid.peng
Join Date: 11 Jul 19
Posts: 4
Posted: Tue, 2019-08-06 19:39

I also got blob_size euqals 1 not 2017 shown in the tutorial when i use snpe-dlc-info to check the dlc file.

SNPE version is snpe-1.27.1.382

I have checked the packed data in the mnist customscale model, listed as below:

The related python script seems normal

0x1 0x0 0x0 0x0 0x0 0x1 0x0 0x0 0x0 0xf4 0x1 0x0 0x0 0xf4 0x1 0x0 0x0 0x32 0x6 0x7f 0x3e 0xd5 0xe0 0x1e 0x3b 0x42 0x45 0x10 0x3f 0xe4 0xe5 0x81 0xbd 0xc 0xa9 0xd8 0xbc 0xe1 0x12 0xa9 0x3e 0x93 0x3d 0x46 0x3c 0x92 0x46 0x6e 0xbd 0x6e 0xeb 0x7c 0xbe 0x62 0x29 0x22 0x3d 0x70 0x8b 0x94 0x3d 0x18 0x0 0x71 0xba 0x47 0xb0 0xe2 0x3c 0x35 0x3a 0xbc 0x3d 0x74 0xa1 0x61 0xb9 0xb1 0xbf 0x3a 0xbc 0xe9 0xb 0x39 0xbd 0xf 0xc2 0xb4 0x3d 0xe2 0xfe 0xcd 0xbb 0x31 0x4c 0x17 0xbd 0x6b 0xb9 0x20 0x3d 0xa1 0xae 0xb5 0x3b 0xc0 0x1b 0x97 0x3b 0x57 0xde 0xbb 0xbb 0x99 0x60 0xe4 0x3c 0x62 0x70 0x3e 0xbf 0xfb 0x7e 0x6 0x3e 0x2a 0x13 0xb3 0x3b 0x33 0xbf 0xd0 0x3b 0x6 0x2 0x93 0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f 0x3f 0xc9 0xfc 0xb7 0xbd 0x97 0x50 0x5a 0xbd 0x28 0x3f 0x45 0xbc 0x20 0xd5 0x71 0x3c 0xf0 0x6f 0xe1 0x3d 0xfa 0x2b 0xb3 0x3b 0x47 0x31 0x6b 0xbd 0x63 0x98 0xb7 0x3b 0xc6 0xf5 0x4f 0x3b 0xe3 0x5e 0x83 0x3b 0xc3 0x60 0x88 0xba 0x84 0x89 0x81 0xbd 0xb9 0x51 0xde 0xbd 0x24 0x2f 0x29 0x3c 0xc7 0x25 0xf7 0x3c 0x9e 0xde 0xfb 0x3d 0x9b 0xba 0x89 0xbc 0x84 0x3d 0xc5 0xbc 0x69 0x1a 0x8e 0x3b 0xed 0x3a 0xef 0xbe 0x2d 0xfa 0x16 0xbc 0xc0 0x7d 0xb5 0xbe 0xc7 0x61 0x74 0x3d 0x48 0x21 0xb7 0x39 0x3f 0x2b 0x3c 0xbc 0x56 0xb1 0x83 0xbd 0x4f 0x6e 0x68 0xbb

blob size: 2017

It indicates that the library modeltools contains bug when reading data from pack struct:

from snpe.dlc_utils import modeltools

 import libDlModelToolsPy as modeltools

As mentioned by gino0, UDLContext.hpp use std::string to represent data, mainly parsing fucntions here containes bug.

 

  • Up0
  • Down0
gino0
Join Date: 26 May 19
Posts: 12
Posted: Wed, 2019-08-07 17:03

If you use SNPE 1.24, the blob_size value reported by snpe-dlc-info will be correct, as well as the UDLContext::getSize() method  for the runner code.

It's just a bit annoying that I can't use the more recent versions (1.25 - 1.27) with UDLs.

  • Up0
  • Down0
huid.peng
Join Date: 11 Jul 19
Posts: 4
Posted: Wed, 2019-08-07 20:33

I used the version 1.24.0.256 you recommened to test, but  when i transfer the .caffemodel to .dlc, I got this error below

2019-08-08 11:18:49,732 - 38 - ERROR - File bgr: must be a text file.

Do you kown why? Thanks
  • Up0
  • Down0
huid.peng
Join Date: 11 Jul 19
Posts: 4
Posted: Wed, 2019-08-07 20:42

I used SNPE 1.27's snpe-dlc-info to test a model when i generated about 1 years ago(Used spne 1.xx), the blob_size value reported 2017.

So I think the problem occurs in model convert function of modeltool.

  • Up0
  • Down0
huid.peng
Join Date: 11 Jul 19
Posts: 4
Posted: Wed, 2019-08-07 22:49

Bug fixed, cause in version 1.24.0.256 snpe-caffe-to-dlc-udl call convert function lost copyright_file argument.

After generating dlc, snpe-dlc-info check the blob_size is 2017.

  • Up0
  • Down0
zhengxin.zhao
Join Date: 13 Mar 19
Posts: 12
Posted: Mon, 2019-08-19 19:40

What platform did you use?

I met similar runtime error when parse dlc file which include my UDL.

My test environment:

When I used snpe-1.23.1.245 on Mi 9 phone( 855 inside), offline model convert and runtime were both right.

When I used snpe-1.23.1.245 on sa8155p(yocto linux OS), offline model convert wa right. But runtime got error when executed "setUdlBundle". I think the error resulted from wrong data parse.

As you mentioned, 1.25, 1,26, 1,27 have bug of UDLs. I found that 1.23 also has UDL bug when running on sa8155p, while there is no bug when running on Snapdragon 855 Mi9 phone. So it is very werid.

Main question: which SNPE version has no bug for UDLs when running on sa8155p?

Thanks in advance ^_^

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.