-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
[DON'T MERGE] Commont bot CI for other jobs (generation
/ quantization
)
#35341
base: main
Are you sure you want to change the base?
Conversation
name: Run all tests for the model | ||
if: ${{ needs.get-tests.outputs.models != '[]' }} | ||
needs: [get-pr-number, get-tests, create_run] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
folders: ${{ fromJson(needs.get-tests.outputs.models) }} | ||
machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache] | ||
runs-on: | ||
group: '${{ matrix.machine_type }}' | ||
container: | ||
image: huggingface/transformers-all-latest-gpu | ||
options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | ||
steps: | ||
- name: Echo folder ${{ matrix.folders }} | ||
shell: bash | ||
# For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to | ||
# set the artifact folder names (because the character `/` is not allowed). | ||
run: | | ||
echo "${{ matrix.folders }}" | ||
matrix_folders=${{ matrix.folders }} | ||
matrix_folders=${matrix_folders/'models/'/'models_'} | ||
echo "$matrix_folders" | ||
echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV | ||
|
||
- name: Checkout to PR merge commit | ||
working-directory: /transformers | ||
run: | | ||
git fetch origin refs/pull/${{ needs.get-pr-number.outputs.PR_NUMBER }}/merge:refs/remotes/pull/${{ needs.get-pr-number.outputs.PR_NUMBER }}/merge | ||
git checkout refs/remotes/pull/${{ needs.get-pr-number.outputs.PR_NUMBER }}/merge | ||
git log -1 --format=%H | ||
|
||
- name: Reinstall transformers in edit mode (remove the one installed during docker image build) | ||
working-directory: /transformers | ||
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e . | ||
|
||
- name: NVIDIA-SMI | ||
run: | | ||
nvidia-smi | ||
|
||
- name: Set `machine_type` for report and artifact names | ||
working-directory: /transformers | ||
shell: bash | ||
run: | | ||
echo "${{ matrix.machine_type }}" | ||
if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then | ||
machine_type=single-gpu | ||
elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then | ||
machine_type=multi-gpu | ||
else | ||
machine_type=${{ matrix.machine_type }} | ||
fi | ||
echo "$machine_type" | ||
echo "machine_type=$machine_type" >> $GITHUB_ENV | ||
|
||
- name: Environment | ||
working-directory: /transformers | ||
run: | | ||
python3 utils/print_env.py | ||
|
||
- name: Show installed libraries and their versions | ||
working-directory: /transformers | ||
run: pip freeze | ||
|
||
- name: Run all tests on GPU | ||
working-directory: /transformers | ||
run: | | ||
export CUDA_VISIBLE_DEVICES="$(python3 utils/set_cuda_devices_for_ci.py --test_folder ${{ matrix.folders }})" | ||
echo $CUDA_VISIBLE_DEVICES | ||
python3 -m pytest -v -rsfE --make-reports=${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} | ||
|
||
- name: Failure short reports | ||
if: ${{ failure() }} | ||
continue-on-error: true | ||
run: cat /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt | ||
|
||
- name: Make sure report directory exists | ||
shell: bash | ||
run: | | ||
mkdir -p /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports | ||
echo "hello" > /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt | ||
echo "${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports" | ||
|
||
- name: "Test suite reports artifacts: ${{ env.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports" | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports | ||
path: /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports |
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.
This is only about indent level
name: ${{ env.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports | ||
path: /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports | ||
|
||
run_quantization_torch_gpu: |
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.
specific for quantization
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
generation
/ quantization
)generation
/ quantization
)
What does this PR do?
See example (dummy) run here