Title: [BUG]: CUDA API calls through `cuda-bindings` 3x slower than direct CUDA C++ API calls · Issue #659 · NVIDIA/cuda-python · GitHub
Open Graph Title: [BUG]: CUDA API calls through `cuda-bindings` 3x slower than direct CUDA C++ API calls · Issue #659 · NVIDIA/cuda-python
X Title: [BUG]: CUDA API calls through `cuda-bindings` 3x slower than direct CUDA C++ API calls · Issue #659 · NVIDIA/cuda-python
Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Performance Component cuda.bindings Describe the bug I have a same CUDA kernel, and I am calling it ...
Open Graph Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Performance Component cuda.bindings Describe the bug I have ...
X Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Performance Component cuda.bindings Describe the bug I have ...
Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/659
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: CUDA API calls through `cuda-bindings` 3x slower than direct CUDA C++ API calls","articleBody":"### Is this a duplicate?\n\n- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cuda-python/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)\n\n### Type of Bug\n\nPerformance\n\n### Component\n\ncuda.bindings\n\n### Describe the bug\n\nI have a same CUDA kernel, and I am calling it using two different methods.\n\n1. Compile the kernel to `.cubin`, load it in Python and call it using `cuda-bindings`. The TMA descriptors are also created via `cuda-bindings`.\n2. Compile the kernel and relevant C++ host functions (including TMA desc, kernel attribute and launch config) to `.so`, load the `.so` in Python and call the C++ host function.\n\nAs revealed in the two timelines below, the first path is 3x slower than the second path. \n\u003cimg width=\"582\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/b6962032-34ce-4180-aed7-09baeabffac2\" />\n\u003cimg width=\"803\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/597bc426-2ccd-47a2-9a04-b75c66133dc6\" />\n\n### How to Reproduce\n\nFollow the instructions in the reproduction repo https://github.com/lucifer1004/cuda-python-repro\n\n### Expected behavior\n\nCUDA Python's perf should be on par with CUDA C++.\n\n### Operating System\n\nUbuntu Linux 24.04\n\n### nvidia-smi output\n\n+-----------------------------------------------------------------------------------------+\n| NVIDIA-SMI 550.54.15 Driver Version: 550.54.15 CUDA Version: 12.9 |\n|-----------------------------------------+------------------------+----------------------+\n| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n| | | MIG M. |\n|=========================================+========================+======================|\n| 0 NVIDIA H100 80GB HBM3 On | 00000000:53:00.0 Off | 0 |\n| N/A 27C P0 69W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 1 NVIDIA H100 80GB HBM3 On | 00000000:64:00.0 Off | 0 |\n| N/A 28C P0 68W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 2 NVIDIA H100 80GB HBM3 On | 00000000:75:00.0 Off | 0 |\n| N/A 27C P0 69W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 3 NVIDIA H100 80GB HBM3 On | 00000000:86:00.0 Off | 0 |\n| N/A 29C P0 68W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 4 NVIDIA H100 80GB HBM3 On | 00000000:97:00.0 Off | 0 |\n| N/A 30C P0 69W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 5 NVIDIA H100 80GB HBM3 On | 00000000:A8:00.0 Off | 0 |\n| N/A 28C P0 68W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 6 NVIDIA H100 80GB HBM3 On | 00000000:B9:00.0 Off | 0 |\n| N/A 28C P0 69W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n| 7 NVIDIA H100 80GB HBM3 On | 00000000:CA:00.0 Off | 0 |\n| N/A 26C P0 66W / 700W | 0MiB / 81559MiB | 0% Default |\n| | | Disabled |\n+-----------------------------------------+------------------------+----------------------+\n \n+-----------------------------------------------------------------------------------------+\n| Processes: |\n| GPU GI CI PID Type Process name GPU Memory |\n| ID ID Usage |\n|=========================================================================================|\n| No running processes found |\n+-----------------------------------------------------------------------------------------+","author":{"url":"https://github.com/lucifer1004","@type":"Person","name":"lucifer1004"},"datePublished":"2025-05-27T05:44:26Z","url":"https://github.com/NVIDIA/cuda-python/issues/659"}
| 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:7f0f9ff1-ee64-7ff2-8bac-811242f26586 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB42:7B817:6F86D1:9386D6:6AF83AAF |
| html-safe-nonce | fbcbe2978ceddfe72325c0d05c5c62a64de263242086945f8c1095afe56ec3a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjQyOjdCODE3OjZGODZEMTo5Mzg2RDY6NkFGODNBQUYiLCJ2aXNpdG9yX2lkIjoiMzY2OTQyNDA2NzI1NDQzNDQ3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 95c067b40445b574e00106e0bf51881ee6c8439a85bbdf418b4795b88819ca73 |
| hovercard-subject-tag | issue:3092653246 |
| 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/659/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94afc293106d0e2223f2d69121564f6736bb3712acd18ff6a5f55ae99866a07b/NVIDIA/cuda-python/issues/659 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94afc293106d0e2223f2d69121564f6736bb3712acd18ff6a5f55ae99866a07b/NVIDIA/cuda-python/issues/659 |
| og:image:alt | Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Performance Component cuda.bindings Describe the bug I have ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lucifer1004 |
| 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