Some checks failed
Self-hosted runner (nightly-past-ci-caller) / Get number (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.11 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.10 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.9 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.8 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.7 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.6 (push) Has been cancelled
Self-hosted runner (nightly-past-ci-caller) / TensorFlow 2.5 (push) Has been cancelled
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Has been cancelled
Build documentation / build (push) Has been cancelled
Build documentation / build_other_lang (push) Has been cancelled
CodeQL Security Analysis / CodeQL Analysis (push) Has been cancelled
New model PR merged notification / Notify new model (push) Has been cancelled
PR CI / pr-ci (push) Has been cancelled
Slow tests on important models (on Push - A10) / Get all modified files (push) Has been cancelled
Secret Leaks / trufflehog (push) Has been cancelled
Update Transformers metadata / build_and_package (push) Has been cancelled
Slow tests on important models (on Push - A10) / Model CI (push) Has been cancelled
Check Tiny Models / Check tiny models (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Model CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Pipeline CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Example CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / DeepSpeed CI (push) Has been cancelled
Self-hosted runner (Intel Gaudi3 scheduled CI caller) / Trainer/FSDP CI (push) Has been cancelled
Nvidia CI - Flash Attn / Setup (push) Has been cancelled
Nvidia CI - Flash Attn / Model CI (push) Has been cancelled
Nvidia CI / Setup (push) Has been cancelled
Nvidia CI / Model CI (push) Has been cancelled
Nvidia CI / Torch pipeline CI (push) Has been cancelled
Nvidia CI / Example CI (push) Has been cancelled
Nvidia CI / Trainer/FSDP CI (push) Has been cancelled
Nvidia CI / DeepSpeed CI (push) Has been cancelled
Nvidia CI / Quantization CI (push) Has been cancelled
Nvidia CI / Kernels CI (push) Has been cancelled
Doctests / Setup (push) Has been cancelled
Doctests / Call doctest jobs (push) Has been cancelled
Doctests / Send results to webhook (push) Has been cancelled
Extras Smoke Test / Get supported Python versions (push) Has been cancelled
Extras Smoke Test / Test extras on Python ${{ matrix.python-version }} (push) Has been cancelled
Extras Smoke Test / Check Slack token availability (push) Has been cancelled
Extras Smoke Test / Notify failures to Slack (push) Has been cancelled
Self-hosted runner (AMD scheduled CI caller) / Trigger Scheduled AMD CI (push) Has been cancelled
Stale Bot / Close Stale Issues (push) Has been cancelled
156 lines
5.0 KiB
YAML
156 lines
5.0 KiB
YAML
name: SSH into our runners
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
runner_type:
|
|
description: 'Type of runner to test (a10)'
|
|
required: true
|
|
docker_image:
|
|
description: 'Name of the Docker image'
|
|
required: true
|
|
num_gpus:
|
|
description: 'Type of the number of gpus to use (`single` or `multi`)'
|
|
required: true
|
|
|
|
env:
|
|
HF_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
|
|
HF_HOME: /mnt/cache
|
|
TRANSFORMERS_IS_CI: yes
|
|
OMP_NUM_THREADS: 8
|
|
MKL_NUM_THREADS: 8
|
|
RUN_SLOW: yes # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access. # This token is created under the bot `hf-transformers-bot`.
|
|
TF_FORCE_GPU_ALLOW_GROWTH: true
|
|
CUDA_VISIBLE_DEVICES: 0,1
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
get_runner:
|
|
name: "Get runner to use"
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
|
|
steps:
|
|
- name: Get runner to use
|
|
shell: bash
|
|
env:
|
|
NUM_GPUS: ${{ github.event.inputs.num_gpus }}
|
|
RUNNER_TYPE: ${{ github.event.inputs.runner_type }}
|
|
run: |
|
|
if [[ "$NUM_GPUS" == "single" && "$RUNNER_TYPE" == "a10" ]]; then
|
|
echo "RUNNER=aws-g5-4xlarge-cache-ssh" >> $GITHUB_ENV
|
|
elif [[ "$NUM_GPUS" == "multi" && "$RUNNER_TYPE" == "a10" ]]; then
|
|
echo "RUNNER=aws-g5-12xlarge-cache-ssh" >> $GITHUB_ENV
|
|
else
|
|
echo "RUNNER=" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Set runner to use
|
|
id: set_runner
|
|
run: |
|
|
echo "$RUNNER"
|
|
echo "RUNNER=$RUNNER" >> $GITHUB_OUTPUT
|
|
|
|
ssh_runner:
|
|
name: "SSH"
|
|
needs: get_runner
|
|
runs-on:
|
|
group: ${{ needs.get_runner.outputs.RUNNER }}
|
|
container:
|
|
image: ${{ github.event.inputs.docker_image }}
|
|
steps:
|
|
- name: Update clone
|
|
working-directory: /transformers
|
|
env:
|
|
commit_sha: ${{ github.sha }}
|
|
run: |
|
|
git fetch && git checkout "$commit_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
|
|
|
|
- name: NVIDIA-SMI
|
|
run: |
|
|
nvidia-smi
|
|
|
|
- name: Create python alias
|
|
run: |
|
|
ln -sf $(which python3) /usr/local/bin/python
|
|
ln -sf $(which pip3) /usr/local/bin/pip
|
|
echo "✅ python -> python3 symlink created"
|
|
|
|
- name: Install psutil for memory monitor
|
|
run: |
|
|
pip install psutil --break-system-packages
|
|
|
|
- name: Download memory monitor script
|
|
working-directory: /transformers
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
curl -o memory_monitor.py https://raw.githubusercontent.com/huggingface/transformers/refs/heads/utility_scripts/utils/memory_monitor.py
|
|
|
|
- name: Start memory monitor
|
|
working-directory: /transformers
|
|
continue-on-error: true # Don't fail workflow if monitor has issues
|
|
run: |
|
|
python3 memory_monitor.py --threshold 90 --interval 1 > memory_monitor.log 2>&1 &
|
|
echo $! > memory_monitor.pid
|
|
echo "Memory monitor started with PID $(cat memory_monitor.pid)"
|
|
# Give it a moment to start
|
|
sleep 2
|
|
# Verify it's running
|
|
ps aux | grep memory_monitor | grep -v grep || echo "Warning: memory monitor may not be running"
|
|
|
|
- name: Install utilities
|
|
run: |
|
|
apt-get install -y nano
|
|
|
|
- name: Setup automatic environment for SSH login
|
|
run: |
|
|
# Create shared environment setup
|
|
cat > /root/.env_setup << 'EOF'
|
|
# Auto-setup (non-sensitive vars)
|
|
export HF_HOME=/mnt/cache
|
|
export TRANSFORMERS_IS_CI=yes
|
|
export OMP_NUM_THREADS=8
|
|
export MKL_NUM_THREADS=8
|
|
export RUN_SLOW=yes
|
|
export TF_FORCE_GPU_ALLOW_GROWTH=true
|
|
export CUDA_VISIBLE_DEVICES=0,1
|
|
|
|
cd /transformers 2>/dev/null || true
|
|
|
|
# Remind user to set token if needed
|
|
if [ -z "$HF_TOKEN" ]; then
|
|
echo "⚠️ HF_TOKEN not set. Set it with:"
|
|
echo " export HF_TOKEN=hf_xxxxx"
|
|
else
|
|
echo "✅ HF_TOKEN is set"
|
|
fi
|
|
|
|
echo "📁 Working directory: $(pwd)"
|
|
EOF
|
|
|
|
# Source from both .bash_profile and .bashrc
|
|
echo 'source /root/.env_setup' >> /root/.bash_profile
|
|
echo 'source /root/.env_setup' >> /root/.bashrc
|
|
|
|
- name: Tailscale # In order to be able to SSH when a test fails
|
|
uses: huggingface/tailscale-action@7d53c9737e53934c30290b5524d1c9b4a7c98c8a # main
|
|
with:
|
|
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
|
|
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
|
|
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
|
|
waitForSSH: true
|
|
sshTimeout: 15m
|