Update GraphTask::owner_ in a single thread for DistEngine. (#58625)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58625
Several TSAN tests were failing for distributed since `owner_` was not
atomic and was being accessed by several threads. As an example:
https://github.com/pytorch/pytorch/blob/master/torch/csrc/distributed/autograd/engine/dist_engine.cpp#L333.
To fix this, I've set the owner_ only once when the graphTask is created.
Test Plan:
1) Validated change fixes failing TSAN test.
2) waitforbuildbot
Reviewed By: albanD
Differential Revision: D28496878
fbshipit-source-id: 473f4f6d859595749a02563a204ba7aa35ea19e3