Skip to content

Conversation

@mergennachin
Copy link
Contributor

Reviewed By: rascani

Differential Revision: D90888544

Copilot AI review requested due to automatic review settings January 16, 2026 21:35
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 16, 2026

🔗 Helpful Links

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

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

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 16, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 16, 2026

@mergennachin has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90888544.

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

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

@mergennachin mergennachin requested a review from rascani January 16, 2026 21:38
Copy link
Contributor

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 addresses test stability issues by adding threadpool configuration to prevent OMP errors and updating CUDA test requirements to specify minimum compute capability.

Changes:

  • Added compute capability check for CUDA/Triton tests requiring CC >= 9.0
  • Integrated threadpool reset workaround in test_sdpa_with_kv_cache.py to prevent OMP errors
  • Updated TARGETS dependency to include portable_lib for test_sdpa_with_kv_cache

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
extension/llm/custom_ops/test_update_cross_attn_cache.py Added CUDA compute capability check (CC >= 9.0) for Triton-based tests
extension/llm/custom_ops/test_sdpa_with_kv_cache.py Added _unsafe_reset_threadpool call to prevent OMP threading errors
extension/llm/custom_ops/TARGETS Added portable_lib dependency for test_sdpa_with_kv_cache to support threadpool import

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

],
deps = [
"//caffe2:torch",
"//executorch/extension/pybindings:portable_lib",
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The TARGETS file is missing a corresponding dependency update for test_update_cross_attn_cache. While test_update_cross_attn_cache.py doesn't currently use _unsafe_reset_threadpool, the file is importing from the same module family and may benefit from the same OMP error workaround that was applied to test_sdpa_with_kv_cache and test_quantized_sdpa. Consider adding the dependency if similar threading issues arise in the future.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 16, 2026 23:42
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 16, 2026

@mergennachin has imported this pull request. If you are a Meta employee, you can view this in D90888544.

Copy link
Contributor

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 3 out of 3 changed files in this pull request and generated no new comments.


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

mergennachin added a commit to mergennachin/executorch-1 that referenced this pull request Jan 17, 2026
Differential Revision: D90888544

Pulled By: mergennachin
Differential Revision: D90888544

Pulled By: mergennachin
Copilot AI review requested due to automatic review settings January 20, 2026 18:04
Copy link
Contributor

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 3 out of 3 changed files in this pull request and generated 1 comment.


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


# Check if CUDA device has compatible compute capability for Triton kernels
# Minimum CC 9.0 (Hopper) required for current PyTorch/Triton build
CUDA_CC_COMPATIBLE = CUDA_AVAILABLE and torch.cuda.get_device_capability()[0] >= 9
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The compute capability check may raise an IndexError when CUDA is available but no GPU device is present. Consider adding a device count check or wrapping in a try-except block. For example, the condition should handle the case where torch.cuda.device_count() is 0.

Suggested change
CUDA_CC_COMPATIBLE = CUDA_AVAILABLE and torch.cuda.get_device_capability()[0] >= 9
CUDA_CC_COMPATIBLE = (
CUDA_AVAILABLE
and torch.cuda.device_count() > 0
and torch.cuda.get_device_capability()[0] >= 9
)

Copilot uses AI. Check for mistakes.
@mergennachin mergennachin merged commit e53613f into pytorch:main Jan 20, 2026
260 of 272 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants