René's URL Explorer Experiment


Title: cuda.core: reject stream=None — require explicit stream everywhere · Issue #2001 · NVIDIA/cuda-python · GitHub

Open Graph Title: cuda.core: reject stream=None — require explicit stream everywhere · Issue #2001 · NVIDIA/cuda-python

X Title: cuda.core: reject stream=None — require explicit stream everywhere · Issue #2001 · NVIDIA/cuda-python

Description: Summary Several cuda.core APIs accept stream=None and silently fall back to default_stream() (or NULL). This makes the stream choice implicit and environment-dependent (CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM), which is error-prone. U...

Open Graph Description: Summary Several cuda.core APIs accept stream=None and silently fall back to default_stream() (or NULL). This makes the stream choice implicit and environment-dependent (CUDA_PYTHON_CUDA_PER_THREAD_...

X Description: Summary Several cuda.core APIs accept stream=None and silently fall back to default_stream() (or NULL). This makes the stream choice implicit and environment-dependent (CUDA_PYTHON_CUDA_PER_THREAD_...

Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/2001

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cuda.core: reject stream=None — require explicit stream everywhere","articleBody":"## Summary\n\nSeveral `cuda.core` APIs accept `stream=None` and silently fall back to `default_stream()` (or NULL). This makes the stream choice implicit and environment-dependent (`CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM`), which is error-prone. Users should always pass a stream explicitly — including `device.default_stream` when they want the default.\n\n## Design rule\n\n`stream` should be a **keyword-only argument with no default value** (`*, stream: Stream`), so callers must always pass a stream explicitly.\n\nAPIs that already follow this convention:\n- `Buffer.copy_to(dst=None, *, stream: Stream | GraphBuilder)`\n- `Buffer.copy_from(src, *, stream: Stream | GraphBuilder)`\n- `Buffer.fill(value, *, stream: Stream | GraphBuilder)`\n\n## APIs that need to change\n\n### `stream=None` → `default_stream()` (implicit fallback, remove it)\n\n- `MemoryPool.allocate()` / `deallocate()`\n- `GraphMemoryResource.allocate()` / `deallocate()`\n- `GraphicsResource.map()`\n- `LegacyPinnedMemoryResource.allocate()`\n- `_SynchronousMemoryResource.allocate()`\n- `Device.allocate()` (delegates to the above)\n\n### `stream=None` → NULL / legacy default (same issue)\n\n- `Kernel.max_potential_cluster_size(config, stream=None)`\n- `Kernel.max_active_clusters(config, stream=None)`\n\n### `stream` should become keyword-only\n\n- `GraphBuilder.launch(self, stream: Stream)` — currently positional, should be `(self, *, stream: Stream)`\n\n## APIs that are fine (no change needed)\n\n- `launch(stream, config, kernel, *args)` — stream is the 1st positional arg by design\n- `Buffer.close(stream=None)` — None means \"reuse the original stream\", by design\n- `GraphicsResource.unmap(stream=None)` / `close(stream=None)` — same, reuses the mapping stream\n\n## Proposed implementation\n\n1. Have `Stream_accept()` raise `TypeError` when `stream is None`, so the check is centralized and cannot be forgotten.\n2. Remove the `= None` default from every affected API signature.\n3. Make `stream` keyword-only where it isn't already (except `launch()` where it's intentionally positional).\n\n## Prior art: CCCL's cccl-runtime\n\nCCCL's modern CUDA runtime (libcudacxx, `cuda::` namespace) follows the same explicit-stream principle:\n\n> The CUDA default (NULL) stream is not exposed as a first-class runtime object because it is tied to implicit per-device state and encourages hidden dependencies.\n>\n> — `docs/libcudacxx/runtime/cudart_interactions.rst`\n\nConcretely:\n- `cuda::launch(stream, config, kernel, args...)` requires an explicit `stream_ref` as the first parameter, with no default.\n- The `cuda::mr::resource` concept requires `allocate(cuda::stream_ref, ...)` / `deallocate(cuda::stream_ref, ...)` — no fallback to a default stream.\n- `cuda::stream_ref` deletes constructors from `int` and `nullptr`, and deprecates the parameterless (default stream) constructor.\n","author":{"url":"https://github.com/leofang","@type":"Person","name":"leofang"},"datePublished":"2026-05-01T01:11:53Z","url":"https://github.com/NVIDIA/cuda-python/issues/2001"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8fb10605-7e95-2df4-582f-e7e5afd7df83
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA20:23C977:4AE4F9:676BCD:6AF84316
html-safe-nonce3e88081ba71765aa45003cf547623a8bca3ce30f5c41de39ca6d490cea53c2d6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTIwOjIzQzk3Nzo0QUU0Rjk6Njc2QkNEOjZBRjg0MzE2IiwidmlzaXRvcl9pZCI6IjkwOTAwNzU2NjcwMzM3Njg3MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac92cdc91898f4a251495e0c556b599fe0a4ea4062b02ac393874f87f2e66d6696
hovercard-subject-tagissue:4362245429
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/cuda-python/2001/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9e7052743c84da53d9dfc38947c5650887bb5c479fe1d87c0c8a329aa1b640d8/NVIDIA/cuda-python/issues/2001
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9e7052743c84da53d9dfc38947c5650887bb5c479fe1d87c0c8a329aa1b640d8/NVIDIA/cuda-python/issues/2001
og:image:altSummary Several cuda.core APIs accept stream=None and silently fall back to default_stream() (or NULL). This makes the stream choice implicit and environment-dependent (CUDA_PYTHON_CUDA_PER_THREAD_...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameleofang
hostnamegithub.com
expected-hostnamegithub.com
None5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db
turbo-cache-controlno-preview
go-importgithub.com/NVIDIA/cuda-python git https://github.com/NVIDIA/cuda-python.git
octolytics-dimension-user_id1728152
octolytics-dimension-user_loginNVIDIA
octolytics-dimension-repository_id381173759
octolytics-dimension-repository_nwoNVIDIA/cuda-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id381173759
octolytics-dimension-repository_network_root_nwoNVIDIA/cuda-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release653be32ff5c755082a4db662491bfbbcfc9112c1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NVIDIA/cuda-python/issues/2001#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fcuda-python%2Fissues%2F2001
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fcuda-python%2Fissues%2F2001
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NVIDIA%2Fcuda-python
Reloadhttps://github.com/NVIDIA/cuda-python/issues/2001
Reloadhttps://github.com/NVIDIA/cuda-python/issues/2001
Reloadhttps://github.com/NVIDIA/cuda-python/issues/2001
NVIDIAhttps://github.com/NVIDIA
cuda-pythonhttps://github.com/NVIDIA/cuda-python
Codehttps://github.com/NVIDIA/cuda-python
Issues219 (219)https://github.com/NVIDIA/cuda-python/issues
Pull requests92 (92)https://github.com/NVIDIA/cuda-python/pulls
Discussionshttps://github.com/NVIDIA/cuda-python/discussions
Actionshttps://github.com/NVIDIA/cuda-python/actions
Projectshttps://github.com/NVIDIA/cuda-python/projects
Wikihttps://github.com/NVIDIA/cuda-python/wiki
Security and qualityhttps://github.com/NVIDIA/cuda-python/security
Insightshttps://github.com/NVIDIA/cuda-python/pulse
https://github.com/NVIDIA/cuda-python
New issuehttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/2001
New issuehttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/2001
Enhancementhttps://github.com/NVIDIA/cuda-python/issues?q=type:"Enhancement"
#2020https://github.com/NVIDIA/cuda-python/pull/2020
cuda.core: reject stream=None — require explicit stream everywherehttps://github.com/NVIDIA/cuda-python/issues/2001#top
#2020https://github.com/NVIDIA/cuda-python/pull/2020
https://github.com/Andy-Jost
P0High priority - Must do!https://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P0%22
bugSomething isn't workinghttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22bug%22
cuda.coreEverything related to the cuda.core modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.core%22
cuda.core v1.0.0https://github.com/NVIDIA/cuda-python/milestone/43
https://github.com/leofang
leofanghttps://github.com/leofang
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#issue-4362245429
leofanghttps://github.com/leofang
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058569486
github-actionshttps://github.com/apps/github-actions
triageNeeds the team's attentionhttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22triage%22
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058571385
leofanghttps://github.com/leofang
Andy-Josthttps://github.com/Andy-Jost
leofanghttps://github.com/leofang
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058577670
leofanghttps://github.com/leofang
bugSomething isn't workinghttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22bug%22
P0High priority - Must do!https://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P0%22
cuda.coreEverything related to the cuda.core modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.core%22
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058580929
leofanghttps://github.com/leofang
cuda.core v1.0.0https://github.com/NVIDIA/cuda-python/milestone/43
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058581602
leofanghttps://github.com/leofang
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058587765
Audit cuda.core API for 1.0 release #1919https://github.com/NVIDIA/cuda-python/issues/1919
leofanghttps://github.com/leofang
triageNeeds the team's attentionhttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22triage%22
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25058588780
https://github.com/leofang
leofanghttps://github.com/leofang
on May 1, 2026https://github.com/NVIDIA/cuda-python/issues/2001#issuecomment-4357237699
@Andy-Josthttps://github.com/Andy-Jost
Andy-Josthttps://github.com/Andy-Jost
on May 4, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25153884548
cuda.core: also require explicit stream for Buffer.from_ipc_descriptor (https://github.com/Andy-Jost/cuda-python/commit/23d8d8b6e28f2a6e557a2f0348a2feeebdbe58b1
23d8d8bhttps://github.com/Andy-Jost/cuda-python/commit/23d8d8b6e28f2a6e557a2f0348a2feeebdbe58b1
cuda.core: align deallocate signatures and revert Graph.launch (NVIDI…https://github.com/Andy-Jost/cuda-python/commit/7c4debe55d497f7a5e7e3b0006fd629d647f6c3b
NVIDI…https://github.com/NVIDIA/cuda-python/issues/2001
7c4debehttps://github.com/Andy-Jost/cuda-python/commit/7c4debe55d497f7a5e7e3b0006fd629d647f6c3b
https://github.com/Andy-Jost
Andy-Josthttps://github.com/Andy-Jost
on May 4, 2026https://github.com/NVIDIA/cuda-python/issues/2001#issuecomment-4375385209
Andy-Josthttps://github.com/Andy-Jost
on May 4, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25155366490
cuda.core: tighten test mocks and add Stream_accept(None) test (NVIDI…https://github.com/Andy-Jost/cuda-python/commit/c2d4dfebc61c650d95771dcc806674c303874e12
NVIDI…https://github.com/NVIDIA/cuda-python/issues/2001
c2d4dfehttps://github.com/Andy-Jost/cuda-python/commit/c2d4dfebc61c650d95771dcc806674c303874e12
cuda.core: fix Buffer pickle path broken by kw-only stream (NVIDIA#2001)https://github.com/Andy-Jost/cuda-python/commit/5fd09583dcc6109888291da3f6fa1ec815a62e50
NVIDIA#2001https://github.com/NVIDIA/cuda-python/issues/2001
5fd0958https://github.com/Andy-Jost/cuda-python/commit/5fd09583dcc6109888291da3f6fa1ec815a62e50
cuda.core: relax kw-only TypeError regex for Cython funcs (NVIDIA#2001)https://github.com/Andy-Jost/cuda-python/commit/91a3211df852c0a315a3567c8edb49f8161b334e
NVIDIA#2001https://github.com/NVIDIA/cuda-python/issues/2001
91a3211https://github.com/Andy-Jost/cuda-python/commit/91a3211df852c0a315a3567c8edb49f8161b334e
cuda.core: review fixes for NVIDIA#2001 (graph_update.py + _legacy.py)https://github.com/Andy-Jost/cuda-python/commit/ca2f5f70eaf184770b1346bf964995b6eec35c70
NVIDIA#2001https://github.com/NVIDIA/cuda-python/issues/2001
ca2f5f7https://github.com/Andy-Jost/cuda-python/commit/ca2f5f70eaf184770b1346bf964995b6eec35c70
cuda.core: drop unused stream= kwargs from sync MR call sites (NVIDIA…https://github.com/Andy-Jost/cuda-python/commit/91807eeada6962c5b274d47ba761449cdbf141cf
NVIDIA…https://github.com/NVIDIA/cuda-python/issues/2001
91807eehttps://github.com/Andy-Jost/cuda-python/commit/91807eeada6962c5b274d47ba761449cdbf141cf
cuda.core: fix C++ teardown leak when buffer has no attached stream (N…https://github.com/Andy-Jost/cuda-python/commit/5e9a5ea2df53fd3e74fefe37d5c97d748bb277f1
N…https://github.com/NVIDIA/cuda-python/issues/2001
5e9a5eahttps://github.com/Andy-Jost/cuda-python/commit/5e9a5ea2df53fd3e74fefe37d5c97d748bb277f1
Andy-Josthttps://github.com/Andy-Jost
Enhancementhttps://github.com/NVIDIA/cuda-python/issues?q=type:"Enhancement"
on May 6, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25232390281
leofanghttps://github.com/leofang
completedhttps://github.com/NVIDIA/cuda-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2020https://github.com/NVIDIA/cuda-python/pull/2020
on May 6, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25233257297
leofanghttps://github.com/leofang
on May 6, 2026https://github.com/NVIDIA/cuda-python/issues/2001#event-25233257344
cuda.core: require explicit stream for stream-scheduling APIs (#2020)https://github.com/NVIDIA/cuda-python/commit/50c19d02389219719937ac555a020959afb82f0e
#2020https://github.com/NVIDIA/cuda-python/pull/2020
50c19d0https://github.com/NVIDIA/cuda-python/commit/50c19d02389219719937ac555a020959afb82f0e
Sign up for freehttps://github.com/signup?return_to=https://github.com/NVIDIA/cuda-python/issues/2001
Sign in to commenthttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/2001
Andy-Josthttps://github.com/Andy-Jost
P0High priority - Must do!https://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P0%22
bugSomething isn't workinghttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22bug%22
cuda.coreEverything related to the cuda.core modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.core%22
Enhancementhttps://github.com/NVIDIA/cuda-python/issues?q=type:"Enhancement"
cuda.core v1.0.0https://github.com/NVIDIA/cuda-python/milestone/43
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.