Repository navigation
Conversation
|
Thanks for making this happen! I'll try to take a look sometime this upcoming week. |
3f92d19 to
2416235
Compare
inducer
left a comment
There was a problem hiding this comment.
Thanks for making this! Almost looks good, except for one compatibility oddity.
| arg_format = arg_type.char | ||
| elif isinstance(arg_type, str): | ||
| func.arg_format += arg_type | ||
| arg_format = arg_type |
There was a problem hiding this comment.
There's a bit of a compatibility issue here. Hypothetically, struct.pack formats that are more complex than a single character are supported. (Spaces are allowed, too.) This code supports that by accident, in a way, but we have to assume it's being used.
Cooperative wouldn't support this usage as-is. Here's a struct format parser I've just slopped together:
https://github.com/proxy/gist.github.com/inducer/07ac13dd1ac7827eb21dcd372986880f
That could help with this. (Needs to be extended for the complex values supported by PyCUDA.) Since this would happen during prep, I don't imagine the cost would be noticeable/prohibitive.
Summary
Add cooperative kernel launches to PyCUDA through
cooperative=True, usingcuLaunchCooperativeKernelon CUDA 9+.The option is supported by direct, prepared, timed, and asynchronous calls while preserving existing non-cooperative behavior.
Prepared functions use the same option:
A cooperative-groups kernel can be compiled normally on CUDA 11+:
On CUDA 9_10, use
DynamicSourceModulefor kernels performing grid-wide synchronization.Additional changes
device_attribute.COOPERATIVE_LAUNCH.get_max_active_blocks_per_multiprocessor()for grid sizing.LaunchError.Tested on CUDA 13. All 22 driver tests passed.
Closes #253.