Skip to content

MNT: Add cuda12 extra, update URLs to Project-MONAI, fix capitalization#38

Open
aylward wants to merge 3 commits intoProject-MONAI:mainfrom
aylward:cuda
Open

MNT: Add cuda12 extra, update URLs to Project-MONAI, fix capitalization#38
aylward wants to merge 3 commits intoProject-MONAI:mainfrom
aylward:cuda

Conversation

@aylward
Copy link
Copy Markdown
Collaborator

@aylward aylward commented Apr 1, 2026

Adds a cuda12 optional extra (cupy-cuda12x, pytorch cu128) so users on CUDA 12 systems can install without source-building cupy. Makes CUDA 13 the default install. Updates all GitHub URLs from aylward/PhysioMotion4d to Project-MONAI/physiomotion4d and fixes the lone PhysioMotion4d capitalisation violation in docs/conf.py.

Summary by CodeRabbit

  • Documentation

    • CUDA 13 is now the default; CUDA 12 supported via a new optional "cuda12" extra.
    • CPU-only installation is not supported.
    • Installation and editable-install commands now use uv pip with CUDA-specific extras.
    • New troubleshooting section for CUDA version mismatches.
    • Repository and docs links updated to the new project location.
  • Chores

    • Removed JupyterLab from core dependencies.
    • Added config and package index entries to enable CUDA 12 builds.
  • Behavior

    • Package now fails early at import if GPU-support libraries are not installed, with guidance to install the appropriate CUDA extra.

Adds a cuda12 optional extra (cupy-cuda12x, pytorch cu128) so users on CUDA 12 systems can install without source-building cupy. Makes CUDA 13 the default install. Updates all GitHub URLs from aylward/PhysioMotion4d to Project-MONAI/physiomotion4d and fixes the lone PhysioMotion4d capitalisation violation in docs/conf.py.
Copilot AI review requested due to automatic review settings April 1, 2026 02:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

Updates docs and packaging to make CUDA 13 the default (CUDA 12 available via a cuda12 extra), switch install examples to uv pip, repoint repository links to Project-MONAI, add CUDA troubleshooting, and add an import-time CuPy check that errors if GPU/CuPy is not installed (CPU-only installs unsupported).

Changes

