fixbug: dist test in torch 2.0 (#1602)

* fixbug: torch 2.0 dist train with error local rank

* fixbug: dist test in torch 2.0
7 jobs for master in 0 seconds (queued for 75 minutes and 55 seconds)
Status Job ID Name Coverage
  Build
failed #17054
build

 
  Test
skipped #17057
allowed to fail
bandit-sast
failed #17056
allowed to fail
code_quality

skipped #17058
allowed to fail
flawfinder-sast
skipped #17060
allowed to fail
secret_detection
skipped #17059
allowed to fail
semgrep-sast
failed #17055
test

 
Name Stage Failure
failed
test Test There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log
failed
code_quality Test There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log
failed
build Build There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log