Repository navigation
[Test] Refactor test_profiler.py tests to enhance device compatibility[4/N] - #198323
can-gaa-hou wants to merge 4 commits into
Conversation
🔗 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 ( 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:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| def _device_activities(self): | ||
| return get_profiler_activities(self.device_type) |
| def _make_profiler(self, **schedule_kwargs): | ||
| return profile( | ||
| activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA], | ||
| activities=self._device_activities(), |
There was a problem hiding this comment.
| activities=self._device_activities(), | |
| activities=get_profiler_activities(device), |
| def _device_activities(self): | ||
| return get_profiler_activities(self.device_type) | ||
|
|
||
| def _make_profiler(self, **schedule_kwargs): |
There was a problem hiding this comment.
| def _make_profiler(self, **schedule_kwargs): | |
| def _make_profiler(self, device, **schedule_kwargs): |
|
|
||
| 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) |
There was a problem hiding this comment.
| p = self._make_profiler(wait=0, warmup=2, active=2) | |
| p = self._make_profiler(device, wait=0, warmup=2, active=2) |
|
|
||
| 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) |
|
|
||
| p = profile( | ||
| activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA], | ||
| activities=self._device_activities(), |
There was a problem hiding this comment.
| activities=self._device_activities(), | |
| activities=get_profiler_activities(device), |
| 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): |
There was a problem hiding this comment.
This one should be GENERIC
|
Starting merge as part of PR stack under #198324 |
Stack from ghstack (oldest at bottom):