Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/182434
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit df17628 with merge base 019cea9 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…ice-agnostic profiler tests Add imports for instantiate_device_type_tests and onlyAccelerator from common_device_type. Add _get_device_target_cats() helper for device-aware Kineto event category names. Create TestProfilerDeviceType class with 3 tests moved from TestProfiler (test_event_list, test_profile_all_threads, test_kineto_kernel_metadata_in_trace) that are parameterized with @onlyAccelerator and a device argument. Apply instantiate_device_type_tests for all accelerator devices. Split TestProfilerEventsParity into CPU-only tests (3 tests stay) and TestProfilerEventsParityDeviceType (5 tests with @onlyAccelerator): test_profiler_flow_events_parity, test_profiler_timestamp_consistency, test_profiler_external_id_parity, test_profiler_activity_type_parity, test_structured_metadata_matches_chrome_trace. Replace hardcoded device="cuda", ProfilerActivity.CUDA, and torch.cuda.synchronize() with device-agnostic equivalents in all 8 parameterized tests. [ghstack-poisoned]
…est_profiler Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. Infrastructure: get_profiler_activities() helper, @onlyAccelerator decorator for GPU-required tests. Moved tests: test_kineto, test_memory_profiler, test_flops, test_kineto_profiler_api, test_kineto_profiler_multiple_steppers, test_tensorboard_trace_handler, test_kineto_profiler_with_environment_variable, test_event_list, test_basic_chrome_trace, test_cpu_annotation_overlap, test_user_annotation, test_basic_profile, test_dynamic_toggle, test_forked_process, test_profile_all_threads, test_profiler, test_activity_filter_dict_syntax, test_activity_filter_nonmember_type_name, test_activity_filter_empty_list, test_kineto_kernel_metadata_in_trace. Note: test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions. ghstack-source-id: 6e12888 Pull Request resolved: #182434
…sts in test_profiler"
## Summary
Apply `onlyAccelerator` and `instantiate_device_type_tests` to profiler tests that should run on any accelerator (CUDA, XPU, HPU, etc.), not just CUDA.
**Changes:**
- Add `_get_device_target_cats(device_type)` helper for device-aware Kineto event category names
- Create `TestProfilerDeviceType` class with 3 tests moved from `TestProfiler`:
- test_event_list
- test_profile_all_threads
- test_kineto_kernel_metadata_in_trace
- Split `TestProfilerEventsParity` into:
- `TestProfilerEventsParity` (3 CPU-only tests stay)
- `TestProfilerEventsParityDeviceType` (5 device-parameterized tests):
- test_profiler_flow_events_parity
- test_profiler_timestamp_consistency
- test_profiler_external_id_parity
- test_profiler_activity_type_parity
- test_structured_metadata_matches_chrome_trace
- Replace hardcoded `device="cuda"`, `ProfilerActivity.CUDA`, `torch.cuda.synchronize()` with device-agnostic equivalents in all 8 parameterized tests
- Apply `instantiate_device_type_tests` to both new DeviceType classes
## Test plan
- [x] Verified on CUDA : 110 passed, 2 skipped, 0 failures
cc: albanD fffrog mansiag05
[ghstack-poisoned]
…est_profiler Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. Infrastructure: get_profiler_activities() helper, @onlyAccelerator decorator for GPU-required tests. Moved tests: test_kineto, test_memory_profiler, test_flops, test_kineto_profiler_api, test_kineto_profiler_multiple_steppers, test_tensorboard_trace_handler, test_kineto_profiler_with_environment_variable, test_event_list, test_basic_chrome_trace, test_cpu_annotation_overlap, test_user_annotation, test_basic_profile, test_dynamic_toggle, test_forked_process, test_profile_all_threads, test_profiler, test_activity_filter_dict_syntax, test_activity_filter_nonmember_type_name, test_activity_filter_empty_list, test_kineto_kernel_metadata_in_trace. Note: test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions. ghstack-source-id: 6676c91 Pull Request resolved: #182434
…_tests in test_profiler" ## Summary Create `TestProfilerDevice` class with 20 tests moved from `TestProfiler`, refactored to be device-agnostic using `instantiate_device_type_tests`. **Infrastructure added:** - `get_profiler_activities(device_type)` helper that dynamically builds the `ProfilerActivity` list - `onlyAccelerator` decorator for GPU-required tests - `instantiate_device_type_tests(TestProfilerDevice, globals())` **Moved and refactored tests:** - `test_kineto` — device-agnostic profiling with CUDA/ROCm kernel checks guarded - `test_memory_profiler` — conditional device memory checks - `test_flops` — device-agnostic activity list - `test_kineto_profiler_api` — multi-backend profiler API - `test_kineto_profiler_multiple_steppers` — step tracking across backends - `test_tensorboard_trace_handler` — device-agnostic trace export - `test_kineto_profiler_with_environment_variable` — subprocess self-detects device - `test_event_list` — `onlyAccelerator` - `test_basic_chrome_trace` — device-aware Chrome trace validation - `test_cpu_annotation_overlap` — device-agnostic activity list - `test_user_annotation` — simple device param - `test_basic_profile` — `onlyAccelerator` - `test_dynamic_toggle` — `onlyAccelerator` - `test_forked_process` — skips on CUDA/XPU due to fork-after-init - `test_profile_all_threads` — `onlyAccelerator` - `test_profiler` — device-agnostic with PrivateUse1 fallback - `test_activity_filter_dict_syntax` — `onlyAccelerator` - `test_activity_filter_nonmember_type_name` — `onlyAccelerator` - `test_activity_filter_empty_list` — `onlyAccelerator` - `test_kineto_kernel_metadata_in_trace` — `onlyAccelerator` **Note:** `test_kineto_profiler_with_environment_variable` self-detects the available device in its subprocess script. `test_forked_process` skips on CUDA/XPU due to fork-after-init restrictions. ## Test plan - Verified on CUDA: 111 passed, 11 skipped, 0 failures cc: albanD fffrog mansiag05 [ghstack-poisoned]
…est_profiler Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. Infrastructure added: get_profiler_activities(device_type) helper, @onlyAccelerator decorator for GPU-required tests, @OnlyOn(["cpu", "cuda"]) for tests with CUDA-specific assertions (test_kineto, test_kineto_profiler_with_environment_variable, test_activity_filter_dict_syntax, test_kineto_kernel_metadata_in_trace). ghstack-source-id: 49d131e Pull Request resolved: #182434
…_tests in test_profiler" ## Summary Create `TestProfilerDevice` class with 20 tests moved from `TestProfiler`, refactored to be device-agnostic using `instantiate_device_type_tests`. **Infrastructure added:** - `get_profiler_activities(device_type)` helper that dynamically builds the `ProfilerActivity` list - `onlyAccelerator` decorator for GPU-required tests - `instantiate_device_type_tests(TestProfilerDevice, globals())` **Moved and refactored tests:** - `test_kineto` — device-agnostic profiling with CUDA/ROCm kernel checks guarded - `test_memory_profiler` — conditional device memory checks - `test_flops` — device-agnostic activity list - `test_kineto_profiler_api` — multi-backend profiler API - `test_kineto_profiler_multiple_steppers` — step tracking across backends - `test_tensorboard_trace_handler` — device-agnostic trace export - `test_kineto_profiler_with_environment_variable` — subprocess self-detects device - `test_event_list` — `onlyAccelerator` - `test_basic_chrome_trace` — device-aware Chrome trace validation - `test_cpu_annotation_overlap` — device-agnostic activity list - `test_user_annotation` — simple device param - `test_basic_profile` — `onlyAccelerator` - `test_dynamic_toggle` — `onlyAccelerator` - `test_forked_process` — skips on CUDA/XPU due to fork-after-init - `test_profile_all_threads` — `onlyAccelerator` - `test_profiler` — device-agnostic with PrivateUse1 fallback - `test_activity_filter_dict_syntax` — `onlyAccelerator` - `test_activity_filter_nonmember_type_name` — `onlyAccelerator` - `test_activity_filter_empty_list` — `onlyAccelerator` - `test_kineto_kernel_metadata_in_trace` — `onlyAccelerator` **Note:** `test_kineto_profiler_with_environment_variable` self-detects the available device in its subprocess script. `test_forked_process` skips on CUDA/XPU due to fork-after-init restrictions. ## Test plan - Verified on CUDA: 111 passed, 11 skipped, 0 failures cc: albanD fffrog mansiag05 [ghstack-poisoned]
|
Claude finished @jansel's task in 1m 52s —— View job CI Failure Analysis
No, the 3 failures are not related to each other. Two share the same root cause (infrastructure), and one is a Windows-specific test issue that is related to this PR. 1.
|
| Failure | Related to PR? | Action needed? |
|---|---|---|
| linux-docs (x2) | No — infra issue (aws CLI missing) |
None |
| win-vs2022 test | Indirectly — PR surfaced a pre-existing Windows PermissionError in export_chrome_trace with gzip mode |
May need a skipIfWindows or fix the underlying tempfile handling |
…est_profiler Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. Infrastructure added: get_profiler_activities(device_type) helper, @onlyAccelerator decorator for GPU-required tests, @OnlyOn(["cpu", "cuda"]) for tests with CUDA-specific assertions (test_kineto, test_kineto_profiler_with_environment_variable, test_activity_filter_dict_syntax, test_kineto_kernel_metadata_in_trace). ghstack-source-id: 0b4c13f Pull Request resolved: #182434
…_tests in test_profiler" **Summary** Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. **Infrastructure added:** - get_profiler_activities(device_type) helper that dynamically builds the ProfilerActivity list - onlyAccelerator decorator for GPU-required tests - onlyOn(["cpu", "cuda"]) for tests with CUDA-specific assertions - instantiate_device_type_tests(TestProfilerDevice, globals()) **Moved and refactored tests:** - test_kineto — onlyOn(["cpu", "cuda"]), device-agnostic profiling with CUDA/ROCm kernel checks guarded - test_memory_profiler — conditional device memory checks - test_flops — device-agnostic activity list - test_kineto_profiler_api — multi-backend profiler API - test_kineto_profiler_multiple_steppers — step tracking across backends - test_tensorboard_trace_handler — device-agnostic trace export - test_kineto_profiler_with_environment_variable — onlyOn(["cpu", "cuda"]), subprocess self-detects device - test_event_list — onlyAccelerator - test_basic_chrome_trace — device-aware Chrome trace validation - test_cpu_annotation_overlap — device-agnostic activity list - test_user_annotation — simple device param - test_basic_profile — onlyAccelerator - test_dynamic_toggle — onlyAccelerator - test_forked_process — skips on CUDA/XPU due to fork-after-init - test_profile_all_threads — onlyAccelerator - test_profiler — device-agnostic with PrivateUse1 fallback - test_activity_filter_dict_syntax — onlyOn(["cpu", "cuda"]), onlyAccelerator - test_activity_filter_nonmember_type_name — onlyAccelerator - test_activity_filter_empty_list — onlyAccelerator - test_kineto_kernel_metadata_in_trace — onlyOn(["cpu", "cuda"]), onlyAccelerator **Note:** test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions. **Test plan** Verified on CUDA: 111 passed, 11 skipped, 0 failures cc: albanD fffrog mansiag05 [ghstack-poisoned]
done, updated in latest commit |
|
@claude explain those CI failures, are they related? |
|
Claude finished @jansel's task in 1m 27s —— View job CI Failure Analysis
The 2 failures are related to each other but NOT related to this PR's changes. They share the same root cause: a CI infrastructure issue.
|
jbschlosser
left a comment
There was a problem hiding this comment.
looks good if all tests are passing
|
@pytorchbot merge -i "unrelated failures" |
|
❌ 🤖 pytorchbot command failed: Try |
|
@pytorchbot merge -i |
|
This PR has pending changes requested. Please address the comments and update the PR before merging. |
Done, addressed them. |
|
@jansel The test failures have been fixed. Could you please re-review? |
|
@pytorchbot merge -f "linux-docs failures are infra issues (aws CLI missing), not related to PR changes" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: ## Problem `linux_xpu_pytorch.yml` has been red on `main`. The job builds PyTorch (`USE_XPU=1`) and runs `test/profiler/`. Two CPU-variant tests from the device-parametrized `TestProfilerDevice` (added in pytorch/pytorch#182434) fail and were never deselected for XPU, unlike CUDA/ROCm (#1429). ## What fails and why (verified on PVC with an XPU device present) - **`test_forked_process_cpu`** — `RuntimeError: Cannot re-initialize XPU in forked subprocess`. Independent of runtime XPU availability (it also fails with an XPU device present); already deselected on CUDA and ROCm. - **`test_basic_chrome_trace_cpu`** — `_validate_basic_json` indexes `traceEvents[-4]` expecting the `"PyTorch Profiler (0)"` event, but a `USE_XPU=1` build appends a second `"__xpu_profiler__ (0)"` instance to the trace, shifting that fixed offset. Caused by XPU being *built*, not by runtime availability. An upstream fix to locate the events by name instead of by offset is tracked separately; deselecting until it lands. ## Relationship to #1450 Orthogonal. #1450 fixes runtime XPU visibility (`umf`/`tcm` env sourcing); this PR fixes the two build-dependent test failures. Both are needed for the workflow to go green. Note: `test_kineto_profiler_with_environment_variable_cpu` is intentionally **not** deselected here — it passes once XPU is available at runtime (covered by #1450). Pull Request resolved: #1451 Reviewed By: scotts Differential Revision: D109839396 Pulled By: ryanzhang22 fbshipit-source-id: 7a865d27175a92f8fc0cf42d1e37b10d532a26db
…est_profiler (pytorch#182434) **Summary** Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. **Infrastructure added:** - get_profiler_activities(device_type) helper that dynamically builds the ProfilerActivity list - @onlyAccelerator decorator for GPU-required tests - @OnlyOn(["cpu", "cuda"]) for tests with CUDA-specific assertions - instantiate_device_type_tests(TestProfilerDevice, globals()) **Moved and refactored tests:** - test_kineto — @OnlyOn(["cpu", "cuda"]), device-agnostic profiling with CUDA/ROCm kernel checks guarded - test_memory_profiler — conditional device memory checks - test_flops — device-agnostic activity list - test_kineto_profiler_api — multi-backend profiler API - test_kineto_profiler_multiple_steppers — step tracking across backends - test_tensorboard_trace_handler — device-agnostic trace export - test_kineto_profiler_with_environment_variable — @OnlyOn(["cpu", "cuda"]), subprocess self-detects device - test_event_list — @onlyAccelerator - test_basic_chrome_trace — device-aware Chrome trace validation - test_cpu_annotation_overlap — device-agnostic activity list - test_user_annotation — simple device param - test_basic_profile — @onlyAccelerator - test_dynamic_toggle — @onlyAccelerator - test_forked_process — skips on CUDA/XPU due to fork-after-init - test_profile_all_threads — @onlyAccelerator - test_profiler — device-agnostic with PrivateUse1 fallback - test_activity_filter_dict_syntax — @OnlyOn(["cpu", "cuda"]), @onlyAccelerator - test_activity_filter_nonmember_type_name — @onlyAccelerator - test_activity_filter_empty_list — @onlyAccelerator - test_kineto_kernel_metadata_in_trace — @OnlyOn(["cpu", "cuda"]), @onlyAccelerator **Note:** test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions. **Test plan** Verified on CUDA: 111 passed, 11 skipped, 0 failures Pull Request resolved: pytorch#182434 Approved by: https://github.com/fffrog, https://github.com/jansel, https://github.com/jbschlosser ghstack dependencies: pytorch#182432, pytorch#182433
…est_profiler (pytorch#182434) **Summary** Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests. **Infrastructure added:** - get_profiler_activities(device_type) helper that dynamically builds the ProfilerActivity list - @onlyAccelerator decorator for GPU-required tests - @OnlyOn(["cpu", "cuda"]) for tests with CUDA-specific assertions - instantiate_device_type_tests(TestProfilerDevice, globals()) **Moved and refactored tests:** - test_kineto — @OnlyOn(["cpu", "cuda"]), device-agnostic profiling with CUDA/ROCm kernel checks guarded - test_memory_profiler — conditional device memory checks - test_flops — device-agnostic activity list - test_kineto_profiler_api — multi-backend profiler API - test_kineto_profiler_multiple_steppers — step tracking across backends - test_tensorboard_trace_handler — device-agnostic trace export - test_kineto_profiler_with_environment_variable — @OnlyOn(["cpu", "cuda"]), subprocess self-detects device - test_event_list — @onlyAccelerator - test_basic_chrome_trace — device-aware Chrome trace validation - test_cpu_annotation_overlap — device-agnostic activity list - test_user_annotation — simple device param - test_basic_profile — @onlyAccelerator - test_dynamic_toggle — @onlyAccelerator - test_forked_process — skips on CUDA/XPU due to fork-after-init - test_profile_all_threads — @onlyAccelerator - test_profiler — device-agnostic with PrivateUse1 fallback - test_activity_filter_dict_syntax — @OnlyOn(["cpu", "cuda"]), @onlyAccelerator - test_activity_filter_nonmember_type_name — @onlyAccelerator - test_activity_filter_empty_list — @onlyAccelerator - test_kineto_kernel_metadata_in_trace — @OnlyOn(["cpu", "cuda"]), @onlyAccelerator **Note:** test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions. **Test plan** Verified on CUDA: 111 passed, 11 skipped, 0 failures Pull Request resolved: pytorch#182434 Approved by: https://github.com/fffrog, https://github.com/jansel, https://github.com/jbschlosser ghstack dependencies: pytorch#182432, pytorch#182433
Stack from ghstack (oldest at bottom):
Summary
Create TestProfilerDevice class with 20 tests moved from TestProfiler, refactored to be device-agnostic using instantiate_device_type_tests.
Infrastructure added:
Moved and refactored tests:
Note: test_kineto_profiler_with_environment_variable self-detects the available device in its subprocess script. test_forked_process skips on CUDA/XPU due to fork-after-init restrictions.
Test plan
Verified on CUDA: 111 passed, 11 skipped, 0 failures
cc: @albanD @fffrog @mansiag05