Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Mar 21, 2024
1 parent 67cf3d2 commit 919ca7a
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 61 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/self-scheduled-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
uses: ./.github/workflows/self-scheduled.yml
with:
job: run_tests_gpu
slack_report_channel: 3
secrets: inherit

quantization-ci:
name: Quantization CI
uses: ./.github/workflows/self-scheduled.yml
with:
job: run_tests_quantization_torch_gpu
slack_report_channel: 3
secrets: inherit
122 changes: 63 additions & 59 deletions .github/workflows/self-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
job:
required: true
type: string
slack_report_channel:
required: true
type: string

env:
HF_HOME: /mnt/cache
Expand All @@ -32,62 +29,62 @@ env:
NUM_SLICES: 2

jobs:
setup:
if: ${{ inputs.job == 'run_tests_gpu' }}
name: Setup
strategy:
matrix:
machine_type: [single-gpu, multi-gpu]
runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, daily-ci]
container:
image: huggingface/transformers-all-latest-gpu
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
outputs:
folder_slices: ${{ steps.set-matrix.outputs.folder_slices }}
slice_ids: ${{ steps.set-matrix.outputs.slice_ids }}
steps:
- name: Update clone
working-directory: /transformers
run: |
git fetch && git checkout ${{ github.sha }}
- name: Cleanup
working-directory: /transformers
run: |
rm -rf tests/__pycache__
rm -rf tests/models/__pycache__
rm -rf reports
- name: Show installed libraries and their versions
working-directory: /transformers
run: pip freeze

- id: set-matrix
name: Identify models to test
working-directory: /transformers/tests
run: |
echo "folder_slices=$(python3 ../utils/split_model_tests.py --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT
echo "slice_ids=$(python3 -c 'd = list(range(${{ env.NUM_SLICES }})); print(d)')" >> $GITHUB_OUTPUT
- name: NVIDIA-SMI
run: |
nvidia-smi
run_tests_gpu:
if: ${{ inputs.job == 'run_tests_gpu' }}
name: " "
needs: setup
strategy:
fail-fast: false
matrix:
machine_type: [single-gpu, multi-gpu]
slice_id: ${{ fromJSON(needs.setup.outputs.slice_ids) }}
uses: ./.github/workflows/model_jobs.yml
with:
folder_slices: ${{ needs.setup.outputs.folder_slices }}
machine_type: ${{ matrix.machine_type }}
slice_id: ${{ matrix.slice_id }}
secrets: inherit
# setup:
# if: ${{ inputs.job == 'run_tests_gpu' }}
# name: Setup
# strategy:
# matrix:
# machine_type: [single-gpu, multi-gpu]
# runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, daily-ci]
# container:
# image: huggingface/transformers-all-latest-gpu
# options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
# outputs:
# folder_slices: ${{ steps.set-matrix.outputs.folder_slices }}
# slice_ids: ${{ steps.set-matrix.outputs.slice_ids }}
# steps:
# - name: Update clone
# working-directory: /transformers
# run: |
# git fetch && git checkout ${{ github.sha }}
#
# - name: Cleanup
# working-directory: /transformers
# run: |
# rm -rf tests/__pycache__
# rm -rf tests/models/__pycache__
# rm -rf reports
#
# - name: Show installed libraries and their versions
# working-directory: /transformers
# run: pip freeze
#
# - id: set-matrix
# name: Identify models to test
# working-directory: /transformers/tests
# run: |
# echo "folder_slices=$(python3 ../utils/split_model_tests.py --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT
# echo "slice_ids=$(python3 -c 'd = list(range(${{ env.NUM_SLICES }})); print(d)')" >> $GITHUB_OUTPUT
#
# - name: NVIDIA-SMI
# run: |
# nvidia-smi
#
# run_tests_gpu:
# if: ${{ inputs.job == 'run_tests_gpu' }}
# name: " "
# needs: setup
# strategy:
# fail-fast: false
# matrix:
# machine_type: [single-gpu, multi-gpu]
# slice_id: ${{ fromJSON(needs.setup.outputs.slice_ids) }}
# uses: ./.github/workflows/model_jobs.yml
# with:
# folder_slices: ${{ needs.setup.outputs.folder_slices }}
# machine_type: ${{ matrix.machine_type }}
# slice_id: ${{ matrix.slice_id }}
# secrets: inherit

# run_examples_gpu:
# name: Examples directory
Expand Down Expand Up @@ -350,6 +347,13 @@ jobs:
with:
name: ${{ matrix.machine_type }}_run_tests_quantization_torch_gpu
path: /transformers/reports/${{ matrix.machine_type }}_tests_quantization_torch_gpu

- name: "Slack report"
uses: ./.github/slack-report.yml
with:
job: run_tests_quantization_torch_gpu
secrets: inherit

#
# run_extract_warnings:
# name: Extract warnings in CI artifacts
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/slack-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI slack report

on:
workflow_call:
inputs:
job:
required: true
type: string

jobs:
send_results:
name: Send results to webhook
runs-on: ubuntu-22.04
if: always()
steps:
# - name: Preliminary job status
# shell: bash
# # For the meaning of these environment variables, see the job `Setup`
# run: |
# echo "Setup status: ${{ needs.setup.result }}"

- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Send message to Slack
env:
CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
CI_SLACK_REPORT_CHANNEL_ID: ${{ secrets.slack_report_channel }}
ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
CI_EVENT: scheduled
CI_SHA: ${{ github.sha }}
CI_WORKFLOW_REF: ${{ github.workflow_ref }}
# SETUP_STATUS: ${{ needs.setup.result }}
# We pass `needs.setup.outputs.matrix` as the argument. A processing in `notification_service.py` to change
# `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`.
run: |
sudo apt-get install -y curl
# pip install slack_sdk
# pip show slack_sdk
# python utils/notification_service.py "${{ needs.setup.outputs.folder_slices }}"

# # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack.
# - name: Failure table artifacts
# if: ${{ always() }}
# uses: actions/upload-artifact@v3
# with:
# name: prev_ci_results
# path: prev_ci_results

0 comments on commit 919ca7a

Please sign in to comment.