-
Notifications
You must be signed in to change notification settings - Fork 3.3k
added cache version for nuphar JIT binaries #2646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you have a single loop to compile all cc files, so it would be easier to add cc files in future? #Resolved
@@ -43,7 +37,7 @@ static bool GetOrCreateTVMModuleCacheDirectory(fs::path& path, bool create) { | |||
throw std::runtime_error("Failed to create directory " + path.string()); | |||
} | |||
|
|||
path.append(version); | |||
path.append(kNupharCacheVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path.append(kNupharCacheVersion); [](start = 2, length = 33)
Could the version in path be removed? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -251,7 +251,7 @@ endif() | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what about create_shared.sh and created_shared.cmd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we don't need to include create_shared.py (and hence NUPHAR_CACHE_VERSION) either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.