-
Notifications
You must be signed in to change notification settings - Fork 40
[CI] Enable matrix test for UT #1677
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?
Conversation
d206dfa
to
5491aa6
Compare
rm -rf $(dirname ${CONDA_EXE})/../envs/xpu_op_${ZE_AFFINITY_MASK} | ||
conda create -n xpu_op_${ZE_AFFINITY_MASK} python=${{ inputs.python }} cmake ninja -y | ||
source activate xpu_op_${ZE_AFFINITY_MASK} | ||
conda remove --all -y -n $CONDA_ENV_NAME || \ |
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.
Command on a previous line, conda clean -ay
is a big problem if you have a few runners running on the same system. This effectively means that you can damage environment you create/work in one runner from another and get all sorts of fancy random failures.
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.
Got it. Thank you~~
.github/workflows/_linux_ut.yml
Outdated
- name: Create unique workspace | ||
run: | | ||
# Create unique conda env for each UT test | ||
echo "CONDA_ENV_NAME=xpu_op_${ZE_AFFINITY_MASK}_${{ matrix.test.name }}" >> $GITHUB_ENV |
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.
That's not truly unique actually. Meaning that if there are 2 of these workloads running in parallel, for example for different PRs, these will start to fail. To address this you can reuse approach from #1282. It will work only with Linux though. For Windows you will need something else:
echo "CONDA_ENV_NAME=xpu_op_${ZE_AFFINITY_MASK}_${{ matrix.test.name }}" >> $GITHUB_ENV | |
random=$(head /dev/urandom | tr -dc A-Za-z0-9_ | head -c ${1:-5} | xargs) | |
echo "CONDA_ENV_NAME=xpu_op_${ZE_AFFINITY_MASK}_${{ matrix.test.name }}_${random}" >> $GITHUB_ENV |
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.
Got it. Thank you so much for your help~~
Enable matrix test method to accelerate the UT test.