René's URL Explorer Experiment


Title: Querying current device is slow compared to CuPy · Issue #439 · NVIDIA/cuda-python · GitHub

Open Graph Title: Querying current device is slow compared to CuPy · Issue #439 · NVIDIA/cuda-python

X Title: Querying current device is slow compared to CuPy · Issue #439 · NVIDIA/cuda-python

Description: Getting the current device using cuda.core is quite a bit slower than CuPy: In [1]: import cupy as cp In [2]: %timeit cp.cuda.Device() 69 ns ± 0.496 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each) In [3]: from cuda.core.e...

Open Graph Description: Getting the current device using cuda.core is quite a bit slower than CuPy: In [1]: import cupy as cp In [2]: %timeit cp.cuda.Device() 69 ns ± 0.496 ns per loop (mean ± std. dev. of 7 runs, 10,000,...

X Description: Getting the current device using cuda.core is quite a bit slower than CuPy: In [1]: import cupy as cp In [2]: %timeit cp.cuda.Device() 69 ns ± 0.496 ns per loop (mean ± std. dev. of 7 runs, 10,000,...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Querying current device is slow compared to CuPy","articleBody":"Getting the current device using `cuda.core` is quite a bit slower than CuPy:\n\n```python\nIn [1]: import cupy as cp\n\nIn [2]: %timeit cp.cuda.Device()\n69 ns ± 0.496 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)\n\nIn [3]: from cuda.core.experimental import Device\n\nIn [4]: %timeit Device()\n795 ns ± 0.273 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n```\n\nUltimately, my goal is to get the compute capability of the current device, and this is even slower:\n\n```python\nIn [5]: %timeit cp.cuda.Device().compute_capability\n89.1 ns ± 0.413 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)\n\nIn [6]: %timeit Device().compute_capability\n2.64 μs ± 122 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n```\n\nAre there tricks (e.g., caching) CuPy is employing here that `cuda.core` can use as well? Alternately, is there another way for me to use `cuda.core` or `cuda.bindings` to get this information quickly? Note that for my use case, I'm not super concerned about the _first_ call to `Device()`, but I do want _subsequent_ calls to be trivially inexpensive if the current device hasn't changed.\n\n---\n\nUsing the low-level cuda.bindings is also not quite as fast:\n\n```python\nIn [11]: def get_cc():\n    ...:     dev = runtime.cudaGetDevice()[1]\n    ...:     return driver.cuDeviceComputeCapability(dev)\n    ...:\n\nIn [12]: get_cc()\nOut[12]: (\u003cCUresult.CUDA_SUCCESS: 0>, 7, 5)\n\nIn [13]: %timeit get_cc()\n597 ns ± 0.494 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n```\n","author":{"url":"https://github.com/shwina","@type":"Person","name":"shwina"},"datePublished":"2025-02-07T16:17:52Z","url":"https://github.com/NVIDIA/cuda-python/issues/439"}

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:8a389d93-8d58-367f-3182-259f770f3bfc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE70:2068A3:525DEA:715D2B:6AF84557
html-safe-noncef7f3c5787cfc48ef2ba5db8f9aeaab9b4b5df1851b4d2a426d3ff45f24c9aba8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTcwOjIwNjhBMzo1MjVERUE6NzE1RDJCOjZBRjg0NTU3IiwidmlzaXRvcl9pZCI6IjU2MzQ3NDIwODQ3NTg0MjI4NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacef9768c39ebc4e9733946302d9cf86b52074b8a618642d173f07e4f871daff40
hovercard-subject-tagissue:2838552686
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/439/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2418554c6ef6e1a5d7c0426b04284a4d1fa6fa8aa5a9127893fa77d10e15f25d/NVIDIA/cuda-python/issues/439
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2418554c6ef6e1a5d7c0426b04284a4d1fa6fa8aa5a9127893fa77d10e15f25d/NVIDIA/cuda-python/issues/439
og:image:altGetting the current device using cuda.core is quite a bit slower than CuPy: In [1]: import cupy as cp In [2]: %timeit cp.cuda.Device() 69 ns ± 0.496 ns per loop (mean ± std. dev. of 7 runs, 10,000,...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshwina
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/439#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fcuda-python%2Fissues%2F439
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%2F439
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/439
Reloadhttps://github.com/NVIDIA/cuda-python/issues/439
Reloadhttps://github.com/NVIDIA/cuda-python/issues/439
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/439
New issuehttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/439
#546https://github.com/NVIDIA/cuda-python/pull/546
Querying current device is slow compared to CuPyhttps://github.com/NVIDIA/cuda-python/issues/439#top
#546https://github.com/NVIDIA/cuda-python/pull/546
https://github.com/vzhurba01
P1Medium priority - Should dohttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P1%22
cuda.bindingsEverything related to the cuda.bindings modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.bindings%22
enhancementAny code-related improvementshttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
cuda-python 12.9.0 & 11.8.7https://github.com/NVIDIA/cuda-python/milestone/11
https://github.com/shwina
shwinahttps://github.com/shwina
on Feb 7, 2025https://github.com/NVIDIA/cuda-python/issues/439#issue-2838552686
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 Feb 7, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16227334044
leofanghttps://github.com/leofang
cuda.coreEverything related to the cuda.core modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.core%22
enhancementAny code-related improvementshttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
P0High priority - Must do!https://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P0%22
triageNeeds the team's attentionhttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22triage%22
on Feb 7, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16228966413
https://github.com/leofang
leofanghttps://github.com/leofang
on Feb 14, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2658263460
https://github.com/cupy/cupy/blob/1f9c9d4d1eb2edcbeb2a9294def57c2252e18b92/cupy/cuda/device.pyx#L213-L214https://github.com/cupy/cupy/blob/1f9c9d4d1eb2edcbeb2a9294def57c2252e18b92/cupy/cuda/device.pyx#L213-L214
leofanghttps://github.com/leofang
on Feb 14, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16305930271
leofanghttps://github.com/leofang
cuda.core beta 3https://github.com/NVIDIA/cuda-python/milestone/5
on Feb 14, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16306138344
https://github.com/leofang
leofanghttps://github.com/leofang
on Feb 21, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2673234572
@vzhurba01https://github.com/vzhurba01
https://github.com/leofang
leofanghttps://github.com/leofang
on Feb 24, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2678709806
#459https://github.com/NVIDIA/cuda-python/pull/459
leofanghttps://github.com/leofang
vzhurba01https://github.com/vzhurba01
on Feb 24, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16432609408
leofanghttps://github.com/leofang
cuda.core beta 3https://github.com/NVIDIA/cuda-python/milestone/5
cuda-python 12-next, 11-nexthttps://github.com/NVIDIA/cuda-python/milestone/11
on Feb 24, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16432610989
leofanghttps://github.com/leofang
cuda.bindingsEverything related to the cuda.bindings modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.bindings%22
P1Medium priority - Should dohttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P1%22
cuda.coreEverything related to the cuda.core modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.core%22
P0High priority - Must do!https://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P0%22
on Feb 24, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16432614361
https://github.com/leofang
leofanghttps://github.com/leofang
on Feb 27, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2689035241
@rwgkhttps://github.com/rwgk
leofanghttps://github.com/leofang
on Mar 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-16535946125
https://github.com/rwgk
rwgkhttps://github.com/rwgk
on Mar 12, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2719338808
cuda-python/cuda_core/cuda/core/experimental/_device.pyhttps://github.com/NVIDIA/cuda-python/blob/8cda903b365e248af9008d460a718978ea3d649c/cuda_core/cuda/core/experimental/_device.py#L960
8cda903https://github.com/NVIDIA/cuda-python/commit/8cda903b365e248af9008d460a718978ea3d649c
https://github.com/rwgk
rwgkhttps://github.com/rwgk
on Mar 12, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2719364886
https://github.com/leofang
leofanghttps://github.com/leofang
on Mar 13, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2719952408
#439 (comment)https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2673234572
https://github.com/vzhurba01
vzhurba01https://github.com/vzhurba01
on Apr 2, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2773941585
https://github.com/leofang
leofanghttps://github.com/leofang
on Apr 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2774162505
@oleksandr-pavlykhttps://github.com/oleksandr-pavlyk
NVIDIA/cccl#4325https://github.com/NVIDIA/cccl/pull/4325
https://github.com/leofang
leofanghttps://github.com/leofang
on Apr 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2774168100
https://github.com/leofang
leofanghttps://github.com/leofang
on Apr 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2774193711
https://github.com/vzhurba01
vzhurba01https://github.com/vzhurba01
on Apr 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2776690759
https://github.com/leofang
leofanghttps://github.com/leofang
on Apr 3, 2025https://github.com/NVIDIA/cuda-python/issues/439#issuecomment-2776743895
leofanghttps://github.com/leofang
completedhttps://github.com/NVIDIA/cuda-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#546https://github.com/NVIDIA/cuda-python/pull/546
on Apr 5, 2025https://github.com/NVIDIA/cuda-python/issues/439#event-17137096412
Sign up for freehttps://github.com/signup?return_to=https://github.com/NVIDIA/cuda-python/issues/439
Sign in to commenthttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/439
vzhurba01https://github.com/vzhurba01
P1Medium priority - Should dohttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22P1%22
cuda.bindingsEverything related to the cuda.bindings modulehttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22cuda.bindings%22
enhancementAny code-related improvementshttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22enhancement%22
cuda-python 12.9.0 & 11.8.7https://github.com/NVIDIA/cuda-python/milestone/11
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.