Title: `StridedMemoryView` should expose access to the producer stream if possible · Issue #259 · NVIDIA/cuda-python · GitHub
Open Graph Title: `StridedMemoryView` should expose access to the producer stream if possible · Issue #259 · NVIDIA/cuda-python
X Title: `StridedMemoryView` should expose access to the producer stream if possible · Issue #259 · NVIDIA/cuda-python
Description: In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream after the consumer one, when the work is done. (Ex: a ping pong exchange between producer/consumer in a tight loop.) Righ...
Open Graph Description: In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream after the consumer one, when the work is done. (Ex: a ping pong exchange between ...
X Description: In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream after the consumer one, when the work is done. (Ex: a ping pong exchange between ...
Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/259
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`StridedMemoryView` should expose access to the producer stream if possible","articleBody":"In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream *after* the consumer one, when the work is done. (Ex: a ping pong exchange between producer/consumer in a tight loop.) \n\nRight now, `StridedMemoryView` follows both DLPack and CAI and does the hand-shake (stream ordering) only once. But a second ordering can be done if the producer stream is exposed. In general, this is not considered safe (because the producer may not guarantee the stream pointer is always valid during the lifetime of a `StridedMemoryView` instance). However, we do have one situation that guarantees the pointer lifetime, which is when `StridedMemoryView` instances are created inside a `@args_viewable_as_strided_memory` context (WIP in #247). In this case, before the decorated function returns the producer stream is considered always valid, and by exposing it we allow users to perform such ordering before this function returns, e.g.\n```python\n@args_viewable_as_strided_memory((0,))\ndef my_func(arr, work_stream):\n # work_stream is a \"consumer\" stream\n view = arr.view(work_stream.handle)\n assert isinstance(view.producer_stream, Stream)\n # ... do work on work_stream ...\n view.producer_stream.wait(work_stream)\n return\n```","author":{"url":"https://github.com/leofang","@type":"Person","name":"leofang"},"datePublished":"2024-12-02T04:00:40Z","url":"https://github.com/NVIDIA/cuda-python/issues/259"}
| 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:c6e69d51-e7fb-28e7-e56b-7aa3f6a2762a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D14:26EB2C:3571FB:4A6CAA:6AF84748 |
| html-safe-nonce | 7fb12f98896b9f73cfc38673697a4d5cd8d733415459758e75d0ce62915d7983 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDE0OjI2RUIyQzozNTcxRkI6NEE2Q0FBOjZBRjg0NzQ4IiwidmlzaXRvcl9pZCI6IjQxNjI2NDc5NjY4MTQzMjQ1NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 621c17cb3a7c4e8580bb98d59bef6f69f194f1fb269deb9dc83ffa0b5379ca51 |
| hovercard-subject-tag | issue:2710387208 |
| 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/259/issue_layout |
| twitter:image | https://opengraph.githubassets.com/101c5a0f1a5bad5ead6572d0fc36a8257c5af33d5a210b4ee3d5263377f00cc7/NVIDIA/cuda-python/issues/259 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/101c5a0f1a5bad5ead6572d0fc36a8257c5af33d5a210b4ee3d5263377f00cc7/NVIDIA/cuda-python/issues/259 |
| og:image:alt | In an offline discussion it was brought to my attention that some use cases need a way to order the producer stream after the consumer one, when the work is done. (Ex: a ping pong exchange between ... |
| 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