A couple changes for pytorch/kineto#1429 and pytorch/kineto#1430:
- Add
setUpModuleto make sure Kineto is created with CUDA support. #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.
- Clear KinetoStepTracker to make sure repeat runs with different activity types don't pollute
test_kineto_profiler_multiple_steppers. - Make sure
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.
Pull Request resolved: #186970
Approved by: https://github.com/scotts
SOCIAL SHARE CARD GENERATOR