Repository navigation
[Profiler] Fix a set of profiler tests - #186970
ryanzhang22 wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/186970
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3eec903 with merge base d2bb2b5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
dfa4620 to
d54590a
Compare
|
@ryanzhang22 has imported this pull request. If you are a Meta employee, you can view this in D108206446. |
|
@pytorchbot merge |
Merge startedYour 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 |
Summary: These should have been fixed in pytorch/pytorch#186970 Differential Revision: D108287028
A couple changes for pytorch/kineto#1429 and pytorch/kineto#1430: 1. Add `setUpModule` to make sure Kineto is created with CUDA support. pytorch#186036 recently changed the behavior to not initialize Kineto with GPU tracing if only CPU activities are requested, which is more correct behavior. However, this changes the behavior of the following code: ``` with profile(activities=[ProfilerActivity.CPU]) as prof: ... with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof: ... ``` Now Kineto is armed to only do CPU tracing. The issue is that Kineto is only registered once, so even though you added ProfilerActivity.CUDA in the second pass, the profiler still latches on to the CPU-only session, leading to no device-side activities being recorded. We need to find a more complete solution but to unblock the tests we can hack around it by forcing Kineto to instantiate with GPU-tracing before running any tests. 2. Clear KinetoStepTracker to make sure repeat runs with different activity types don't pollute `test_kineto_profiler_multiple_steppers`. 3. Make sure `test_forked_process` explicitly runs with CPU activities only. There are a few more failures due to test pollution, but I haven't tracked those down yet. Pull Request resolved: pytorch#186970 Approved by: https://github.com/scotts
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028
Summary: Pull Request resolved: #1432 These should have been fixed in pytorch/pytorch#186970 Reviewed By: scotts Differential Revision: D108287028 fbshipit-source-id: f1113f338f614429cd94f17b577c3db66f40925f
A couple changes for pytorch/kineto#1429 and pytorch/kineto#1430: 1. Add `setUpModule` to make sure Kineto is created with CUDA support. pytorch#186036 recently changed the behavior to not initialize Kineto with GPU tracing if only CPU activities are requested, which is more correct behavior. However, this changes the behavior of the following code: ``` with profile(activities=[ProfilerActivity.CPU]) as prof: ... with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof: ... ``` Now Kineto is armed to only do CPU tracing. The issue is that Kineto is only registered once, so even though you added ProfilerActivity.CUDA in the second pass, the profiler still latches on to the CPU-only session, leading to no device-side activities being recorded. We need to find a more complete solution but to unblock the tests we can hack around it by forcing Kineto to instantiate with GPU-tracing before running any tests. 2. Clear KinetoStepTracker to make sure repeat runs with different activity types don't pollute `test_kineto_profiler_multiple_steppers`. 3. Make sure `test_forked_process` explicitly runs with CPU activities only. There are a few more failures due to test pollution, but I haven't tracked those down yet. Pull Request resolved: pytorch#186970 Approved by: https://github.com/scotts
A couple changes for pytorch/kineto#1429 and pytorch/kineto#1430: 1. Add `setUpModule` to make sure Kineto is created with CUDA support. pytorch#186036 recently changed the behavior to not initialize Kineto with GPU tracing if only CPU activities are requested, which is more correct behavior. However, this changes the behavior of the following code: ``` with profile(activities=[ProfilerActivity.CPU]) as prof: ... with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof: ... ``` Now Kineto is armed to only do CPU tracing. The issue is that Kineto is only registered once, so even though you added ProfilerActivity.CUDA in the second pass, the profiler still latches on to the CPU-only session, leading to no device-side activities being recorded. We need to find a more complete solution but to unblock the tests we can hack around it by forcing Kineto to instantiate with GPU-tracing before running any tests. 2. Clear KinetoStepTracker to make sure repeat runs with different activity types don't pollute `test_kineto_profiler_multiple_steppers`. 3. Make sure `test_forked_process` explicitly runs with CPU activities only. There are a few more failures due to test pollution, but I haven't tracked those down yet. Pull Request resolved: pytorch#186970 Approved by: https://github.com/scotts
Kineto is initialized only once per process and is then unable to be extended to profile accelerator if initialized only for CPU. This change is a workaround to avoid test flakyness by always priming profiler with accelerator activity. This mirrors upstream version of this test file (Relevant PR: pytorch/pytorch#186970). Fixes: #5171
Kineto is initialized only once per process and is then unable to be extended to profile accelerator if initialized only for CPU. This change is a workaround to avoid test flakyness by always priming profiler with accelerator activity. This mirrors upstream version of this test file (Relevant PR: pytorch/pytorch#186970). Fixes: #5171
A couple changes for pytorch/kineto#1429 and pytorch/kineto#1430:
setUpModuleto make sure Kineto is created with CUDA support. Fix CPU-only profiler mode to avoid initializing GPU tracing #186036 recently changed the behavior to not initialize Kineto with GPU tracing if only CPU activities are requested, which is more correct behavior. However, this changes the behavior of the following code:Now Kineto is armed to only do CPU tracing. The issue is that Kineto is only registered once, so even though you added ProfilerActivity.CUDA in the second pass, the profiler still latches on to the CPU-only session, leading to no device-side activities being recorded. We need to find a more complete solution but to unblock the tests we can hack around it by forcing Kineto to instantiate with GPU-tracing before running any tests.
test_kineto_profiler_multiple_steppers.test_forked_processexplicitly runs with CPU activities only.There are a few more failures due to test pollution, but I haven't tracked those down yet.