Skip to content

OpenCL: Skip SVM pointer annotation if possible#785

Merged
pvelesko merged 8 commits intomainfrom
skip-svm-annotation
Mar 21, 2024
Merged

OpenCL: Skip SVM pointer annotation if possible#785
pvelesko merged 8 commits intomainfrom
skip-svm-annotation

Conversation

@linehill
Copy link
Collaborator

Calling clSetKernelExecInfo() for passing CL_KERNEL_EXEC_INFO_SVM_PTRS demonstrates notable overhead on PVC. For example, HeCBench/hybridsort-hip sees 4-16% slowdown.

This patch adds a rudimentary analysis for detecting whether device modules might have indirect buffer accesses. The OpenCL backend skips clSetKernelExecInfo() calls when it knows the module, the kernel belongs to, does not have any indirect accesses.

Copy link
Collaborator

@pjaaskel pjaaskel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite. Small things.

@@ -0,0 +1,14 @@
// Check we detect that the device code does not have indirect global
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls add the copyright/license texts to new files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Is it fine to use "short-form" copyright text? And was it the MIT license the chipStar is using?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is the consensus. I've seen Apache 2 in the LLVM files at least.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing LICENSE file in project root seems to match to the MIT license.

@pvelesko
Copy link
Collaborator

I see some failures that seem unrelated to this PR, let me investigate.

@@ -0,0 +1,14 @@
// Check we detect that the device code does not have indirect global
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is the consensus. I've seen Apache 2 in the LLVM files at least.

@pvelesko pvelesko force-pushed the skip-svm-annotation branch from 073b933 to 6fddd63 Compare February 28, 2024 13:06
Copy link
Collaborator

@pvelesko pvelesko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge conflicts

@linehill linehill force-pushed the skip-svm-annotation branch 2 times, most recently from 2edc2d8 to bb22981 Compare March 8, 2024 09:41
@linehill
Copy link
Collaborator Author

linehill commented Mar 8, 2024

Rebased now.

@pvelesko
Copy link
Collaborator

pvelesko commented Mar 9, 2024

Only this is failing now

dgpu_opencl_make_check_result.txt: FAIL
	358 - Unit_hipClassKernel_Friend (SEGFAULT)

This is fixed in #791 so let's merge that first

@pvelesko
Copy link
Collaborator

conflits

@linehill linehill force-pushed the skip-svm-annotation branch from bb22981 to 82c4b08 Compare March 18, 2024 07:51
Henry Linjamäki and others added 8 commits March 19, 2024 14:56
... for hosting module level information.
Skip calling clSetKernelExecInfo() for kernels from modules for which
we know they have no indirect accesses to SVM allocations.
Co-authored-by: Pekka Jääskeläinen <pekka.jaaskelainen@intel.com>
@linehill linehill force-pushed the skip-svm-annotation branch from 1540b45 to e2c57cd Compare March 19, 2024 13:20
@linehill
Copy link
Collaborator Author

Rebased. Should have compiler error resolved seen in the CI in the merge prior this rebase.

@pvelesko pvelesko merged commit f6ab180 into main Mar 21, 2024
@pvelesko pvelesko deleted the skip-svm-annotation branch March 21, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants