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

about nvdla sw v1.2-OC compiler build error #154

Open
akioolin opened this issue Aug 29, 2019 · 10 comments
Open

about nvdla sw v1.2-OC compiler build error #154

akioolin opened this issue Aug 29, 2019 · 10 comments

Comments

@akioolin
Copy link

Hi, All:

in the umd part, there are two version of protobuf lib. one is 2.6.1, the other is 3.0.0. th lite version of protobuf also has the same combination. there two question about the protobuf's version.

  1. the protobuf which come from umd/external is 2.6. which version is the right one ?
  2. for the host side, there is a protobuf , v3.0.0 had been installed. during compiling phase, the compiler building procedure seems use the system's protobuf not the one which come with umd.
    it seems had to modify the include path to use protobuf which come with umd. or the other way is installing protobuf which come with umd. which approach is a good choice.

BR,
Akio

@prasshantg
Copy link
Collaborator

@akioolin v2.6.1 is preferred which comes with umd, report back if you face any issue

@akioolin
Copy link
Author

@prasshantg Thank you very much. You are right. using V3.0.0 will cause interface miss-match. the current solution is the followings:

  1. in external/protobuf-2.6, build and install into a custom place.
  2. modify the related makefile and *.mk file to the directory which protobuf-2.6 installed.
  3. modified the "#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION" to
    "#if GOOGLE_PROTOBUF_MIN_PROTOC_VERSION < 2006000"
  4. make and happy hacking XD

right now, finding the suitable caffe model to test the builded nvdla compiler is the next step.

@prasshantg
Copy link
Collaborator

@akioolin thanks for trying it!! You can details for the model to try at https://github.com/nvdla/sw/blob/master/LowPrecision.md

@akioolin
Copy link
Author

@prasshantg following the steps which described in "Low precision support in NVDLA", for int8 nvdla loadable generation flow is the following:

  1. using TensorRT load model to generate per layer's scaling factor.
  2. using calib_txt_to_json.py to convert calibration txt file into nvdla calibration json format.
  3. using nvvdla compiler with calibration json file to generate nvdla loadable.

the above step is right or not? do I miss any thing?

the following problem is more detail about nvdla compile could do.

  1. for the nvdla MACs and Configuration type, the current open source nvdla compiler support int8/fp16, which means support NVDLA Small (int8 only), NVDLA Large(int8, fp16), am I right?
  2. how about the MACs support in current nvdla open source compiler?

Thanks.

BR,
Akio

@akioolin
Copy link
Author

@prasshantg the following is the error log which using nvdla compiler with different approach.

the model and protxt is come from https://onedrive.live.com/?authkey=%21AAFW2-FVoxeVRck&id=4006CBB8476FF777%2117887&cid=4006CBB8476FF777

  1. using prebuilt nvdla compiler.
    ./nvdla_compiler -o resnet50 --cprecision fp16 --configtarget nv_full --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
    (DLA) Error 0x00030003: (propagating from main.cpp, function testSetup(), line 77)
    (DLA) Error 0x00030003: (propagating from main.cpp, function launchTest(), line 94)

./nvdla_compiler -o resnet50 --cprecision int8 --configtarget nv_small --calibtable ./resnet50.json --quantizationMode per-kernel --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
(DLA) Error 0x00030003: (propagating from main.cpp, function testSetup(), line 77)
(DLA) Error 0x00030003: (propagating from main.cpp, function launchTest(), line 94)

  1. using prebuilt libprotobuf.a to build nvdla compiler. at the linking stage, the error message is the following lists.

/usr/bin/ld: /home/akio/work/nvdla_sw_1.2/umd/external/lib/libprotobuf.a(common.o): relocation R_X86_64_32S against symbol `_ZTVN6google8protobuf7ClosureE' can not be used when making a PIE object; recompile with -fPIC

  1. using libprotobuf.a which build by myself. the outcome message is the following
    ./nvdla_compiler -o resnet50 --cprecision fp16 --configtarget nv_full --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
    creating new wisdom context...
    opening wisdom context...
    parsing caffe network...
    libnvdla<3> mark prob
    Marking total 1 outputs
    attaching parsed network to the wisdom...
    compiling profile "fast-math"... config "nv_large"...
    libnvdla<2> Prototxt #chnls (C = 3) != Profile #chnls for input (NVDLA_IMG_A16B16G16R16_F: C = 4). Preferring #chnls from Profile for compiling.
    closing wisdom context...

./nvdla_compiler -o resnet50 --cprecision fp16 --configtarget nv_large --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
creating new wisdom context...
opening wisdom context...
parsing caffe network...
libnvdla<3> mark prob
Marking total 1 outputs
attaching parsed network to the wisdom...
compiling profile "fast-math"... config "nv_large"...
libnvdla<2> Prototxt #chnls (C = 3) != Profile #chnls for input (NVDLA_IMG_A16B16G16R16_F: C = 4). Preferring #chnls from Profile for compiling.
closing wisdom context...

./nvdla_compiler -o resnet50 --cprecision fp16 --configtarget nv_small --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
creating new wisdom context...
opening wisdom context...
parsing caffe network...
libnvdla<3> mark prob
Marking total 1 outputs
attaching parsed network to the wisdom...
compiling profile "fast-math"... config "nv_large"...
libnvdla<2> Prototxt #chnls (C = 3) != Profile #chnls for input (NVDLA_IMG_A16B16G16R16_F: C = 4). Preferring #chnls from Profile for compiling.
closing wisdom context...

./nvdla_compiler -o resnet50 --cprecision int8 --configtarget nv_small --calibtable ./resnet50.json --quantizationMode per-kernel --prototxt ResNet-50-deploy.prototxt --caffemodel ResNet-50-model.caffemodel
creating new wisdom context...
opening wisdom context...
parsing caffe network...
libnvdla<3> mark prob
Marking total 1 outputs
parsing calibration table...
nvdla_compiler: /home/akio/work/nvdla_sw_1.2/umd/external/include/rapidjson/document.h:1105: rapidjson::GenericValue<Encoding, Allocator>& rapidjson::GenericValue<Encoding, Allocator>::operator[](const rapidjson::GenericValue<Encoding, SourceAllocator>&) [with SourceAllocator = rapidjson::MemoryPoolAllocator<>; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]: Assertion `false' failed.
Aborted (core dumped)

for int8 compiling, compiler report fail. the calibration is come from umd/utils/calibdata/resnet50.json

what is the missing point.

@cnjsdfcy
Copy link
Contributor

cnjsdfcy commented Sep 5, 2019

hi @akioolin @prasshantg , I created a pull request regarding fixing the compiler compiling error about “google/protobuf/stubs/common.h” not found issue, please git it a try.
Thanks~

@shazib-summar
Copy link

shazib-summar commented Sep 10, 2019

@akioolin did you find a solution? I am also facing the same problem; "closing wisdom context". Also the wisdom.dir folder is empty.

@akioolin
Copy link
Author

@killerzula
for fp16, the compiler works very fine. for int8, i don't know why. right now I'm deep dive into UMD interface integration task. After this integration task finished. I'll back into this issue.

@shazib-summar
Copy link

@akioolin the compiler isn't working, even for fp16, in my case. Like I said, it says "closing wisdom context" and then the command finishes execution. Furthermore if I check the wisdom.dir folder; it's empty.

@gitosu67
Copy link

gitosu67 commented Nov 5, 2019

@killerzula looking at the code I believe there should be a file called 'fast-math.nvdla'. This is the loadable file. I am not 100% sure about this. The wisdom.dir is empty in my case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants