"vscode:/vscode.git/clone" did not exist on "d0b6a34bb0dbd981e3785661f04f04cde9c4222b"
Commit e3cce568 authored by silencealiang's avatar silencealiang
Browse files

add launch_with_binding

parent 48b2dafd
...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -430,29 +430,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -165,29 +165,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -165,29 +165,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -165,29 +165,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -165,29 +165,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -159,29 +159,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -159,29 +159,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then ...@@ -168,29 +168,4 @@ elif [[ $profiling == "hip" ]]; then
fi fi
#for hygon cpu #for hygon cpu
case ${LOCAL_RANK} in ${MEGATRON_PATH}/requirements/launch_with_binding.sh ${LOCAL_RANK} ${APP}
0) \ No newline at end of file
export HIP_VISIBLE_DEVICES=0
numactl --cpunodebind=0 --membind=0 ${APP} ;;
1)
export HIP_VISIBLE_DEVICES=1
numactl --cpunodebind=1 --membind=1 ${APP} ;;
2)
export HIP_VISIBLE_DEVICES=2
numactl --cpunodebind=2 --membind=2 ${APP} ;;
3)
export HIP_VISIBLE_DEVICES=3
numactl --cpunodebind=3 --membind=3 ${APP} ;;
4)
export HIP_VISIBLE_DEVICES=4
numactl --cpunodebind=4 --membind=4 ${APP} ;;
5)
export HIP_VISIBLE_DEVICES=5
numactl --cpunodebind=5 --membind=5 ${APP} ;;
6)
export HIP_VISIBLE_DEVICES=6
numactl --cpunodebind=6 --membind=6 ${APP} ;;
7)
export HIP_VISIBLE_DEVICES=7
numactl --cpunodebind=7 --membind=7 ${APP} ;;
esac
\ No newline at end of file
#!/bin/bash
LOCAL_RANK=$1
shift
gpu_map=(0 1 2 3 4 5 6 7)
numa_map=(0 1 2 3 4 5 6 7)
GPU_ID=${gpu_map[$LOCAL_RANK]}
NUMA_ID=${numa_map[$LOCAL_RANK]}
export HIP_VISIBLE_DEVICES=${GPU_ID}
numactl --cpunodebind=${NUMA_ID} --membind=${NUMA_ID} "$@"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment