-
Notifications
You must be signed in to change notification settings - Fork 58
[CI] Add more ported distributed cases #2082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
name: Get Runner Infos | ||
|
||
inputs: | ||
ut_name: | ||
required: true | ||
type: string | ||
description: Which ut to launch | ||
|
||
outputs: | ||
runner_id: | ||
value: ${{ steps.runner.outputs.runner_id }} | ||
|
@@ -57,22 +63,41 @@ runs: | |
if(gpu==1 && $0~/Platform/){gpu=0}; if(gpu==1){print $0}; if($0~/Platform.*Graphics/){gpu=1} | ||
}' |wc -l)" | ||
cpus_per_xpu="$(echo |awk -v c="${cpu_num}" -v x="${xpu_num}" '{printf c/x}')" | ||
pytest_extra_args="$(echo |awk -v x="${xpu_num}" -v z="${ZE_AFFINITY_MASK}" -v cx="${cpus_per_xpu}" '{ | ||
if (x > 0) { | ||
split(z, xpu_list, ","); | ||
for (i=0;i<x;i++) { | ||
if (z != "") { | ||
ze = xpu_list[i+1]; | ||
} else { | ||
ze = i; | ||
if [ "${{ inputs.ut_name }}" == "xpu_distributed" ];then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any assumptions in here? Can we detect topology directly and dynamically on the test node?
|
||
pytest_extra_args="$(echo |awk -v x="${xpu_num}" -v z="${ZE_AFFINITY_MASK}" -v cx="${cpus_per_xpu}" '{ | ||
if (x > 0) { | ||
split(z, xpu_list, ","); | ||
for (i=0;i<x;i=i+4) { | ||
if (z != "") { | ||
ze = xpu_list[i+1]; | ||
} else { | ||
ze = i; | ||
} | ||
printf(" --tx popen//env:ZE_AFFINITY_MASK=%d,%d,%d,%d//env:OMP_NUM_THREADS=%d//python=\"numactl -l -C %d-%d python\"", | ||
ze,ze+1,ze+2,ze+3,4*cx,i*cx,(i+4)*cx-1); | ||
} | ||
printf(" --tx popen//env:ZE_AFFINITY_MASK=%d//env:OMP_NUM_THREADS=%d//python=\"numactl -l -C %d-%d python\"", | ||
ze, cx, i*cx, (i+1)*cx-1); | ||
}else { | ||
printf(" -n 1 "); | ||
} | ||
}else { | ||
printf(" -n 1 "); | ||
} | ||
}')" | ||
}')" | ||
else | ||
pytest_extra_args="$(echo |awk -v x="${xpu_num}" -v z="${ZE_AFFINITY_MASK}" -v cx="${cpus_per_xpu}" '{ | ||
if (x > 0) { | ||
split(z, xpu_list, ","); | ||
for (i=0;i<x;i++) { | ||
if (z != "") { | ||
ze = xpu_list[i+1]; | ||
} else { | ||
ze = i; | ||
} | ||
printf(" --tx popen//env:ZE_AFFINITY_MASK=%d//env:OMP_NUM_THREADS=%d//python=\"numactl -l -C %d-%d python\"", | ||
ze, cx, i*cx, (i+1)*cx-1); | ||
} | ||
}else { | ||
printf(" -n 1 "); | ||
} | ||
}')" | ||
fi | ||
echo "xpu_num=${xpu_num}" |tee -a ${GITHUB_OUTPUT} | ||
echo "cpus_per_xpu=${cpus_per_xpu}" |tee -a ${GITHUB_OUTPUT} | ||
echo "pytest_extra_args=${pytest_extra_args}" |tee -a ${GITHUB_OUTPUT} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ env: | |
jobs: | ||
runner: | ||
runs-on: ${{ inputs.runner }} | ||
name: get-runner | ||
name: get-runner | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why we have such change? |
||
outputs: | ||
runner_id: ${{ steps.runner-info.outputs.runner_id }} | ||
user_id: ${{ steps.runner-info.outputs.user_id }} | ||
|
@@ -53,6 +53,8 @@ jobs: | |
uses: actions/checkout@v4 | ||
- name: Get runner | ||
id: runner-info | ||
with: | ||
ut_name: ${{ inputs.ut }} | ||
uses: ./.github/actions/get-runner | ||
|
||
test-in-container: | ||
|
@@ -104,7 +106,7 @@ jobs: | |
runs-on: ${{ needs.runner.outputs.runner_id }} | ||
env: | ||
AGENT_TOOLSDIRECTORY: /tmp/xpu-tool | ||
PYTEST_ADDOPTS: -v --timeout 3600 --timeout_method=thread -n 1 | ||
PYTEST_ADDOPTS: -v --timeout 3600 --timeout_method=thread --dist worksteal ${{ needs.runner.outputs.pytest_extra_args }} | ||
steps: | ||
- name: Checkout torch-xpu-ops | ||
uses: actions/checkout@v4 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.