Skip to content

Migrating cuda-python samples from cuda-samples#2266

Open
danielfrg wants to merge 2 commits into
mainfrom
migrate-samples
Open

Migrating cuda-python samples from cuda-samples#2266
danielfrg wants to merge 2 commits into
mainfrom
migrate-samples

Conversation

@danielfrg

Copy link
Copy Markdown
Contributor

Description

Moving the cuda-python samples from the cuda-samples repo.

Migrating also the sample runners and added a small pytest wrapper to run the test.

Let me know if we want to do any changes to when these are run.

closes

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@danielfrg danielfrg requested a review from leofang June 25, 2026 19:58
@github-actions github-actions Bot added CI/CD CI/CD infrastructure cuda.core Everything related to the cuda.core module labels Jun 25, 2026
@danielfrg danielfrg added cuda.bindings Everything related to the cuda.bindings module example Improvements or additions to code examples labels Jun 25, 2026
@danielfrg danielfrg self-assigned this Jun 25, 2026
@danielfrg danielfrg added this to the cuda.core v1.1.0 milestone Jun 25, 2026

@mdboom mdboom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan here to migrate the samples here from cuda-samples, and this would be the new canonical location? I ask only because the check_spdx.py change suggests it's just "syncing" them.

We already have examples in cuda_bindings/examples and cuda_core/examples. I think it would be better to add these in one of those two places (depending on whether the sample uses cuda_core or not) rather than creating a third place. There is already infrastructure there to run those as part of the main test suite. (I also think it's preferable to test these as part of the cuda_bindings and cuda_core test suites rather

There may or may not be redundancy between some of these examples and the ones already in this repo. I'm haven't verified that, but maybe having an agent search for any that are explaining redundant concepts might pare this down a bit.

We also put a bunch of work into standardizing the examples in this issue. You might be able to point your agent at that issue and get it to perform some cleanup on these.

The other significant difference is that these examples all have extensive README.md files. The existing ones here don't. Personally, I think the README.md content could go in the top of each example file as a docstring, but I'm open to other ideas.

@danielfrg

Copy link
Copy Markdown
Contributor Author

Sorry i forgot to add more context. Leo had it from a meeting we had a while back with the samples team but not everyone was there.

Yes, the idea is to move the source of truth of the cuda-samples to cuda-python. So we can have CI and so on here.

We agreed on syncing the samples to the cuda-samples repo on each release so that they are also part of the broader existing samples. That's another process that would be independent of what we have here and the samples team will do that.

I did not removed any existing examples yet but we should migrate those to the standard we have in cuda-samples, basically have the markdown and comments in the code explaining. I can do that.

I am mostly looking for feedback on the CI parts, because we need the samples to be standalone (for when we sync) we have that pytest wrapper.

@mdboom

mdboom commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

I have no objection to moving these into their own top-level organization. However, they should be tested as part of the main cuda_bindings or cuda_core test suites. (i.e. python -m pytest cuda_bindings/tests). Until pretty recently, they had their own separate suite, which made it really difficult for development, since it was so easily forgotten.

The existing examples are also included in the docs and we should figure out how to address that so there is one canonical online place where people would find things. (But that could be follow-on work, possibly managed by the samples team, once the merging of the 3 sets of examples happens)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module example Improvements or additions to code examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants