Closed
Labels
P0High priority - Must do!High priority - Must do!bugSomething isn't workingSomething isn't workingcuda.coreEverything related to the cuda.core moduleEverything related to the cuda.core moduletriageNeeds the team's attentionNeeds the team's attention
Milestone
Description
The cuda_core examples are currently running in CI by exec'ing code. Now that they have all been refactored to have a main() function in #1674, we should be able to do that instead, as this comment suggests:
# TODO: Refactor the examples to give them a common callable `main()` to avoid needing to use exec here?
Metadata
Metadata
Assignees
Labels
P0High priority - Must do!High priority - Must do!bugSomething isn't workingSomething isn't workingcuda.coreEverything related to the cuda.core moduleEverything related to the cuda.core moduletriageNeeds the team's attentionNeeds the team's attention
Activity
mdboom commentedon Mar 20, 2026
Actually the problem is much worse: The current test as written is just an "import smoketest" of all the examples, but it doesn't actually run any of them. Adding the "bug" label here, because this is definitely a problem that our examples are being tested.
leofang commentedon Apr 7, 2026
Thanks for the good catch. We used
execfor a purpose: We want to avoid the process setup/teardown overhead, which is very time-consuming for CUDA programs. Also, it allows us to save a bit of GPU memory when parallelizing tests with pytest-xdist. Theexecusage has been used for several years, since the debut of cuQuantum Python and is now also used by nvmath-python.IIUC what caused the samples to not run in the CI was due to the recent move to use
__main__(PR 1770). In this case,execcannot execute themain()function.