-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Persistent program cache #3391
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
After 86b0e8d patch extra operations with device images happen before check if it is present in in-memory cache. For applications with small kernels which are executed multiple times noticeable performance degradation is seen for host code. That was done to get build options stored in the kernel image and use them as in-memory cache key. At the same time kernel image (where these options are taken from) is used in cache key so it is reasonable to use only build options which are specified in SYCL API and/or environment variables as separate cache key. Getting build options from kernel image is moved back to build operation which happens only if built program is missed in in-memory cache.
/summary:run |
8125561
to
3f1ab43
Compare
/summary:run |
/summary:run |
/summary:run |
/summary:run |
sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp
Outdated
Show resolved
Hide resolved
/summary:run |
sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: sergei <[email protected]>
/summary:run |
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.
LGTM
@kbobrovs to approve |
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.
Thanks Vladimir, LGTM.
std::vector<std::vector<char>> PersistentDeviceCodeCache::getItemFromDisc( | ||
const device &Device, const RTDeviceBinaryImage &Img, | ||
const SerializedObj &SpecConsts, const std::string &BuildOptionsString, | ||
RT::PiProgram &NativePrg) { |
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.
@vladimirlaz, post-commit build fails with
/home/runner/work/llvm/llvm/src/sycl/source/detail/persistent_device_code_cache.cpp:130:20: error: unused parameter 'NativePrg' [-Werror,-Wunused-parameter]
RT::PiProgram &NativePrg) {
Please, fix ASAP.
First part of implementation for persistent cache of device programs following sycl/doc/KernelProgramCache.md:
Programs built for target device are stored in on-disk cache and used next time when the same application is executed.
What is done:
SYCL_CACHE_DIR
SYCL_CACHE_TRACE
SYCL_CACHE_DISABLE_PERSISTENT
SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE
SYCL_CACHE_MAX_DEVICE_IMAGE_SIZE
SYCL_CACHE_MIN_DEVICE_IMAGE_SIZE
To be done in next patches: