bonito icon indicating copy to clipboard operation
bonito copied to clipboard

Openvino

Open iiSeymour opened this issue 2 years ago • 6 comments

iiSeymour avatar Jan 19 '22 15:01 iiSeymour

@dkurt first hurdle - have you seen this?

/tmp/test$ python3.8 -m venv venv3.8
/tmp/test$ source venv3.8/bin/activate
(venv3.8) /tmp/test$ pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
     |████████████████████████████████| 1.7MB 12.6MB/s 
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-21.3.1    
(venv3.8) /tmp/test$ pip install openvino==2021.4.2
Collecting openvino==2021.4.2
  Downloading openvino-2021.4.2-3976-cp38-cp38-manylinux2014_x86_64.whl (28.9 MB)
     |████████████████████████████████| 28.9 MB 15.8 MB/s            
Collecting numpy<1.20,>=1.16.6
  Downloading numpy-1.19.5-cp38-cp38-manylinux2010_x86_64.whl (14.9 MB)
     |████████████████████████████████| 14.9 MB 47.4 MB/s            
Installing collected packages: numpy, openvino
Successfully installed numpy-1.19.5 openvino-2021.4.2
(venv3.8) /tmp/test$ python3.8 -c "from openvino.inference_engine import IECore, StatusCode"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/__init__.py", line 30, in <module>
    from .ie_api import *
ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
(venv3.8) /tmp/test$  ldd .../ie_api.cpython-38-x86_64-linux-gnu.so 
        linux-vdso.so.1 =>  (0x00007ffce0dd8000)
        libpython3.8.so.1.0 => not found
        libinference_engine.so => /tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/./../../openvino/libs/libinference_engine.so (0x00007fd035826000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd0354a4000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd03519b000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd034f85000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd034bbb000)
        libtbb.so.2 => /tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/./../../openvino/libs/libtbb.so.2 (0x00007fd03494d000)
        libtbbmalloc.so.2 => /tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/./../../openvino/libs/libtbbmalloc.so.2 (0x00007fd0346f1000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd0344ed000)
        libinference_engine_transformations.so => /tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/./../../openvino/libs/libinference_engine_transformations.so (0x00007fd033f20000)
        libngraph.so => /tmp/test/venv3.8/lib/python3.8/site-packages/openvino/inference_engine/./../../openvino/libs/libngraph.so (0x00007fd033562000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd033345000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd035f3c000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd03313d000)

iiSeymour avatar Jan 19 '22 16:01 iiSeymour

@iiSeymour, do you use default Python or Anaconda env? For default, sudo apt-get install libpython3.8-dev should resolve it. May I ask to try?

dkurt avatar Jan 19 '22 16:01 dkurt

Yes, that has resolved it @dkurt. Basecalling results are now correct for the CRF models but I'm finding the performance much slower than expected even with the smaller models (note: I haven't done any profiling yet).

bonito basecaller [email protected] --device=cpu --use_openvino reads > calls.sam

iiSeymour avatar Jan 31 '22 18:01 iiSeymour

Yes, that has resolved it @dkurt. Basecalling results are now correct for the CRF models but I'm finding the performance much slower than expected even with the smaller models (note: I haven't done any profiling yet).

bonito basecaller [email protected] --device=cpu --use_openvino reads > calls.sam

Most of execution time (up to 95%) take LSTM layers. I know that OpenVINO team works on improvements. I've tried to think up some workaround but no progress.

dkurt avatar Feb 01 '22 12:02 dkurt

Thanks @dkurt let me know if there is any progress w.r.t LSTM performance.

iiSeymour avatar Feb 09 '22 18:02 iiSeymour

@iiSeymour, can you please add an empty file bonito/openvino/__init__.py? (see https://github.com/nanoporetech/bonito/issues/229#issuecomment-1028648476).

BTW, is that possible to merge this PR? So users of pip package could use OpenVINO as well.

dkurt avatar Mar 24 '22 14:03 dkurt