René's URL Explorer Experiment


Title: `StridedMemoryView` fails with Jax arrays · Issue #285 · NVIDIA/cuda-python · GitHub

Open Graph Title: `StridedMemoryView` fails with Jax arrays · Issue #285 · NVIDIA/cuda-python

X Title: `StridedMemoryView` fails with Jax arrays · Issue #285 · NVIDIA/cuda-python

Description: @yangcal was trying the StridedMemoryView but it doesn’t seem to work for jax array, at least with cuda12.2. Below is the script and the error log: import cupy as cp import numpy as np import jax.numpy as jnp from cuda.core.experimental....

Open Graph Description: @yangcal was trying the StridedMemoryView but it doesn’t seem to work for jax array, at least with cuda12.2. Below is the script and the error log: import cupy as cp import numpy as np import jax.n...

X Description: @yangcal was trying the StridedMemoryView but it doesn’t seem to work for jax array, at least with cuda12.2. Below is the script and the error log: import cupy as cp import numpy as np import jax.n...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`StridedMemoryView` fails with Jax arrays","articleBody":"@yangcal was trying the `StridedMemoryView` but it doesn’t seem to work for jax array, at least with cuda12.2. Below is the script and the error log:\n```python\nimport cupy as cp\nimport numpy as np\nimport jax.numpy as jnp\n\nfrom cuda.core.experimental.utils import args_viewable_as_strided_memory\n\n@args_viewable_as_strided_memory((0,))\ndef parse_tensor(arr):\n    view = arr.view(-1)\n    print(type(arr), type(view))\n    print(f\"shape={view.shape}\")\n    print(f\"strides={view.strides}\")\n\nfor module in (np, cp, jnp):\n    arr = module.eye(2)\n    print(f\"module={module.__name__}\")\n    parse_tensor(arr)\n```\nError Log:\n```\nE1211 13:52:21.674104 2256128 ptx_compiler_helpers.cc:71] *** WARNING *** Invoking ptxas with version 12.2.140, which corresponds to a CUDA version \u003c=12.6.2. CUDA versions 12.x.y up to and including 12.6.2 miscompile certain edge cases around clamping.\nPlease upgrade to CUDA 12.6.3 or newer.\nmodule=jax.numpy\nTraceback (most recent call last):\n  File \"/home/scratch.yangg_sw/software/cuda-python/cuda_core/examples/tmp.py\", line 18, in \u003cmodule>\n    parse_tensor(arr)\n  File \"cuda/core/experimental/_memoryview.pyx\", line 372, in cuda.core.experimental._memoryview.args_viewable_as_strided_memory.wrapped_func_with_indices.wrapped_func\n  File \"/home/scratch.yangg_sw/software/cuda-python/cuda_core/examples/tmp.py\", line 10, in parse_tensor\n    view = arr.view(-1)\n           ^^^^^^^^^^^^\n  File \"cuda/core/experimental/_memoryview.pyx\", line 146, in cuda.core.experimental._memoryview._StridedMemoryViewProxy.view\n  File \"cuda/core/experimental/_memoryview.pyx\", line 148, in cuda.core.experimental._memoryview._StridedMemoryViewProxy.view\n  File \"cuda/core/experimental/_memoryview.pyx\", line 180, in cuda.core.experimental._memoryview.view_as_dlpack\n  File \"/home/Self/marie/miniconda3/envs/jax/lib/python3.12/site-packages/jax/_src/array.py\", line 446, in __dlpack__\n    return to_dlpack(self, stream=stream,\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/Self/marie/miniconda3/envs/jax/lib/python3.12/site-packages/jax/_src/dlpack.py\", line 134, in to_dlpack\n    return _to_dlpack(\n           ^^^^^^^^^^^\n  File \"/home/Self/marie/miniconda3/envs/jax/lib/python3.12/site-packages/jax/_src/dlpack.py\", line 65, in _to_dlpack\n    return xla_client._xla.buffer_to_dlpack_managed_tensor(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\njaxlib.xla_extension.XlaRuntimeError: INTERNAL: CUDA error: : CUDA_ERROR_INVALID_HANDLE: invalid resource handle\n```\nIs it a semantics error on my side or cuda version issue?","author":{"url":"https://github.com/leofang","@type":"Person","name":"leofang"},"datePublished":"2024-12-11T22:41:42Z","url":"https://github.com/NVIDIA/cuda-python/issues/285"}

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:36722c9a-85b3-8fd7-8250-f72f5f0dd837
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA6C8:3AABB4:12C0B6E:18B9A65:6AF88697
html-safe-noncecf8d7b36913bbc60e5108cc11e2c5e979cd15bc0679f2d2f35ffa223f2c3d975
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkM4OjNBQUJCNDoxMkMwQjZFOjE4QjlBNjU6NkFGODg2OTciLCJ2aXNpdG9yX2lkIjoiNzMyODQwMTIyNTAzNDMxODMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd36e540ebabeb206ff6e7225f0fcb4e7ce7f7ae3dd80717d351efe10bab9a0af
hovercard-subject-tagissue:2734178402
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/285/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cea305ae8cd40474037d2d535c229c1f6fc1bf839a9ab46ad7379819a3de21bc/NVIDIA/cuda-python/issues/285
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cea305ae8cd40474037d2d535c229c1f6fc1bf839a9ab46ad7379819a3de21bc/NVIDIA/cuda-python/issues/285
og:image:alt@yangcal was trying the StridedMemoryView but it doesn’t seem to work for jax array, at least with cuda12.2. Below is the script and the error log: import cupy as cp import numpy as np import jax.n...
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/285#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNVIDIA%2Fcuda-python%2Fissues%2F285
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%2F285
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/285
Reloadhttps://github.com/NVIDIA/cuda-python/issues/285
Reloadhttps://github.com/NVIDIA/cuda-python/issues/285
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/285
New issuehttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/285
#292https://github.com/NVIDIA/cuda-python/pull/292
StridedMemoryView fails with Jax arrayshttps://github.com/NVIDIA/cuda-python/issues/285#top
#292https://github.com/NVIDIA/cuda-python/pull/292
https://github.com/keenan-simpson
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 beta 2https://github.com/NVIDIA/cuda-python/milestone/4
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 11, 2024https://github.com/NVIDIA/cuda-python/issues/285#issue-2734178402
@yangcalhttps://github.com/yangcal
leofanghttps://github.com/leofang
keenan-simpsonhttps://github.com/keenan-simpson
on Dec 11, 2024https://github.com/NVIDIA/cuda-python/issues/285#event-15626115016
leofanghttps://github.com/leofang
cuda.core beta 2https://github.com/NVIDIA/cuda-python/milestone/4
on Dec 11, 2024https://github.com/NVIDIA/cuda-python/issues/285#event-15626116469
leofanghttps://github.com/leofang
triageNeeds the team's attentionhttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22triage%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 Dec 11, 2024https://github.com/NVIDIA/cuda-python/issues/285#event-15626117941
https://github.com/yangcal
yangcalhttps://github.com/yangcal
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2537464574
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2537497072
https://github.com/keenan-simpson
keenan-simpsonhttps://github.com/keenan-simpson
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539540934
@leofanghttps://github.com/leofang
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539548203
https://github.com/keenan-simpson
keenan-simpsonhttps://github.com/keenan-simpson
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539565882
https://github.com/jax-ml/jax/blob/99d675ac25f583c0c2e61631355e0d11ba3abf18/jax/_src/dlpack.py#L65https://github.com/jax-ml/jax/blob/99d675ac25f583c0c2e61631355e0d11ba3abf18/jax/_src/dlpack.py#L65
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539599910
@yangcalhttps://github.com/yangcal
@jakevdphttps://github.com/jakevdp
the __dlpack__ docshttps://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__dlpack__.html#array_api.array.__dlpack__
https://github.com/openxla/xla/https://github.com/openxla/xla/
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539616333
herehttps://github.com/cupy/cupy/blob/087911cbea724c25aaf321404a15bcef20726f95/cupy/_core/core.pyx#L375-L379
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539742093
this pathhttps://github.com/jax-ml/jax/blob/3f58337bbc04b801b192b2b02939243f03a9677b/jax/_src/dlpack.py#L127-L139
the old name (dltensor)https://github.com/openxla/xla/blob/fb8e7d579f9211092af83df22935eef54062690d/xla/python/dlpack.cc#L68
without checking if it's -1https://github.com/openxla/xla/blob/fb8e7d579f9211092af83df22935eef54062690d/xla/pjrt/pjrt_c_api_client.cc#L2198
reach an AssertionErrorhttps://github.com/NVIDIA/cuda-python/blob/64cbc4c2a600cca5c9eba166fb21091a4c1f0d46/cuda_core/cuda/core/experimental/_memoryview.pyx#L199
https://github.com/keenan-simpson
keenan-simpsonhttps://github.com/keenan-simpson
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539749434
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539843083
@yangcalhttps://github.com/yangcal
@jakevdphttps://github.com/jakevdp
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539868705
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2539915421
#292https://github.com/NVIDIA/cuda-python/pull/292
leofanghttps://github.com/leofang
bugSomething isn't workinghttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22bug%22
triageNeeds the team's attentionhttps://github.com/NVIDIA/cuda-python/issues?q=state%3Aopen%20label%3A%22triage%22
on Dec 12, 2024https://github.com/NVIDIA/cuda-python/issues/285#event-15640150136
https://github.com/keenan-simpson
keenan-simpsonhttps://github.com/keenan-simpson
on Dec 13, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2542397727
#292https://github.com/NVIDIA/cuda-python/pull/292
@yangcalhttps://github.com/yangcal
leofanghttps://github.com/leofang
completedhttps://github.com/NVIDIA/cuda-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#292https://github.com/NVIDIA/cuda-python/pull/292
on Dec 13, 2024https://github.com/NVIDIA/cuda-python/issues/285#event-15653715149
https://github.com/yangcal
yangcalhttps://github.com/yangcal
on Dec 17, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2547273659
https://github.com/leofang
leofanghttps://github.com/leofang
on Dec 17, 2024https://github.com/NVIDIA/cuda-python/issues/285#issuecomment-2547313461
Sign up for freehttps://github.com/signup?return_to=https://github.com/NVIDIA/cuda-python/issues/285
Sign in to commenthttps://github.com/login?return_to=https://github.com/NVIDIA/cuda-python/issues/285
keenan-simpsonhttps://github.com/keenan-simpson
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 beta 2https://github.com/NVIDIA/cuda-python/milestone/4
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.