Skip to content

[CI] Add green-context tests to B200 smoke coverage - #199593

Closed
tinglvv wants to merge 5 commits into
gh/tinglvv/1/basefrom
gh/tinglvv/1/head
Closed

tinglvv wants to merge 5 commits into
gh/tinglvv/1/basefrom
gh/tinglvv/1/head

Conversation

@tinglvv

@tinglvv tinglvv commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

I want B200 smoke coverage to exercise the green-context tests.

Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
Test Plan:

bash -n .ci/pytorch/test.sh
git diff --check lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh ```
Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

TODO:
Follow up with arm cuda-compat and validate on GB300 once they are available.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 471b400 with merge base 2eb7361 (image):

NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following job failed, but the AI CI Advisor judged the failure not to be evidence against this change:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@tinglvv
tinglvv marked this pull request as ready for review October 2, 2026 23:23
@tinglvv
tinglvv requested a review from a team as a code owner October 2, 2026 23:23

@eqy eqy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems to get the job done but not sure this is how the other tests were included?

@nWEIdia

nWEIdia commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

The change looks good, though as claude mentioned (#199127 (comment)) it depends on host driver version to fully exercise the test

test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_invalid_visibility_visible_GPU-invalid_cuda SKIPPED [0.0010s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 10%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_invalid_visibility_visible__cuda SKIPPED [0.0008s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 13%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_nvml_visibility_ordinal_cuda SKIPPED [0.0008s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 17%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_nvml_visibility_partial_uuid_cuda SKIPPED [0.0008s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 20%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_nvml_visibility_unknown_cuda SKIPPED [0.0008s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 24%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_locality_nvml_visibility_uuid_cuda SKIPPED [0.0016s] (Locality domains require CUDA driver and cuda.bindings 13.4+) [ 27%]

In fact the B200 runners host driver is 13.0, some other tests required cuda 13.1+ driver and also skipped.
Suggest holding off this PR until after the host driver has been updated.

test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_broadcasts_scalars_options0_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 51%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_broadcasts_scalars_options1_cuda SKIPPED [0.0009s] (SM splitting requires CUDA driver 13.1+) [ 55%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_broadcasts_scalars_options2_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 58%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_discovery_backfill_False_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 62%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_discovery_backfill_True_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 65%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs0_message_at least one_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 68%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs1_message_nonnegative integers_cuda SKIPPED [0.0009s] (SM splitting requires CUDA driver 13.1+) [ 72%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs2_message_same length_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 75%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs3_message_at least one_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 79%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs4_message_nonnegative integers_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 82%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs5_message_nonnegative integers_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 86%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs6_message_bool_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 89%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs7_message_Split group 0_*Only the last group_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+) [ 93%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_invalid_arguments_kwargs8_message_Split group 1_*Only the last group_cuda SKIPPED [0.0008s] (SM splitting requires CUDA driver 13.1+)

Look https://hud.pytorch.org/pytorch/pytorch/pull/199593 for artifacts.

[ghstack-poisoned]
tinglvv added a commit that referenced this pull request Oct 3, 2026
I want B200 smoke coverage to exercise the green-context tests.

> Authored with an AI assistant.
>
> Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
>
> Test Plan:
> ```bash
> bash -n .ci/pytorch/test.sh
> git diff --check
> lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh
> ```
> Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

ghstack-source-id: d216aef
Pull-Request: #199593
@tinglvv

tinglvv commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the comment. Trying a container-side alternative: use cuda-compat-13-4 to provide a newer driver library

[ghstack-poisoned]
tinglvv added a commit that referenced this pull request Oct 5, 2026
I want B200 smoke coverage to exercise the green-context tests.

> Authored with an AI assistant.
>
> Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
>
> Test Plan:
> ```bash
> bash -n .ci/pytorch/test.sh
> git diff --check
> lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh
> ```
> Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

ghstack-source-id: ba59f72
Pull-Request: #199593
[ghstack-poisoned]
tinglvv added a commit that referenced this pull request Oct 7, 2026
I want B200 smoke coverage to exercise the green-context tests.

> Authored with an AI assistant.
>
> Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
>
> Test Plan:
> ```bash
> bash -n .ci/pytorch/test.sh
> git diff --check
> lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh
> ```
> Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

ghstack-source-id: 40dfd66
Pull-Request: #199593
@tinglvv

tinglvv commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

cuda-compat was downloaded, checksum-verified, extracted, and activated through LD_LIBRARY_PATH.
The final CUDA driver API version: 13040 confirms the Python process sees CUDA 13.4 driver API support

2026-10-08T00:41:36.3327870Z + export LD_LIBRARY_PATH=/tmp/tmp.350s6iScku/usr/local/cuda-13.4/compat
2026-10-08T00:41:36.3329102Z + LD_LIBRARY_PATH=/tmp/tmp.350s6iScku/usr/local/cuda-13.4/compat
2026-10-08T00:41:36.3329626Z + cd test
2026-10-08T00:41:36.3329908Z + python -
2026-10-08T00:41:39.5345461Z CUDA driver API version: 13040

Artifacts from latest run https://gha-artifacts.s3.amazonaws.com/pytorch/pytorch/37694837843/1/artifact/logs-test-smoke_b200-1-1-linux.dgx.b200_113069042582.zip
in https://hud.pytorch.org/pytorch/pytorch/pull/199593?sha=834270892cfd95aaaf46fb0e2ab0b2b3f223530d shows that green context tests are executed and passing.

test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_workqueue_scope0_cuda PASSED [0.0196s] [ 71%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_workqueue_scope_balanced_cuda PASSED [0.0200s] [ 78%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_split_workqueue_scope_device_ctx_cuda PASSED [0.0199s] [ 85%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_stream_carveout_cuda PASSED [0.0074s] [ 92%]
test_cuda.py::TestCudaGreenContextsCUDA::test_greencontext_workqueue_concurrency_limit_cuda PASSED [0.2581s] [100%]

Resolve the lint error and we should be good to land.

[ghstack-poisoned]
tinglvv added a commit that referenced this pull request Oct 8, 2026
I want B200 smoke coverage to exercise the green-context tests.

> Authored with an AI assistant.
>
> Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
>
> Test Plan:
> ```bash
> bash -n .ci/pytorch/test.sh
> git diff --check
> lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh
> ```
> Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

ghstack-source-id: e9564a7
Pull-Request: #199593
@tinglvv

tinglvv commented Oct 9, 2026

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 9, 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

@nWEIdia nWEIdia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Glad that cuda-compat setup worked.

Comment thread .ci/pytorch/test.sh
local compat_dir compat_package compat_sha256
compat_dir=$(mktemp -d)
trap 'rm -rf "$compat_dir"' EXIT
compat_package=cuda-compat-13-4_615.71.09-2ubuntu1_amd64.deb

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oops, this may interfere with the other high priority work.

This would break on GB300 due to the assumption that GB300 would not reuse these test, but they do!

Would you be able to follow up with a generic b200_smoke_ test that would work fine with both B200 and GB300?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out! Would follow up with the os-neutral generic b200_smoke_test once we have the GB300 online.

@nWEIdia nWEIdia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since we don't have GB300 yet, this PR's merge won't manifest an issue.

In fact we are enabling GB300 workflow, starting from CUDA 13.2.
When GB300 moves on to CUDA 13.4, this would then need to be addressed. Not a blocker for this PR.

@tinglvv tinglvv added the topic: not user facing topic category label Oct 9, 2026
@tinglvv

tinglvv commented Oct 9, 2026

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
I want B200 smoke coverage to exercise the green-context tests.

Add targeted green-context and localized-allocator coverage. For CUDA 13.4 jobs with older drivers, stage checksum-verified CUDA 13.4 compatibility libraries for this invocation. Require bindings 13.4+ and fail if locality support is unavailable.
Test Plan:
 ```bash
 bash -n .ci/pytorch/test.sh
git diff --check lintrunner -a --take SHELLCHECK,NEWLINE,SPACES,TABS .ci/pytorch/test.sh ```
 Verified the package checksum and library layout. Five mocked setup/failure cases passed. GPU validation remains for B200 CI.

TODO:
Follow up with arm cuda-compat and validate on GB300 once they are available.
Pull Request resolved: pytorch#199593
Approved by: https://github.com/eqy, https://github.com/nWEIdia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/b200 ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants