added cache version for nuphar JIT binaries - #2646
Conversation
Previously, when the user wrongfully loaded a JIT binary generated from a Nuphar version different from the current used one, she would get mysterious runtime failures, because we didn't perform any version check on JIT binaries. This change added cache versions to the Nuphar runtime and JIT binaries. The Nuphar runtime will issue verbose message that informs the user version-mismatch errors.
| } | ||
| __EOF__ | ||
| g++ -std=c++14 -fPIC -o cache_version.o -c cache_version.cc | ||
| rm cache_version.cc |
There was a problem hiding this comment.
can you have a single loop to compile all cc files, so it would be easier to add cc files in future? #Resolved
| } | ||
|
|
||
| path.append(version); | ||
| path.append(kNupharCacheVersion); |
There was a problem hiding this comment.
path.append(kNupharCacheVersion); [](start = 2, length = 33)
Could the version in path be removed? #Resolved
There was a problem hiding this comment.
Removing version from the path would be a breaking change to users. I think keeping different versions of .dll/.so in separate folders makes the user's life easier. It won't hurt at least.
#Resolved
| if (onnxruntime_USE_NUPHAR) | ||
| file(GLOB onnxruntime_python_nuphar_python_srcs CONFIGURE_DEPENDS | ||
| "${ONNXRUNTIME_ROOT}/core/providers/nuphar/scripts/*.*" | ||
| "${ONNXRUNTIME_ROOT}/core/providers/nuphar/scripts/*" |
There was a problem hiding this comment.
${ONNXRUNTIME_ROOT}/core/providers/nuphar/scripts/* [](start = 5, length = 51)
Please note that python wheel only takes .py files, and NUPHAR_CACHE_VERSION may not be packed in wheel.
There was a problem hiding this comment.
Hmm, what about create_shared.sh and created_shared.cmd?
There was a problem hiding this comment.
There was a problem hiding this comment.
Seems we don't need to include create_shared.py (and hence NUPHAR_CACHE_VERSION) either?
There was a problem hiding this comment.
Let me build a python wheel. Just by reading the code, seems to me that all the files under nuphar/scripts are copied into the wheel package.
There was a problem hiding this comment.
Added a minor fix to include NUPHAR_CACHE_VERSION into the python wheel
|
/azp run |
|
Azure Pipelines successfully started running 12 pipeline(s). |
Previously, when the user wrongfully loaded a JIT binary generated
from a Nuphar version different from the current used one, she
would get mysterious runtime failures, because we didn't perform
any version check on JIT binaries.
This change added cache versions to the Nuphar runtime and
JIT binaries. The Nuphar runtime will issue verbose message that
informs the user version-mismatch errors.