-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] USM Buffer Location Properties #5634
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
d674afb
to
991fdd6
Compare
SYCL / Linux / HIP AMDGPU LLVM Test Suite fails not due to this change, because it falled for a no-functional change in https://github.com/intel/llvm/pull/5656/files# as well |
Note that this does not directly adhere to the cl_intel_mem_alloc_buffer_location proposal as this implementation uses SYCL 2020 properties instead of the properties introduced in the sycl_ext_oneapi_properties proposal (in development). @gmlueck - Should we add a variant of this for SYCL 2020 property lists to prevent it from being blocked by the development of the compile-time property lists? |
@steffenlarsen Yes this is more of a stopgap solution for passing properties into the runtime. so that memories can be allocated in the right place. Spec for full solution that uses sycl_ext_oneapi_properties is here; #5656 Once the new property is ready, this change will introduce an override malloc function that uses the new property. |
…device ----------------------------------------------------------------------------------- This serves as a temporary solution to supporting usm buffer location, and it is the easiest to implement. Align with changes in intel#5634 A more complex workaround is to define a new malloc API that accept sycl::ext::oneapi::experimental::properties as its property argument of malloc. The full solution is to define a malloc api that takes sycl::ext::oneapi::experimental::properties as property argument and returns annotated_ptr
991fdd6
to
396ad46
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
f7bdf16
to
ca8b419
Compare
612faab
to
35f7459
Compare
This serves as a temporary solution to supporting usm buffer location, and it is the easiest to implement. Align with changes in #5634 A more complex workaround is to define a new malloc API that accept sycl::ext::oneapi::experimental::properties as its property argument of malloc. The full solution is to define a malloc api that takes sycl::ext::oneapi::experimental::properties as property argument and returns annotated_ptr
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, but someone else should review.
The new properties were merged at the beginning of this week. For both spec conformance and to reduce churn, should we not use them instead? |
@cperkinsintel Having the new property list alone is not sufficient, we will also need annotated pointer to be ready. See the full solution spec for details: #5656 I don't think the full solution will be ready by Mar 27 given the bandwidth, so this is a workaround that uses existing API and only introduce a simple property in this spec: #5665 We went with this solution because it falls more closely with the expected timeline, bandwidth. |
There was no error that was caused by this change, it seems like some test need to be updated because the name space of |
As @sherry-yuan pointed out there is another extension for using the new |
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.
Some minor comments, otherwise LGTM. Failures do not seem related.
…tement check performance and cosmetic changes
e9058ee
to
2c78174
Compare
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
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! Is it possible to write a test for this?
Thanks! I am not completely sure, it will have to be an e2e test and make sure that the icd loaded runtime has the correct version that contains accept buffer location property. Currently, an e2e test is developed internally and passes (and afaik it seems like intel ocl runtime is the only one that support this property for now). I will look more into how e2e test can be developed in sycl runtime and put that up in a separate PR. I created an issue to track it here: #5750 |
@intel/llvm-gatekeepers This PR is ready to merge. The desired commit message body is the same as PR description & title. Thanks, |
@intel/llvm-gatekeepers Note on precommit test failures: some of the tests (4) does not use explicit namespace reference which caused some confusion with the new property, the test are fixed in this PR: intel/llvm-test-suite#904 |
@intel/llvm-gatekeepers the tests are fixed, but I currently don't have permissions to re-run the workflows. The tests should pass. |
Thank you all for helping to get this in 😊! |
Resolves intel/llvm#5750 The test intended to test changes in PR: intel/llvm#5634
Resolves intel/llvm#5750 The test intended to test changes in PR: intel/llvm#5634
…uite#955) Resolves intel#5750 The test intended to test changes in PR: intel#5634
Lower level runtime's usm allocation API now supports pass in of buffer location property [1] defined in OpenCL spec [2]
For this feature to be accessible to users, sycl runtime now passes in usm::buffer_location property defined in sycl spec [3] into the opencl runtime calls, the property is only passed if the extension name occurs in the platform extension string. If the lower level runtime does not support such property, then the property will yield no effect.
This is a temporary solution to allow user to specify which memory location the device usm allocation should be in. The full solution will require retuning an annotated_ptr that carries compile time properties for further optimization. The full solution spec is in [4]
[1] https://github.com/intel/fpga-runtime-for-opencl/pull/46/files
[2] https://github.com/KhronosGroup/OpenCL-Docs/blob/master/extensions/cl_intel_mem_alloc_buffer_location.asciidoc
[3] #5665
[4] #5656