[FX] Make split_module preserve proper placeholder names (#74736)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74736
Previously, `split_module` would incorrectly carry over the `name` of placeholders rather than their `target`:
Original GraphModule
```
def forward(self, x, **kwargs):
_kwargs = kwargs
getitem = _kwargs['foo']; _kwargs = None
add = x + getitem; x = getitem = None
return add
```
After splitting:
```
def forward(self, x, _kwargs):
submod_0 = self.submod_0(_kwargs); _kwargs = None
submod_1 = self.submod_1(x, submod_0); x = submod_0 = None
return submod_1
```
Notice that `**kwargs` is turned into `_kwargs`, which is incorrect and we lose the kwarg expansion behavior. This patch switches the erroneous code in `split_module`, resulting in the correct split code being emitted:
Original GraphModule
```
def forward(self, x, **kwargs):
_kwargs = kwargs
getitem = _kwargs['foo']; _kwargs = None
add = x + getitem; x = getitem = None
return add
```
After splitting:
```
def forward(self, x, **kwargs):
_kwargs = kwargs
submod_0 = self.submod_0(_kwargs); _kwargs = None
submod_1 = self.submod_1(x, submod_0); x = submod_0 = None
return submod_1
```
Test Plan: Imported from OSS
Reviewed By: VitalyFedyunin
Differential Revision: D35137361
Pulled By: jamesr66a
fbshipit-source-id: 46d079cfe16093c293fc268404fb8bc86ffcf583
(cherry picked from commit a020066281856184621561a8672eb57f5de31e92)