Skip to content

build: keep the CCCL submodule out of the sdist - #3138

Merged
juenglin merged 1 commit into
NVIDIA:mainfrom
juenglin:sdist-exclude-cccl-submodule
Oct 16, 2026
Merged

juenglin merged 1 commit into
NVIDIA:mainfrom
juenglin:sdist-exclude-cccl-submodule

Conversation

@juenglin

@juenglin juenglin commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #2940.

Motivation: the cuda.core sdist became ~6x larger than intended

#2940 vendored CCCL as the submodule cuda_core/third_party/cccl and grafted only its libcudacxx/include tree (plus the licenses) into the sdist through cuda_core/MANIFEST.in. The comment there states the intent: "setuptools-scm only records the submodule gitlink, so graft the libcu++ headers needed for wheel-from-sdist builds".

That no longer holds with setuptools-scm 10. Its git file finder lists the files of a submodule that is checked out. Building the cuda.core sdist from a checkout with the submodule initialized, which cuda.core needs in order to compile, therefore packs the entire CCCL tree into the sdist: cub, thrust, cudax, docs, tests, and so on. cuda.core compiles against none of that.

Measured with python setup.py sdist in cuda_core/, with the submodule initialized, swapping only .gitattributes:

files in sdist of which CCCL size
main 12,791 12,353 14,510,994 bytes (~14.5 MB)
this PR 2,133 1,695 2,518,166 bytes (~2.5 MB)

That is 83% smaller, and nothing outside third_party/cccl/ changes. The same finder also walks the submodule on every egg_info run (twice per run), which slows down each wheel build as a side effect. On my workstation egg_info for cuda_core goes from about 600 ms to about 190 ms.

Change

Mark the submodule export-ignore in .gitattributes. The setuptools-scm finder honors the attribute for submodules and skips the path. The MANIFEST.in graft is matched on the file system, so it still adds what cuda.core needs. With this change, the MANIFEST.in comment above holds again.

What stays in the sdist from CCCL: all 1,584 files of libcudacxx/include, third_party/cccl/LICENSE and third_party/cccl/libcudacxx/LICENSE.TXT. What goes away is everything that cuda.core does not compile against, including the license files of the components that are no longer shipped (for example cub/LICENSE.TXT and cudax/LICENSE.TXT).

Verification

  • The set of sdist members differs between main and this branch only by files below third_party/cccl/. No file is added, and no libcudacxx/include header is lost.
  • The unpacked sdist passes the check in build_hooks._get_cccl_include_dirs() (libcudacxx/include/cuda/tma is present).
  • git check-attr export-ignore -- cuda_core/third_party/cccl reports set.
  • A change to the root .gitattributes makes compute_ci_plan.py select the full CI, so test-sdist-linux and test-sdist-windows run. They build the cuda.core sdist and then a wheel from it.

Checklist

  • New or existing tests cover these changes. (The existing test-sdist-* jobs build the cuda.core sdist and a wheel from it.)
  • The documentation is up to date with these changes. (No documentation change is needed.)

Follow-up to NVIDIA#2940. That change vendored CCCL as the submodule
cuda_core/third_party/cccl and grafted its libcudacxx/include tree into the
sdist through cuda_core/MANIFEST.in.

The setuptools-scm 10 git file finder lists the files of an initialized
submodule, so building an sdist from a checkout that has the submodule
checked out now packs the entire CCCL tree (cub, thrust, docs, tests, ...)
into the sdist, although cuda.core only needs the libcu++ headers that
MANIFEST.in already adds explicitly. The same listing is also walked on every
egg_info run, which slows down wheel builds.

Mark the submodule export-ignore, which the finder honors, so it is skipped.
The MANIFEST.in graft still provides the headers and licenses.
@juenglin juenglin added this to the cuda.core 1.3.0 milestone Oct 16, 2026
@juenglin juenglin added packaging Anything related to wheels or Conda packages cuda.core Everything related to the cuda.core module labels Oct 16, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 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.

@juenglin juenglin self-assigned this Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuda-python/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: e5d0ac79-ee7a-4d13-b267-57e2b5b1f069
📥 Commits

Reviewing files that changed from the base of the PR and between d020a5d and f40cbb1.

📒 Files selected for processing: 1
  • .gitattributes

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Chores
    • Git-generated source archives now omit the bundled third-party CUDA utilities. This changes the contents of archive downloads only; it does not affect runtime behavior or the project contents available in a repository checkout.

The .gitattributes file now marks cuda_core/third_party/cccl as export-ignore. Git archive exports exclude this submodule path.

Changes: Archive export configuration

Layer / File(s) Summary
Exclude CCCL from archive exports
.gitattributes
A comment describes the CCCL submodule’s sdist handling. The export-ignore attribute excludes its path from Git archive exports.

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f40cb

The packaging change excludes unrelated CCCL files while retaining the headers and licenses needed by the package. No material merge risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juenglin
juenglin requested review from leofang and seberg October 16, 2026 17:51
@juenglin

Copy link
Copy Markdown
Contributor Author

/ok to test f40cbb1

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@juenglin
juenglin enabled auto-merge (squash) October 16, 2026 18:12
@juenglin
juenglin requested a review from jpascucci-nv October 16, 2026 20:48
@juenglin
juenglin merged commit 7714b06 into NVIDIA:main Oct 16, 2026
208 of 210 checks passed
@leofang

leofang commented Oct 16, 2026

Copy link
Copy Markdown
Member

Seems like a surgical change! Thanks.

github-actions Bot pushed a commit that referenced this pull request Oct 17, 2026
Removed preview folders for the following PRs:
- PR #3109
- PR #3114
- PR #3117
- PR #3124
- PR #3125
- PR #3132
- PR #3135
- PR #3138
- PR #3139
- PR #3140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module packaging Anything related to wheels or Conda packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants