forked from intel/torch-xpu-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial CI workflow enabling (intel#21)
- Loading branch information
1 parent
8a92098
commit 0c4a76d
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
001bf1d06b813f4c592cc13ce594cce5f8bd0721 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: pull | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
preci-ut: | ||
# Don't run on forked repos | ||
if: github.repository_owner == 'intel' | ||
name: preci-ut | ||
runs-on: linux.idc.xpu | ||
timeout-minutes: 240 | ||
steps: | ||
- name: Checkout torch-xpu-ops | ||
uses: actions/checkout@v3 | ||
- name: Prepare Stock Pytorch | ||
run: | | ||
pwd | ||
cd ../ && rm -rf pytorch | ||
git clone https://github.com/pytorch/pytorch | ||
cd pytorch && git checkout `cat ../torch-xpu-ops/.github/ci_commit_pins/pytorch.txt` && git submodule sync && git submodule update --init --recursive | ||
rm -rf third_party/torch-xpu-ops && cp -r ../torch-xpu-ops third_party/ | ||
- name: Build Pytorch XPU | ||
run: | | ||
source activate xpu_op_${ZE_AFFINITY_MASK} | ||
conda install cmake ninja -y | ||
conda install intel::mkl-static intel::mkl-include -y | ||
cd ../pytorch | ||
pip install -r requirements.txt | ||
export USE_XPU=1 | ||
source /opt/intel/oneapi/compiler/latest/env/vars.sh | ||
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} | ||
python setup.py bdist_wheel | ||
pip install --force-reinstall dist/*.whl | ||
- name: Run XPU OP UT | ||
run: | | ||
xpu-smi discovery | ||
source /opt/intel/oneapi/compiler/latest/env/vars.sh | ||
source activate xpu_op_${ZE_AFFINITY_MASK} | ||
cd test/python | ||
timeout 8000 pytest -v 2>&1 | tee torch_xpu_ops_ut.log | ||
- name: Run Torch XPU UT | ||
run: | | ||
source /opt/intel/oneapi/compiler/latest/env/vars.sh | ||
source activate xpu_op_${ZE_AFFINITY_MASK} | ||
cd ../pytorch | ||
TEST_REPORTS_DIR=$(pwd)/test/test-reports | ||
rm -rf "$TEST_REPORTS_DIR" && mkdir -p "$TEST_REPORTS_DIR" | ||
# Run Pytorch XPU binary UT | ||
for xpu_case in build/bin/*{xpu,sycl}*; do | ||
if [[ "$xpu_case" != *"*"* && "$xpu_case" != *.so && "$xpu_case" != *.a ]]; then | ||
case_name=$(basename "$xpu_case") | ||
echo "Testing ${case_name} ..." | ||
"$xpu_case" --gtest_output=xml:"$TEST_REPORTS_DIR"/"$case_name".xml | ||
fi | ||
done | ||
# Run Pytorch XPU python UT | ||
sed -i 's/selected_tests = exclude_tests(XPU_BLOCKLIST.*/selected_tests = XPU_TEST/g' ./test/run_test.py | ||
python test/run_test.py --xpu |