main #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
pull_request: | |
paths: | |
- "README.md" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
issues: write | |
jobs: | |
unit-tests: | |
runs-on: [self-hosted, intel] | |
container: | |
image: intel/intel-extension-for-pytorch:2.1.20-xpu | |
ports: | |
- 80 | |
options: --privileged -it --rm --device /dev/dri:/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --ipc=host --cap-add=ALL | |
env: | |
TEST_LIST: | | |
test_accelerator.py | |
steps: | |
- uses: actions/checkout@v3 | |
- name: hello CI world | |
shell: bash | |
run: | | |
pwd | |
ls | |
- name: Check container state | |
shell: bash | |
run: | | |
ldd --version | |
python -c "import torch; print('torch:', torch.__version__, torch)" | |
python -c "import torch; import intel_extension_for_pytorch; print('XPU available:', torch.xpu.is_available())" | |
- name: Install transformers | |
run: | | |
git clone https://github.com/huggingface/transformers | |
cd transformers | |
git rev-parse --short HEAD | |
pip install . | |
- name: Install deepspeed | |
run: | | |
pip install py-cpuinfo | |
pip install deepspeed | |
ds_report | |
- name: Python environment | |
run: | | |
pip list | |
- name: Unit tests | |
run: | | |
pip install pytest | |
git clone https://github.com/microsoft/DeepSpeed.git | |
cd DeepSpeed/tests | |
TEST_LIST=$(echo "$TEST_LIST" | awk 'NF{printf "%s%s", (NR>1 ? " or " : ""), $0} END{if (NR>1) print ""}') | |
echo "TEST_LIST ${TEST_LIST}" | |
pytest --verbose unit/accelerator -k "${TEST_LIST}" |