Skip to content

Move cuda_bindings to a src layout#1888

Draft
mdboom wants to merge 18 commits intoNVIDIA:mainfrom
mdboom:cuda-bindings-src-layout
Draft

Move cuda_bindings to a src layout#1888
mdboom wants to merge 18 commits intoNVIDIA:mainfrom
mdboom:cuda-bindings-src-layout

Conversation

@mdboom
Copy link
Copy Markdown
Contributor

@mdboom mdboom commented Apr 9, 2026

This moves cuda_bindings to use a src layout, which is the recommended way to avoid a number of issues when the local checkout environment is getting inadvertently pulled in. While this may in fact be a bug in pip that it isn't sufficiently isolating the build environment, it's still good practice to use src layout, so we may want to consider it.

Of course, a big change like this will have far-reaching merge implications and on other workflows etc., so I'm not suggesting we merge this as-is without some discussion.

rwgk and others added 17 commits March 24, 2026 17:00
Pin cuda-pathfinder>=1.5 in both build-system.requires and
project.dependencies.

Made-with: Cursor
The previous 1.3.4a0 was a stale value that could confuse someone.

Made-with: Cursor
Use exclusion-style constraints in cuda_bindings, cuda_core, and cuda_pathfinder so CI avoids cuda-toolkit 12.9.2 and 13.0.3 while still allowing newer good patch releases.

Made-with: Cursor
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 9, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mdboom mdboom force-pushed the cuda-bindings-src-layout branch from 3efe6e5 to d6a5936 Compare April 9, 2026 22:52
@mdboom mdboom changed the title Move Move cuda_bindings to a src layout Apr 9, 2026
@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Apr 9, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

@mdboom mdboom requested a review from rwgk April 10, 2026 12:35
@rwgk
Copy link
Copy Markdown
Collaborator

rwgk commented Apr 10, 2026

This PR makes it so that we have to use

cd cuda_bindings/src/cuda/bindings

to jump to our sources. One extra level, four characters more, I guess it's only a tiny extra inconvenience overall.

But I'm wondering, could it also be:

cd src/cuda/bindings
cd src/cuda/core
cd src/cuda/pathfinder

I guess not? — Or is there some place for the README, pyproject.toml etc. files with that layout?

@leofang
Copy link
Copy Markdown
Member

leofang commented Apr 10, 2026

No. Different projects need to have their own src.

I am supportive of this move, though my explicit complaint for the whole situation is: Python needs to do better in distinguishing local scripts/modules vs out-of-tree builds. Forcing everyone to move to src/ to avoid issues is very opinionated and unaesthetic.

@rwgk
Copy link
Copy Markdown
Collaborator

rwgk commented Apr 10, 2026

I am supportive of this move,

Sounds good to me. Is there already a plan for moving cuda_core and cuda_pathfinder? (Doing all asap would seem best to me.)

@mdboom
Copy link
Copy Markdown
Contributor Author

mdboom commented Apr 10, 2026

I am supportive of this move, though my explicit complaint for the whole situation is: Python needs to do better in distinguishing local scripts/modules vs out-of-tree builds. Forcing everyone to move to src/ to avoid issues is very opinionated and unaesthetic.

Yes, I agree. I think this is just an historical artifact that the language started as "run stuff out of the current directory" long before packages and virtual environments etc. were ever dreamed of. It still hasn't fully moved into the future.

Sounds good to me. Is there already a plan for moving cuda_core and cuda_pathfinder? (Doing all asap would seem best to me.)

I think we should do them all at the same time -- I just wanted to have a bot build a PoC first and prove it's possible. Mainly I wanted to confirm that none of the GHA would need to change, since that would indicate things our /users/ might have to change.

There will be a little bit of fallout for anything that automates putting cython-gen/cybind code into this repo since the destination directory changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants