Skip to content
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

[Test] Add transformers test #1175

Merged
merged 19 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion .github/workflows/_linux_transformers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- '.github/scripts/spec.py'
- '.github/workflows/_linux_transformers.yml'
workflow_call:
workflow_dispatch:
inputs:
pytorch:
required: false
Expand Down Expand Up @@ -39,6 +39,11 @@ on:
type: string
default: 'v4.47.0'
description: Transformers version
transformers_test:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this. Let's focus on a single test - backbone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, drop transformers_test. We will most likely rework how to setup test scope.

required: true
type: string
default: ''
description: Test scope. `test_py,benchmark,generation,models,pipelines,trainer,utils,backbone,trainer_not_ray` Delimiter is comma

permissions: read-all

Expand Down Expand Up @@ -125,6 +130,38 @@ jobs:
source activate huggingface_transformers_test
cd transformers
python3 -m pytest -rsf --make-reports=tests_benchmark -k backbone tests
# On-demand launch
- name: OnDemand Test (${transformers_test})
if: github.event_name == 'workflow_dispatch'
run: |
source activate huggingface_transformers_test
cd transformers

# check param
function contains() {
contains_status="echo 'Start $2 ...'"
{
[[ $1 =~ (^|,)$2($|,) ]]
} || {
echo "[Warning] $2 is not suppotted type! Skipped!"
contains_status="continue"
}
}
set -xe
for transformers_test in $(echo ${{ input.transformers_test }} |sed 's/,/ /g')
do
contains "test_py,benchmark,generation,models,pipelines,trainer,utils,backbone,trainer_not_ray" $transformers_test
$contains_status
if [ "${transformers_test}" == "test_py" ];then
python3 -m pytest -rsf --make-reports=tests_py tests/*.py
elif [ "${transformers_test}" == "trainer_not_ray" ];then
python3 -m pytest -rsf --make-reports=tests_trainer_not_ray -k "not ray" tests/trainer
elif [ "${transformers_test}" == "backbone" ];then
python3 -m pytest -rsf --make-reports=tests_backbone -k backbone tests
else
python3 -m pytest -rsf --make-reports=tests_${transformers_test} tests/${transformers_test}
fi
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this. As we agreed - let's do any additional tests on a follow up commit.

Basically limit this change to just s/workflow_call/workflow_dispatch.

- name: Upload Test log
if: ${{ ! cancelled() }}
uses: actions/upload-artifact@v4
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/nightly_ondemand_whl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ on:
type: string
default: '3.10'
description: Python version
nightly_whl:
required: false
type: string
default: ''
description: Pytorch nightly wheel version

permissions: read-all

Expand Down Expand Up @@ -263,15 +258,6 @@ jobs:
name: Inductor-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }}
path: ${{ github.workspace }}/upload_files

Linux-Nightly-Ondemand-Transformers-WHL-Tests:
if: github.event_name == 'schedule' && github.event.schedule == '0 14 * * 0-4' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/_linux_transformers.yml
with:
python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }}
pytorch: nightly_wheel
nightly_whl: ${{ github.event_name == 'schedule' && '' || inputs.nightly_whl }}
runner: linux.idc.xpu

Tests-Failure-And-Report:
if: ${{ ! cancelled() }}
runs-on: [ self-hosted, Linux ]
Expand Down
Loading