Skip to content

Commit

Permalink
modify the E2E test sciripts
Browse files Browse the repository at this point in the history
  • Loading branch information
RUIJIEZHONG66166 committed Apr 2, 2024
1 parent 2dd2ce0 commit 4453723
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
39 changes: 20 additions & 19 deletions .github/scripts/inductor-xpu-e2e.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
suite=${1:-huggingface}
dt=${2:-amp_bf16}
mode=${3:-inference}
scenario=${4:-accuracy}
SUITE=${1:-huggingface}
DT=${2:-amp_bf16}
MODE=${3:-inference}
SCENARIO=${4:-accuracy}
expected_pass_num=${5:-46}

echo -e "========================================================================="
Expand All @@ -10,9 +10,9 @@ echo -e "=======================================================================
source activate e2e_ci
cp .github/scripts/inductor_xpu_test.sh ../pytorch
cd ../pytorch
if [[ ${suite} == "timm_models" ]]; then
pip install --no-deps "git+https://github.com/rwightman/pytorch-image-models@b9d43c7dcac1fe05e851dd7be7187b108af593d2"
elif [[ ${suite} == "torchbench" ]]; then
if [[ ${SUITE} == "timm_MODEls" ]]; then
pip install --no-deps "git+https://github.com/rwightman/pytorch-image-MODEls@b9d43c7dcac1fe05e851dd7be7187b108af593d2"
elif [[ ${SUITE} == "torchbench" ]]; then
pip install transformers==4.38.1 --no-deps
pip install timm==0.9.7 --no-deps
apt-get update -y
Expand All @@ -38,23 +38,24 @@ echo -e "=======================================================================
echo -e "E2E Test"
echo -e "========================================================================="
source /opt/intel/oneapi/setvars.sh
export HUGGING_FACE_HUB_TOKEN=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
#export PYTORCH_ENABLE_XPU_FALLBACK=1
rm -rf inductor_log
bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu 3
bash inductor_xpu_test.sh ${SUITE} ${DT} ${MODE} ${SCENARIO} xpu 3

echo -e "========================================================================="
echo -e "Test Results Summary"
echo -e "========================================================================="
cd ../pytorch/inductor_log/${suite}
cd ${dt}
echo -e "============ Summary for ${suite} ${dt} ${mode} ${scenario} ============" | tee -a ./${suite}_${dt}_${mode}_${scenario}_e2e_summary.log
awk -i inplace '!seen[$0]++' inductor_${suite}_${dt}_${mode}_xpu_${scenario}.csv
csv_lines=$(cat inductor_${suite}_${dt}_${mode}_xpu_${scenario}.csv | wc -l)
cd ../pytorch/inductor_log/${SUITE}
cd ${DT}
echo -e "============ Summary for ${SUITE} ${DT} ${MODE} ${SCENARIO} ============" | tee -a ./${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log
awk -i inplace '!seen[$0]++' inductor_${SUITE}_${DT}_${MODE}_xpu_${SCENARIO}.csv
csv_lines=$(cat inductor_${SUITE}_${DT}_${MODE}_xpu_${SCENARIO}.csv | wc -l)
let num_total=csv_lines-1
num_passed=$(grep -c "pass" inductor_${suite}_${dt}_${mode}_xpu_${scenario}.csv)
num_passed=$(grep -c "pass" inductor_${SUITE}_${DT}_${MODE}_xpu_${SCENARIO}.csv)
let num_failed=num_total-num_passed
pass_rate=`awk 'BEGIN{printf "%.2f%%\n",('$num_passed'/'$num_total')*100}'`
echo "num_total: $num_total" | tee -a ./${suite}_${dt}_${mode}_${scenario}_e2e_summary.log
echo "num_passed: $num_passed" | tee -a ./${suite}_${dt}_${mode}_${scenario}_e2e_summary.log
echo "num_failed: $num_failed" | tee -a ./${suite}_${dt}_${mode}_${scenario}_e2e_summary.log
echo "pass_rate: $pass_rate" | tee -a ./${suite}_${dt}_${mode}_${scenario}_e2e_summary.log
#pass_rate=`awk 'BEGIN{printf "%.2f%%\n",('$num_passed'/'$num_total')*100}'`
echo "num_total: $num_total" | tee -a ./${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log
echo "num_passed: $num_passed" | tee -a ./${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log
echo "num_failed: $num_failed" | tee -a ./${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log
#echo "pass_rate: $pass_rate" | tee -a ./${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log
18 changes: 9 additions & 9 deletions .github/scripts/results-check.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
suite=${1:-huggingface}
dt=${2:-amp_bf16}
mode=${3:-inference}
scenario=${4:-accuracy}
SUITE=${1:-huggingface}
DT=${2:-amp_bf16}
MODE=${3:-inference}
SCENARIO=${4:-accuracy}
expected_pass_num=${5:-46}

echo -e "========================================================================="
echo -e "Results Check"
echo -e "========================================================================="

cd ../pytorch/inductor_log/${suite}
cd ${dt}
num_passed=$(grep "num_passed:" ${suite}_${dt}_${mode}_${scenario}_e2e_summary.log | sed -e 's/.*://;s/[^0-9.]//')
if [ $num_passed -lt ${{ inputs.expected_pass_num }} ]; then
echo -e "[ERROR] Inductor E2E CI test for ${suite} ${dt} ${mode} passed_num < ${{ inputs.expected_pass_num }}"
cd ../pytorch/inductor_log/${SUITE}
cd ${DT}
num_passed=$(grep "num_passed:" ${SUITE}_${DT}_${MODE}_${SCENARIO}_e2e_summary.log | sed -e 's/.*://;s/[^0-9.]//')
if [ $num_passed -lt ${expected_pass_num} ]; then
echo -e "[ERROR] Inductor E2E CI test for ${SUITE} ${DT} ${MODE} passed_num < ${expected_pass_num}"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/inductor_xpu_e2e_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

- name: Huggingface AMP_BF16 Inference Accuracy Test
run: |
bash .github/scripts/inductor-xpu-e2e.sh --suite huggingface --dt amp_bf16 --mode inference --scenario accuracy --expected_pass_num 46
bash .github/scripts/inductor-xpu-e2e.sh
- name: Upload Triton Inductor E2E CI Data
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 4453723

Please sign in to comment.