diff --git a/.github/workflows/_linux_transformers.yml b/.github/workflows/_linux_transformers.yml index 19e59175b..58b6e33b9 100644 --- a/.github/workflows/_linux_transformers.yml +++ b/.github/workflows/_linux_transformers.yml @@ -51,6 +51,7 @@ jobs: python: ${{ inputs.python != '' && inputs.python || '3.10' }} pytorch: ${{ inputs.pytorch != '' && inputs.pytorch || 'nightly' }} transformers: ${{ inputs.transformers != '' && inputs.transformers || 'v4.47.0' }} + PYTORCH_DEBUG_XPU_FALLBACK: '1' TRANSFORMERS_TEST_DEVICE_SPEC: 'spec.py' steps: - name: Checkout torch-xpu-ops @@ -158,10 +159,10 @@ jobs: # Excluding tests due to: # * torch.distributed.* not yet supported by XPU pattern="not TestFSDPGeneration" - python3 -m pytest -rsf --make-reports=$TEST_CASE tests/generation -k "$pattern" || true - (cat reports/$TEST_CASE/stats.txt | grep errors) && failed=1 - (cat reports/$TEST_CASE/stats.txt | grep "17 failed") || failed=1 - [[ "$failed" = 1 ]] && (echo "FAILED_CASES=$FAILED_CASES,$TEST_CASE" >> $GITHUB_ENV) || true + #python3 -m pytest -rsf --make-reports=$TEST_CASE tests/generation -k "$pattern" || true + #(cat reports/$TEST_CASE/stats.txt | grep errors) && failed=1 + #(cat reports/$TEST_CASE/stats.txt | grep "17 failed") || failed=1 + #[[ "$failed" = 1 ]] && (echo "FAILED_CASES=$FAILED_CASES,$TEST_CASE" >> $GITHUB_ENV) || true - name: Run tests/models env: TEST_CASE: 'tests_models' @@ -176,7 +177,7 @@ jobs: not test_model_parallel_equal_results and \ not test_resize_embeddings_untied and \ not test_resize_tokens_embeddings" - python3 -m pytest -rsf --make-reports=$TEST_CASE tests/models -k "$pattern" || true + python3 -m pytest -rsf --make-reports=$TEST_CASE tests/models/albert || true (cat reports/$TEST_CASE/stats.txt | grep errors) && failed=1 # TODO: establish baseline with failed tests after resolving random failures #(cat reports/$TEST_CASE/stats.txt | grep "10 failed") || failed=1 @@ -283,6 +284,33 @@ jobs: echo "| $test_group | $file | $error | $comment |" done <_failures_uniq.txt } >> $GITHUB_STEP_SUMMARY + - name: Print not implemented XPU backend ops + run: | + cd transformers + { + echo "### Not implemented ops" + echo "| Test group | Operator | Status |" + echo "| --- | --- | --- |" + rm -rf _ops.txt + for log in $(find reports -name failures_line.txt); do + # Each failure_line.txt is located in: reports/$test_group/failure_line.txt + test_group=$(echo $log | cut -f2 -d/) + op=$(grep NotImplementedError $log | grep "for the XPU device" | sed "s/.*The operator '\(.*\)' is not.*/\1/") + if [[ -n "$op" ]]; then + echo "| $test_group |
$op
| not implemented |" >> _ops.txt + fi + done + for log in $(find reports -name warnings.txt); do + # Each warnings.txt is located in: reports/$test_group/warnings.txt + test_group=$(echo $log | cut -f2 -d/) + op=$(grep UserWarning $log | grep "on the XPU backend" | sed "s/.*The operator '\(.*\) on the XPU.*/\1/") + if [[ -n "$op" ]]; then + echo "| $test_group |
$op
| fallback to CPU happens |" >> _ops.txt + fi + done + sort _ops.txt | uniq > _ops_uniq.txt + cat _ops_uniq.txt + } >> $GITHUB_STEP_SUMMARY - name: Print annotations if: ${{ ! cancelled() }} run: | @@ -329,6 +357,8 @@ jobs: # printing annotations with key environment variables echo "| jobs.$GITHUB_JOB.env.ZE_AFFINITY_MASK | $ZE_AFFINITY_MASK |" echo "| jobs.$GITHUB_JOB.env.NEOReadDebugKeys | $NEOReadDebugKeys |" + echo "| jobs.$GITHUB_JOB.env.PYTORCH_ENABLE_XPU_FALLBACK | $PYTORCH_ENABLE_XPU_FALLBACK |" + echo "| jobs.$GITHUB_JOB.env.PYTORCH_DEBUG_XPU_FALLBACK | $PYTORCH_DEBUG_XPU_FALLBACK |" } >> $GITHUB_STEP_SUMMARY - name: Upload Test log if: ${{ ! cancelled() }}