DDPOptimizer replace debug=True/False with using torchdynamo logger (#88480)
Example output:
```
2022-11-04 05:09:29,525] torch._dynamo.optimizations.distributed: [INFO]
DDPOptimizer bucket assignments
┌─────────┬────────────┬───────────────────┐
│ Index │ Size (b) │ Param Names │
├─────────┼────────────┼───────────────────┤
│ 0 │ 100120020 │ self_net_6_weight │
├─────────┼────────────┼───────────────────┤
│ │ │ self_net_6_bias │
├─────────┼────────────┼───────────────────┤
│ │ │ self_net_4_weight │
├─────────┼────────────┼───────────────────┤
│ │ │ self_net_4_bias │
├─────────┼────────────┼───────────────────┤
│ 1 │ 100020000 │ self_net_2_weight │
├─────────┼────────────┼───────────────────┤
│ │ │ self_net_2_bias │
├─────────┼────────────┼───────────────────┤
│ 2 │ 220000 │ self_net_0_weight │
├─────────┼────────────┼───────────────────┤
│ │ │ self_net_0_bias │
└─────────┴────────────┴───────────────────┘
[2022-11-04 05:09:29,527] torch._dynamo.optimizations.distributed: [DEBUG]
---orig graph---
graph():
%inputs : torch.Tensor [#users=1] = placeholder[target=inputs]
%self_net_0 : [#users=1] = call_module[target=self_net_0](args = (%inputs,), kwargs = {})
%self_net_1 : [#users=1] = call_module[target=self_net_1](args = (%self_net_0,), kwargs = {})
%self_net_2 : [#users=1] = call_module[target=self_net_2](args = (%self_net_1,), kwargs = {})
%self_net_3 : [#users=1] = call_module[target=self_net_3](args = (%self_net_2,), kwargs = {})
%self_net_4 : [#users=1] = call_module[target=self_net_4](args = (%self_net_3,), kwargs = {})
%self_net_5 : [#users=1] = call_module[target=self_net_5](args = (%self_net_4,), kwargs = {})
%self_net_6 : [#users=1] = call_module[target=self_net_6](args = (%self_net_5,), kwargs = {})
%self_net_7 : [#users=1] = call_module[target=self_net_7](args = (%self_net_6,), kwargs = {})
return (self_net_7,)
---split graph---
graph():
%inputs : torch.Tensor [#users=1] = placeholder[target=inputs]
%submod_0 : [#users=1] = call_module[target=submod_0](args = (%inputs,), kwargs = {})
%submod_1 : [#users=1] = call_module[target=submod_1](args = (%submod_0,), kwargs = {})
%submod_2 : [#users=1] = call_module[target=submod_2](args = (%submod_1,), kwargs = {})
return (submod_2,)
---submod_0 graph---
graph():
%inputs : [#users=1] = placeholder[target=inputs]
%self_net_0 : [#users=1] = call_module[target=self_net_0](args = (%inputs,), kwargs = {})
%self_net_1 : [#users=1] = call_module[target=self_net_1](args = (%self_net_0,), kwargs = {})
return self_net_1
---submod_1 graph---
graph():
%self_net_1 : [#users=1] = placeholder[target=self_net_1]
%self_net_2 : [#users=1] = call_module[target=self_net_2](args = (%self_net_1,), kwargs = {})
%self_net_3 : [#users=1] = call_module[target=self_net_3](args = (%self_net_2,), kwargs = {})
return self_net_3
---submod_2 graph---
graph():
%self_net_3 : [#users=1] = placeholder[target=self_net_3]
%self_net_4 : [#users=1] = call_module[target=self_net_4](args = (%self_net_3,), kwargs = {})
%self_net_5 : [#users=1] = call_module[target=self_net_5](args = (%self_net_4,), kwargs = {})
%self_net_6 : [#users=1] = call_module[target=self_net_6](args = (%self_net_5,), kwargs = {})
%self_net_7 : [#users=1] = call_module[target=self_net_7](args = (%self_net_6,), kwargs = {})
return self_net_7
---------------
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88480
Approved by: https://github.com/anj-s, https://github.com/davidberard98