Cohort / File(s) Summary
Docs — repo links & badges
docs/changelog.rst, docs/conf.py, docs/contributing.rst, docs/index.rst, docs/references.rst
Repointed GitHub URLs, badge targets, and Sphinx html_context from the prior repository to Project-MONAI/physiomotion4d.
Documentation — installation & guidance
README.md, docs/installation.rst, docs/faq.rst, docs/quickstart.rst, docs/troubleshooting.rst
Made CUDA 13 the default with CUDA 12 available via [cuda12]; explicitly state GPU required (no CPU-only installs); replaced pip examples with uv pip CUDA-specific extras; added CUDA mismatch troubleshooting and verification steps; updated issue/help links.
Packaging / dependencies
pyproject.toml
Added project.optional-dependencies.cuda12 and kept cuda13 extra; added a pytorch-cu128 uv index and associated extra index entries; removed jupyterlab and moved cupy CUDA wheels into extras; updated project URLs to Project-MONAI.
Runtime check
src/physiomotion4d/__init__.py
Added an import-time check that attempts to import cupy and raises an ImportError with instructions to reinstall using physiomotion4d[cuda13] or physiomotion4d[cuda12] if CuPy is missing (enforces GPU-enabled install).
Misc docs edits
docs/* (other updated rst files)
Minor text and verification updates across docs to reflect new CUDA defaults, extras, and installation guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped from one repo to another bright field,
CUDA 13 leads, CUDA 12's in the shield,
uv pip delivers the tasty new fare,
Cupy must be present — no CPU-only lair,
A rabbit cheers softly, package ready to share! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: adding a cuda12 extra, updating URLs to Project-MONAI, and fixing capitalization issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@ad76a05). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage        ?   13.67%           
=======================================
  Files           ?       49           
  Lines           ?     6596           
  Branches        ?        0           
=======================================
  Hits            ?      902           
  Misses          ?     5694           
  Partials        ?        0           
Flag Coverage Δ
integration-tests 13.67% <ø> (?)
unittests 13.67% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates installation packaging/docs to support CUDA 12 via an optional extra while making CUDA 13 the default, and migrates repository/documentation links to the Project-MONAI/physiomotion4d GitHub org/repo (plus a capitalization fix in Sphinx config).

Changes:

  • Add a cuda12 optional extra and uv PyTorch indexes/sources for CUDA-specific wheels.
  • Update README + docs to describe CUDA 13 default installs, CUDA 12 installs via [cuda12], and add troubleshooting guidance.
  • Replace legacy GitHub URLs (aylward/PhysioMotion4d) with Project-MONAI/physiomotion4d across docs and project metadata.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
README.md Updates install commands (uv) and CUDA 13/12 guidance.
pyproject.toml Adds cuda12 extra + uv indexes/sources; updates project URLs; removes jupyterlab from deps.
docs/troubleshooting.rst Adds CUDA version mismatch troubleshooting + updates Issues link.
docs/references.rst Updates citation URL to new GitHub repo.
docs/quickstart.rst Updates CUDA prerequisite wording and points to [cuda12].
docs/installation.rst Updates CUDA requirements, install commands, and clone URL.
docs/index.rst Updates badges/links to new GitHub repo/org.
docs/faq.rst Updates GPU/CUDA guidance and adds [cuda12] explanation.
docs/contributing.rst Updates repository link.
docs/conf.py Updates Sphinx html_context GitHub user/repo.
docs/changelog.rst Updates changelog link to new GitHub repo.
Comments suppressed due to low confidence (2)

README.md:47

  • This section switches the primary install instructions to uv, but still recommends pip install physiomotion4d[nim]. Since pip won’t use the [tool.uv.sources] PyTorch CUDA indexes, users may end up with a CPU-only PyTorch wheel (and torch.cuda.is_available() false). Recommend using uv pip install physiomotion4d[nim] here too, or explicitly document that pip is unsupported for GPU installs.
For development with NVIDIA NIM cloud services:
```bash
pip install physiomotion4d[nim]
**docs/installation.rst:55**
* This page recommends `pip install physiomotion4d[nim]`, but the rest of the install guidance depends on `uv` to pull CUDA-enabled PyTorch from the configured `tool.uv.index` entries. Consider switching this to `uv pip install physiomotion4d[nim]` (or warning that `pip` installs may pull CPU-only PyTorch and break GPU functionality).

For development with NVIDIA NIM cloud services:

.. code-block:: bash

pip install physiomotion4d[nim]

</details>



---

💡 <a href="/Project-MONAI/physiomotion4d/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment on lines 82 to 86
# Utilities
"matplotlib>=3.5.0",
"jupyterlab>=4.0.0",
"typing-extensions>=4.0.0",
"cupy-cuda13x>=13.6.0",

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

cupy-cuda13x is still a hard dependency. Installing physiomotion4d[cuda12] will therefore install both cupy-cuda13x and cupy-cuda12x, which defeats the purpose of the CUDA 12 extra and can cause conflicting cupy installs. Consider moving CuPy into mutually exclusive optional extras (e.g., cuda13 and cuda12) or otherwise making the CUDA 13 CuPy dependency conditional so only one CuPy CUDA wheel is installed.

Copilot uses AI. Check for mistakes.
Comment on lines 116 to +119
[project.optional-dependencies]
cuda12 = [
"cupy-cuda12x>=12.0.0",
]
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The cuda12 optional extra only adds cupy-cuda12x but does not prevent the base cupy-cuda13x requirement from being installed. If the intent is to let CUDA 12 users install instead of CUDA 13 CuPy wheels, restructure dependencies so selecting cuda12 results in a single CuPy distribution being installed (and update docs accordingly).

Copilot uses AI. Check for mistakes.

git clone https://github.com/aylward/PhysioMotion4d.git
git clone https://github.com/Project-MONAI/physiomotion4d.git
cd PhysioMotion4D
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

git clone https://github.com/Project-MONAI/physiomotion4d.git will create a physiomotion4d/ directory by default, but the next line says cd PhysioMotion4D. Either change the cd command to match the cloned directory name or add an explicit destination to git clone so the instructions work as written.

Suggested change
cd PhysioMotion4D
cd physiomotion4d

Copilot uses AI. Check for mistakes.

# CUDA 12
uv pip install "physiomotion4d[cuda12]"

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

These instructions rely on uv pip to select the correct PyTorch CUDA index, but later in this same doc the suggested fix for import errors is pip install --upgrade physiomotion4d, which can silently replace CUDA-enabled PyTorch with a CPU wheel. Consider using uv pip consistently in troubleshooting commands (or clearly warn against using plain pip for installs/upgrades).

Suggested change
.. warning::
Use ``uv pip`` consistently for installing **and upgrading** ``physiomotion4d`` so that the
correct CUDA-enabled PyTorch and related wheels are selected. Using plain ``pip``
(especially without ``--no-deps``) may reinstall a CPU-only PyTorch wheel and break
GPU support.

Copilot uses AI. Check for mistakes.
Comment on lines +59 to +63
nvidia-smi # shows driver and CUDA version

.. note::
CPU-only installation is not supported. A CUDA-capable NVIDIA GPU is required.

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The new note says CPU-only installation is not supported, but earlier in this section you recommend switching processing to CPU to resolve CUDA OOM. Please clarify the distinction (e.g., CPU execution may be possible after a CUDA-enabled install, but installing/running on systems without NVIDIA/CUDA is unsupported) to avoid contradictory guidance.

Copilot uses AI. Check for mistakes.
docs/faq.rst Outdated
Comment on lines +42 to +51
CUDA 13 is the default. If your system has CUDA 12, install the ``[cuda12]`` extra
instead:

.. code-block:: bash

uv pip install "physiomotion4d[cuda12]"

The ``[cuda12]`` extra provides ``cupy-cuda12x>=12.0.0`` and sources PyTorch,
torchvision, and torchaudio from ``https://download.pytorch.org/whl/cu128``.
The default install provides ``cupy-cuda13x>=13.6.0``.
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This FAQ implies the [cuda12] extra is an alternative to the default CUDA 13 install. However, cupy-cuda13x is currently a required dependency, so physiomotion4d[cuda12] will install both CUDA 13 and CUDA 12 CuPy wheels. Either adjust the packaging to make the extras mutually exclusive, or update the wording here to avoid implying a replacement.

Suggested change
CUDA 13 is the default. If your system has CUDA 12, install the ``[cuda12]`` extra
instead:
.. code-block:: bash
uv pip install "physiomotion4d[cuda12]"
The ``[cuda12]`` extra provides ``cupy-cuda12x>=12.0.0`` and sources PyTorch,
torchvision, and torchaudio from ``https://download.pytorch.org/whl/cu128``.
The default install provides ``cupy-cuda13x>=13.6.0``.
CUDA 13 is the default and ``cupy-cuda13x>=13.6.0`` is always installed.
If your system has CUDA 12 and you also need CUDA 12 support, you can add the
``[cuda12]`` extra:
.. code-block:: bash
uv pip install "physiomotion4d[cuda12]"
The ``[cuda12]`` extra additionally provides ``cupy-cuda12x>=12.0.0`` and sources
PyTorch, torchvision, and torchaudio from
``https://download.pytorch.org/whl/cu128``.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/installation.rst`:
- Around line 65-66: The README/doc step uses the wrong directory casing: after
running the git clone command shown ("git clone
https://github.com/Project-MONAI/physiomotion4d.git") the cloned folder is
"physiomotion4d", so update the install step that currently says "cd
PhysioMotion4D" to use the actual directory name "cd physiomotion4d" (match the
lowercase repo name) so the command works on case-sensitive filesystems; update
the line in docs/installation.rst accordingly.

In `@pyproject.toml`:
- Around line 117-119: Base dependencies include "cupy-cuda13x" while the extras
group "cuda12" adds "cupy-cuda12x", causing both CuPy CUDA variants to be
installed; make them mutually exclusive by removing "cupy-cuda13x" from the base
dependency list and instead put it into a new extras group (e.g., "cuda13") or
conditionally include it only when "cuda13" is selected; update the
pyproject.toml so the base dependencies no longer reference "cupy-cuda13x" and
ensure extras groups "cuda12" and the new "cuda13" contain "cupy-cuda12x" and
"cupy-cuda13x" respectively to avoid installing both variants simultaneously.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 03906716-ee26-4f4a-b94a-5eb1d1c4e1a9

📥 Commits

Reviewing files that changed from the base of the PR and between ad76a05 and 4ec5d46.

📒 Files selected for processing (11)
  • README.md
  • docs/changelog.rst
  • docs/conf.py
  • docs/contributing.rst
  • docs/faq.rst
  • docs/index.rst
  • docs/installation.rst
  • docs/quickstart.rst
  • docs/references.rst
  • docs/troubleshooting.rst
  • pyproject.toml

aylward added 2 commits April 1, 2026 10:03
uv requires that any package with extra = "cuda12" in [tool.uv.sources] must also appear in that extra's
[project.optional-dependencies] list.
Moves cupy-cuda13x into a cuda13 extra (symmetric with cuda12) so neither CUDA variant is silently installed by a bare pip install. Adds an import-time check in __init__.py that raises a clear error directing users to install one of the two extras. Updates all docs and README to show explicit [cuda13] install commands.
Copilot AI review requested due to automatic review settings April 1, 2026 14:45
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
README.md (1)

37-47: Inconsistent package manager: uv pip vs pip.

Lines 38 and 41 use uv pip install for the CUDA extras, but line 46 still uses plain pip install for the NIM extra. This inconsistency may confuse users about which tool to use.

Suggested fix for consistency
 For development with NVIDIA NIM cloud services:
 ```bash
-pip install physiomotion4d[nim]
+uv pip install "physiomotion4d[nim]"
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @README.md around lines 37 - 47, Replace the inconsistent plain pip
invocation for the NIM extra with the same "uv pip" form used for the CUDA
extras: change the line that installs "physiomotion4d[nim]" to use uv pip
install "physiomotion4d[nim]" so all examples consistently show the uv wrapper
(look for the literal strings "physiomotion4d[nim]" and the existing "uv pip
install" examples for CUDA to locate the spot to update).


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @README.md:

  • Around line 37-47: Replace the inconsistent plain pip invocation for the NIM
    extra with the same "uv pip" form used for the CUDA extras: change the line that
    installs "physiomotion4d[nim]" to use uv pip install "physiomotion4d[nim]" so
    all examples consistently show the uv wrapper (look for the literal strings
    "physiomotion4d[nim]" and the existing "uv pip install" examples for CUDA to
    locate the spot to update).

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Organization UI

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `430a728e-e75f-4155-8ce6-b25072f38b89`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between d07d2b0fb19c2dd2ad44e80c31e75bfecb16456e and a4682b255fe5dd3a89c77319551e6ec28c3e8141.

</details>

<details>
<summary>📒 Files selected for processing (6)</summary>

* `README.md`
* `docs/faq.rst`
* `docs/installation.rst`
* `docs/troubleshooting.rst`
* `pyproject.toml`
* `src/physiomotion4d/__init__.py`

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* docs/troubleshooting.rst

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* docs/faq.rst
* pyproject.toml
* docs/installation.rst

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

docs/installation.rst:55

  • This NIM installation command (pip install physiomotion4d[nim]) does not include either CUDA extra, so it won’t install CuPy and will fail at import physiomotion4d due to the new import-time CuPy requirement. Consider updating it to require one of [cuda13,nim] / [cuda12,nim] (and/or use uv pip to ensure the CUDA-enabled PyTorch wheels are selected).
For development with NVIDIA NIM cloud services:

.. code-block:: bash

   pip install physiomotion4d[nim]


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 115 to +124
[project.optional-dependencies]
cuda13 = [
"cupy-cuda13x>=13.6.0",
]
cuda12 = [
"cupy-cuda12x>=12.0.0",
"torch>=2.0.0,<3.0.0",
"torchvision",
"torchaudio",
]
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

physiomotion4d now hard-requires cupy at import time (see __init__.py), but cupy-cuda13x is no longer in the base dependencies list (it’s only in the cuda13 extra). This means a plain pip install physiomotion4d / uv pip install physiomotion4d will install successfully but immediately fail on import physiomotion4d. If CUDA 13 is meant to be the default install, add cupy-cuda13x back to core dependencies (and keep cuda12 as an override), or otherwise relax/move the CuPy import check so the base install remains usable.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
" uv pip install 'physiomotion4d[cuda13]' # CUDA 13 (recommended)\n"
" uv pip install 'physiomotion4d[cuda12]' # CUDA 12\n\n"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The import-time error message uses single quotes around the install commands (uv pip install 'physiomotion4d[cuda13]'). Elsewhere in the docs/README the commands use double quotes; aligning to double quotes avoids shell-quoting pitfalls (notably on Windows) and keeps the guidance consistent.

Suggested change
" uv pip install 'physiomotion4d[cuda13]' # CUDA 13 (recommended)\n"
" uv pip install 'physiomotion4d[cuda12]' # CUDA 12\n\n"
' uv pip install "physiomotion4d[cuda13]" # CUDA 13 (recommended)\n'
' uv pip install "physiomotion4d[cuda12]" # CUDA 12\n\n'

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +41
# CUDA 13 install (recommended)
uv pip install "physiomotion4d[cuda13]"

# CUDA 12 install
uv pip install "physiomotion4d[cuda12]"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The CUDA install commands were updated to use uv + [cuda13]/[cuda12], but the NIM install snippet right below still uses pip install physiomotion4d[nim], which won’t pull in CuPy and will fail at import physiomotion4d given the new import-time CuPy requirement. Update the NIM instructions to include a CUDA extra as well (and preferably use uv pip consistently), e.g. [cuda13,nim] or [cuda12,nim].

Copilot uses AI. Check for mistakes.
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.

2 participants