File size: 556 Bytes
7c50656 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/usr/bin/env python3
"""
Python wrapper to launch bash training script via torchrun
"""
import subprocess
import sys
import os
if __name__ == "__main__":
# Get the bash script path and arguments
bash_script = "/workspace/hanrui/syxin/run_train_multinode.sh"
args = sys.argv[1:] # Pass through all arguments
# Build the command
cmd = ["bash", bash_script] + args
# Execute the bash script
result = subprocess.run(cmd, env=os.environ.copy())
# Exit with the same code as the bash script
sys.exit(result.returncode)
|