Skip to content

[Test] Refactor test_profiler.py tests to enhance device compatibility[4/N] - #198323

Closed
can-gaa-hou wants to merge 4 commits into
gh/can-gaa-hou/54/basefrom
gh/can-gaa-hou/54/head
Closed

can-gaa-hou wants to merge 4 commits into
gh/can-gaa-hou/54/basefrom
gh/can-gaa-hou/54/head

Conversation

[ghstack-poisoned]
@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Sep 23, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 749e7cb with merge base ecc974c (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:

  • pull / dynamo-cpython-test / test (dynamo_cpython, 1, 1, mt-l-x86iavx512-8-64) (gh)
    test/cpython/v3_13/test_call.py::CFunctionCallsErrorMessages::test_varargs2min

    AI verdict: AI verdict: not related

    The suspect commit changes only test/profiler/test_profiler.py, and nothing in it touches Dynamo or the CPython test suite. The failure is an "Unexpected success" for a Dynamo expected-failure marker. The PR's merge base shows the same failure: its log has "FAILED CONSISTENTLY" for test_varargs2min plus test_varargs6_kw in the same class. The later trunk commits are green, which points to a fix that landed on trunk after this PR branched.

    Full reasoning on HUD →

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

[ghstack-poisoned]
[ghstack-poisoned]
Comment thread test/profiler/test_profiler.py Outdated
Comment on lines +3596 to +3597
def _device_activities(self):
return get_profiler_activities(self.device_type)

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.

Delete this one

Comment thread test/profiler/test_profiler.py Outdated
def _make_profiler(self, **schedule_kwargs):
return profile(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
activities=self._device_activities(),

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.

Suggested change
activities=self._device_activities(),
activities=get_profiler_activities(device),

Comment thread test/profiler/test_profiler.py Outdated
def _device_activities(self):
return get_profiler_activities(self.device_type)

def _make_profiler(self, **schedule_kwargs):

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.

Suggested change
def _make_profiler(self, **schedule_kwargs):
def _make_profiler(self, device, **schedule_kwargs):

Comment thread test/profiler/test_profiler.py Outdated

def test_enters_device_stopped_from_warmup(self):
def test_enters_device_stopped_from_warmup(self, device):
p = self._make_profiler(wait=0, warmup=2, active=2)

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.

Suggested change
p = self._make_profiler(wait=0, warmup=2, active=2)
p = self._make_profiler(device, wait=0, warmup=2, active=2)

Comment thread test/profiler/test_profiler.py Outdated

def test_enters_device_stopped_from_record(self):
def test_enters_device_stopped_from_record(self, device):
p = self._make_profiler(wait=0, warmup=1, active=3)

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.

ditto

Comment thread test/profiler/test_profiler.py Outdated

p = profile(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
activities=self._device_activities(),

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.

Suggested change
activities=self._device_activities(),
activities=get_profiler_activities(device),

Comment thread test/profiler/test_profiler.py Outdated
p._transit_action(prev, ProfilerAction.DEVICE_STOPPED)

def test_cpu_only_profiler_ignores_stale_is_kineto_stopped(self):
def test_cpu_only_profiler_ignores_stale_is_kineto_stopped(self, device):

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.

This one should be GENERIC

@fffrog fffrog moved this from Backlog to Ready for Merge in PyTorch Test Refactoring Sep 23, 2026
@fffrog fffrog moved this from Ready for Merge to Ready for Review(Initial) in PyTorch Test Refactoring Sep 23, 2026
@fffrog fffrog moved this from Ready for Review(Initial) to Developing in PyTorch Test Refactoring Sep 23, 2026
@fffrog fffrog added the module: tests/simple This label covers all the testcase that are very straightforward label Sep 23, 2026
[ghstack-poisoned]
@fffrog fffrog moved this from Developing to Ready for Merge in PyTorch Test Refactoring Sep 23, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #198324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: tests/simple This label covers all the testcase that are very straightforward open source topic: not user facing topic category

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants