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
Domain: github.com
{"@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-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:36722c9a-85b3-8fd7-8250-f72f5f0dd837 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A6C8:3AABB4:12C0B6E:18B9A65:6AF88697 |
| html-safe-nonce | cf8d7b36913bbc60e5108cc11e2c5e979cd15bc0679f2d2f35ffa223f2c3d975 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkM4OjNBQUJCNDoxMkMwQjZFOjE4QjlBNjU6NkFGODg2OTciLCJ2aXNpdG9yX2lkIjoiNzMyODQwMTIyNTAzNDMxODMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d36e540ebabeb206ff6e7225f0fcb4e7ce7f7ae3dd80717d351efe10bab9a0af |
| hovercard-subject-tag | issue:2734178402 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/cuda-python/285/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cea305ae8cd40474037d2d535c229c1f6fc1bf839a9ab46ad7379819a3de21bc/NVIDIA/cuda-python/issues/285 |
| twitter:card | summary_large_image |
| og:image | https://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:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leofang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/NVIDIA/cuda-python git https://github.com/NVIDIA/cuda-python.git |
| octolytics-dimension-user_id | 1728152 |
| octolytics-dimension-user_login | NVIDIA |
| octolytics-dimension-repository_id | 381173759 |
| octolytics-dimension-repository_nwo | NVIDIA/cuda-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 381173759 |
| octolytics-dimension-repository_network_root_nwo | NVIDIA/cuda-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width