Skip to content
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

only warn about argument sizes on Nvidia GPUs #713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyopencl/invoker.py
Copy link
Owner

Choose a reason for hiding this comment

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

Could you explain the context a bit more? Were there spurious warnings that were bothersome?

Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _get_max_parameter_size(dev):
dev_limit = dev.max_parameter_size
pocl_version = get_pocl_version(dev.platform, fallback_value=(1, 8))
if pocl_version is not None and pocl_version < (3, 0):
# Current PoCL versions (as of 04/2022) have an incorrect parameter
# Older PoCL versions (<3.0) have an incorrect parameter
# size limit of 1024; see e.g. https://github.com/pocl/pocl/pull/1046
if dev_limit == 1024:
if dev.type & cl.device_type.CPU:
Expand All @@ -332,8 +332,14 @@ def _check_arg_size(function_name, num_cl_args, arg_types, devs):
"""Check whether argument sizes exceed the OpenCL device limit."""

for dev in devs:
dev_ptr_size = int(dev.address_bits / 8)
dev_limit = _get_max_parameter_size(dev)
if dev_limit != 4352:
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure I like this check, it seems too broad. I expect that AMD and Intel GPUs would have some limit as well, but these changes would avoid warnings in those cases, even if they're applicable. I would be more willing to limit this to GPU devices, which is testable via flags in the device info.

# Only warn if the limit is the default value for Nvidia GPUs
# (4352 bytes), because failures have been observed only on such
# devices.
continue

dev_ptr_size = int(dev.address_bits / 8)

total_arg_size = 0

Expand Down