eic / epic-analysis

General (SI)DIS analysis framework for the EIC
GNU Lesser General Public License v3.0
3 stars 9 forks source link

Produce ML prediction of virtual photon four momentum, implemented in ONNX #278

Open cpecar opened 1 year ago

cpecar commented 1 year ago

Briefly, what does this PR introduce?

Previously implemented ML predictions for kinematics in pybind-11. This PR changes predictions to be carried out using ONNX (https://onnxruntime.ai). Script added in epic-analysis/deps to download and unpack onnx-runtime. Building with enabled with INCLUDE_ONNX=1 make Still working to produce some example trained model to include as a part of a tutorial, but could be part of another PR.

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

Does this PR introduce breaking changes? What changes might users need to make to their code?

Should not break by default. No changes should be necessary.

Does this PR change default behavior?

No.

c-dilks commented 1 year ago

onnx v1.12.0 is included in eic-shell already, do you need v1.14?

Libraries:

ls /usr/local/lib|grep onnx -i

libonnx.a
libonnxifi_dummy.so
libonnxifi_loader.a
libonnxifi.so
libonnx_proto.a

Headers are in /usr/local/include/onnx

cpecar commented 1 year ago

Looking into if that library works but not sure, I can't find much documentation on the difference between ONNX IFI and ONNX-runtime, which is what I had been using.

c-dilks commented 1 year ago

Looking into if that library works but not sure, I can't find much documentation on the difference between ONNX IFI and ONNX-runtime, which is what I had been using.

If the ONNX version in eic-shell works for you, then let's just use that one.

If you need the newer version with runtime, we could ask @wdconinc if we can update to 1.14, unless there's a reason we're stuck at 1.12.

wdconinc commented 1 year ago

There are two separate packages here: onnx and onnxruntime. Because we build everything in spack, we use what is in spack. Onnx (py-onnx) is up to date, but onnxruntime (py-onnxruntime) isn't. That needs some more of my efforts in https://github.com/spack/spack/pull/37064. Also, onnxruntime is large and we probably don't necessarily want to include it unless someone is actively using it.

wdconinc commented 1 year ago

Or I of course welcome any help in that spack recipe :-)