Skip to content

Draft: add Service for ONNXRuntime

Maarten Van Veghel requested to merge mveghel-onnxtester into master

Adds service that manages sessions of ONNXRuntime. In addition, a light wrapper around these Ort::Sessions is added, StandardSessions, that manages it for the most standard use cases in LHCb.

To do list

  • add setting of max threads (done using config in ApplicationOptions)
  • add wrapper around standard option of vector of float (in one tensor) to vector of floats output

Accompanies (also more details in) Rec!3380 (closed). Related to Rec#460.

Possible future improvements if needed

  • use AddInitializer to make session per thread making more efficient if needed to reduce memory consumption (see here)

ONNXRuntime package (install)

For cmake part to work still need to do locally:

export LD_LIBRARY_PATH=/cvmfs/sft.cern.ch/lcg/releases/onnxruntime/1.13.1-9722b/x86_64-centos7-gcc11-opt/lib:$LD_LIBRARY_PATH

Or add the following line to Findonnxruntime.cmake file somewhere before the add_library command:

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

To fix that onnxruntime needs to be added to (@clemenci):

Edited by Maarten Van Veghel

Merge request reports

Loading