feat(cuda.core): add synchronization_policy to LaunchConfig - #2637
Open
atiaomar1978-hub wants to merge 5 commits into
Open
feat(cuda.core): add synchronization_policy to LaunchConfig#2637atiaomar1978-hub wants to merge 5 commits into
atiaomar1978-hub wants to merge 5 commits into
Conversation
Contributor
Contributor
Author
GPU validation report (RunPod, contributor-run)Validated this change on real NVIDIA hardware outside upstream CI. Environment
Command pytest cuda_core/tests/test_launcher.py -k "synchronization_policy" -vResults: 10 passed, 4 skipped, 0 failed
The four launch smoke tests were skipped because this host exposes a CUDA 12 driver while the build used CUDA 13 bindings ( Cost: ~ |
3 tasks
atiaomar1978-hub
pushed a commit
to atiaomar1978-hub/cuda-python
that referenced
this pull request
Aug 14, 2026
Sort imports in test_launcher.py (ruff I001) and regenerate _launch_config.pyi via stubgen-pyx after LaunchConfig changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Expose CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY through LaunchConfig so cuda.core users can set per-launch CPU wait policies without dropping to cuda.bindings.driver. Adds SynchronizationPolicyType and tests for native attribute mapping and real kernel launches. Closes NVIDIA#2628. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Omar Atie <atiaomar1978@gmail.com>
Declare sync_policy_value at function scope so Cython can cast to CUsynchronizationPolicy when building the launch attribute. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Omar Atie <atiaomar1978@gmail.com>
Use cuda.bindings.driver.CUsynchronizationPolicy constants for the public IntEnum and skip GPU launch smoke tests when CUDA 13 bindings run against a CUDA 12 driver. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Omar Atie <atiaomar1978@gmail.com>
Sort imports in test_launcher.py (ruff I001) and regenerate _launch_config.pyi via stubgen-pyx after LaunchConfig changes. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Omar Atie <atiaomar1978@gmail.com>
atiaomar1978-hub
force-pushed
the
feat/launch-config-sync-policy-2628
branch
from
August 14, 2026 23:35
9f4bb0a to
0008aca
Compare
Fix ruff I001 unsorted-imports for pre-commit.ci on PR NVIDIA#2637. Signed-off-by: Omar Atie <atiaomar1978@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LaunchConfig.synchronization_policyto exposeCU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICYfromcuda.core, closing [FEA]: Add support for CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY in LaunchConfig #2628.SynchronizationPolicyTypeincuda.core.typing(AUTO,SPIN,YIELD,BLOCKING_SYNC) aligned withcuda.bindings.driver.CUsynchronizationPolicy.LaunchConfig._to_native_launch_config()and the standalone_to_native_launch_config()helper used in tests.tests/test_launcher.py, plus a GPU launch smoke test (skipped when CUDA 13 bindings run against a CUDA 12 driver).Motivation
Pool-backed and other
LaunchConfiglaunch attributes already route throughcuLaunchKernelEx. Users should be able to set per-launch CPU wait policy without dropping to rawcuda.bindings.driverAPIs. This follows the incrementalLaunchConfigattribute coverage tracked under #496 (same approach asprogrammatic_stream_serialization).Example
Test plan
pytest cuda_core/tests/test_launcher.py -k synchronization_policy -v$0.16/hr)RunPod GPU report (contributor-run)
feat/launch-config-sync-policy-2628cuda_core, CUDA 13 headers/bindingspytest tests/test_launcher.py -k synchronization_policy -vMapping tests verify
CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICYfor all four policies, invalid-input rejection, defaultNone, and combination withis_cooperative. The four GPU launch smoke tests were skipped on this host because the RunPod image exposes a CUDA 12 driver while the build used CUDA 13 bindings (cubin load is incompatible); upstream CI with matched driver/toolkit should cover the launch path.Closes #2628.
Made with Cursor