LiangHao151941 commented on issue #4828: [QNN][TFLite] TFLite rounding mode 
support
URL: https://github.com/apache/incubator-tvm/pull/4828#issuecomment-596585687
 
 
   > > > CI's LLVM is LLVM 4.0. I think we should supply `quantized add` so 
that we avoid it is just a lucky.
   > > 
   > > 
   > > Just tested, it's a lucky case indeed.
   > > BTW, is it possible to follow tensorflow to have a specific llvm version 
for each tvm release to avoid
   > > certain problems like this?
   > 
   > To avoid lucky case, when we support TFLite rounding, we could change the 
`data = get_real_image(224, 224)` to
   > 
   > ```python
   > np.random.seed(0) 
   > data = np.random.random_integers(low=0, high=128, size=(1, 224, 224, 
3)).astype('uint8')
   > ```
   > 
   > back.
   > 
   
   Update:I made a mistake for the unit test that I still compare the labels 
instead of numerical predictions, so rtol and atol set to zero does not make 
any sense. Now that I changed to compare numerical prediction vector, the 
results begin to differ for mobilenetV2. And further, changing qnn.add rounding 
mode to TFLITE does not lead to bit exact execution. I have to reimplement the 
whole algorithm again in TFLITE add op to see it works. But I'm bothered by the 
segfault problem to get any reasonable test results.
   
   
   > For LLVM version, I think we can not at least currently. We support 
different LLVM versions on TVM. We have the check in `FindLLVM.cmake` to make 
sure the minimal requirement is 4.0.
   > 
   > Could you dig it more? If we can make sure it is the bug of LLVM, we then 
can discuss how to deal with this case.
   
   I digged a little bit on this, but it seems to be not related with llvm but 
rather with tflite conversion from tensorflow graph to tflite (not even related 
to tvm). I'm using tf 1.15 for my test. And I find it's related to this test 
`_test_forward_elemwise(partial(_test_add, 
fused_activation_function="RELU6"))`, specifically `RELU6` will cause the 
error, if I change it to `RELU`, no segfault will be triggered. @FrozenGene 
Please help , or maybe I should just for now switch back to an older version of 
tensorflow.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to