Skip to content

[CUDA] Document NVML-based localization support query limitations w.r.t. MPS - #199130

Closed
MatthiasKohl wants to merge 13 commits into
gh/MatthiasKohl/4/basefrom
gh/MatthiasKohl/4/head
Closed

MatthiasKohl wants to merge 13 commits into
gh/MatthiasKohl/4/basefrom
gh/MatthiasKohl/4/head

Conversation

@MatthiasKohl

@MatthiasKohl MatthiasKohl commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

Authored with an AI assistant.

The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v

). This stack adds:

1. convenience functions to allocate localized memory
2. convenience function to execute operations in several green contexts through the fork/join pattern
3. minor fixes to green contexts discovered during testing of localized workloads

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199130

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 2 Pending

As of commit 1e51a57 with merge base d0b8bbb (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

MatthiasKohl added a commit that referenced this pull request Sep 30, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```


ghstack-source-id: 5a958bb
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Sep 30, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```


ghstack-source-id: fa507bb
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Sep 30, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```


ghstack-source-id: 644b712
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Sep 30, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 7dc46dd
Pull-Request: #199130
@MatthiasKohl
MatthiasKohl marked this pull request as ready for review September 30, 2026 10:36
@MatthiasKohl
MatthiasKohl requested a review from ngimel September 30, 2026 10:36
MatthiasKohl added a commit that referenced this pull request Oct 2, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 4a7ffcc
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Oct 2, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 2ab0c31
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Oct 2, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 555e1a3
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Oct 2, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 94fe199
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Oct 5, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 098e0a2
Pull-Request: #199130
> AI-assisted: map-style stream execution, localized-output docs, trim redundant tests.

[ghstack-poisoned]
MatthiasKohl added a commit that referenced this pull request Oct 7, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 80cb1d4
Pull-Request: #199130
MatthiasKohl added a commit that referenced this pull request Oct 7, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: 50c0f5b
Pull-Request: #199130
@MatthiasKohl

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 8, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@MatthiasKohl MatthiasKohl added the release notes: cuda release notes category label Oct 8, 2026
MatthiasKohl added a commit that referenced this pull request Oct 8, 2026
….t. MPS

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```

ghstack-source-id: fac597c
Pull-Request: #199130
@MatthiasKohl

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
….t. MPS (pytorch#199130)

Improve documentation of the NVML based check for locality support: later attachment to MPS isn't supported.

> Authored with an AI assistant.
>
> The limitation concerns the pre-initialization NVML estimate. Already attached clients use the CUDA driver path; query again after attachment rather than reusing an earlier estimate. These regression tests do not test dynamic MPS attachment.

Test Plan

Tested on Rubin with driver R610 + CUDA 13.4 compat.
All 10 existing locality-query regression tests passed.

```sh
python test/test_cuda.py TestCudaGreenContextsCUDA -k locality -v
```
Pull Request resolved: pytorch#199130
Approved by: https://github.com/ngimel
ghstack dependencies: pytorch#199127, pytorch#199128, pytorch#199129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: cuda release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants