Skip to content

[ci] Add workflows to validate TE QA test cases #3

[ci] Add workflows to validate TE QA test cases

[ci] Add workflows to validate TE QA test cases #3

name: QA L3 Pytorch FA Versions Test
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.actor }}
cancel-in-progress: true
jobs:
qa-l3-pytorch-FA-versions-test:
runs-on: [ self-hosted, Linux, X64, nvida, gpu-8 ]
defaults:
run:
shell: bash
container:
image: harbor.baai.ac.cn/flagscale/cuda12.8.1-cudnn9.10.2-torch2.9.1-py3.10-transformerengine_fl:20260204
ports:
- 80:80
options: >-
--gpus all
--shm-size=500g
--privileged
--ipc=host
--ulimit memlock=-1
--ulimit stack=67108864
--ulimit nofile=65535:65535
--user root
--pull always
steps:
- name: Checkout Code
uses: actions/checkout@v6.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
ssh-strict: true
ssh-user: git
persist-credentials: true
clean: true
sparse-checkout-cone-mode: true
fetch-tags: false
show-progress: true
lfs: false
submodules: recursive
set-safe-directory: true
- name: Pre-Check Environment
timeout-minutes: 5
run: |
set -euo pipefail
echo "===== System Info ====="
uname -a
python3 --version || (echo "❌ python3 not found"; exit 1)
pip3 --version || (echo "❌ pip3 not found"; exit 1)
echo "===== GPU Info ====="
if command -v nvidia-smi &>/dev/null; then
nvidia-smi --query-gpu=index,name,memory.total,utilization.gpu --format=csv
else
echo "⚠️ GPU check skipped. nvidia-smi is not available in the current environment."
exit 1
fi
nvcc --version || echo "⚠️ nvcc not found (non-fatal for python-only install)"
echo "===== Disk Space ====="
df -h
echo "===== Available memory ====="
free -h
- name: Install dependencies and build transformer_engine
timeout-minutes: 30
run: |
apt update
apt install -y wget
echo "\n=============== Install transformer_engine ==============="
pip install --no-build-isolation -vvv . --no-deps
cp -rf transformer_engine/plugins/ /usr/local/lib/python3.10/dist-packages/transformer_engine/plugins/
- name: Verify installation
shell: bash
run: |
python3 tests/pytorch/test_sanity_import.py
- name: GPU Usage Check / Verification
run: |
source .github/workflows/scripts/gpu_check.sh
wait_for_gpu
- name: QA L3 Pytorch FA Versions Test
id: L3_pytorch_FA_versions_test
timeout-minutes: 30
env:
XML_LOG_DIR: "/logs/pytorch/attention"
TE_PATH: .
MAX_JOBS: 32
run: |
mkdir -p "$XML_LOG_DIR"
pip3 install pytest==8.2.1
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention/ && git checkout 27f501d && cd hopper/ && python setup.py install
python_path=`python -c "import site; print(site.getsitepackages()[0])"`
mkdir -p $python_path/flash_attn_3
wget -P $python_path/flash_attn_3 https://raw.githubusercontent.com/Dao-AILab/flash-attention/27f501dbe011f4371bff938fe7e09311ab3002fa/hopper/flash_attn_interface.py
cd ../../
# Run tests
NVTE_TORCH_COMPILE=0 python3 -m pytest -v -s --junitxml=$XML_LOG_DIR/pytest.xml $TE_PATH/tests/pytorch/attention/test_attention.py
- name: Upload Installation Logs
if: always() && steps.L3_pytorch_FA_versions_test.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: L3_pytorch-logs-${{ github.run_id }}
path: /logs/pytorch/attention
retention-days: 7
if-no-files-found: warn