Skip to content

Benchmarks: model benchmarks - change torch.distributed.launch to torchrun #175

Benchmarks: model benchmarks - change torch.distributed.launch to torchrun

Benchmarks: model benchmarks - change torch.distributed.launch to torchrun #175

Workflow file for this run

name: Build on Windows and run directx unit test
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
jobs:
docker:
name: Docker build win2004
runs-on: [self-hosted, windows, x64, win2004]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Clearnup docker data
run: |
docker system prune -a -f
docker volume prune -a -f
shell: pwsh
- name: Build Docker image
working-directory: .
shell: pwsh
run: |
docker build `
--file dockerfile/directx12.dockerfile `
--label org.opencontainers.image.source=${{ github.event.repository.html_url }} `
--label org.opencontainers.image.created=${{ github.event.repository.pushed_at }} `
--label org.opencontainers.image.revision=${{ github.sha }} `
--platform windows/amd64 `
--isolation=process `
--tag $env:TAG .
env:
TAG: superbench/main:win2004
- name: Push Docker image
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
run: |
docker login -u $env:USER -p $env:PASS
docker push $env:TAG
docker logout
env:
TAG: superbench/main:win2004
USER: ${{ secrets.DOCKERHUB_USERNAME }}
PASS: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Add bash to PATH
shell: pwsh
run: |
echo "$env:PATH;C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
- name: Bash to get codecov env
run: |
ci_env=`bash <(curl -s https://codecov.io/env)`
echo "ci_env=$ci_env" >> $GITHUB_ENV
shell: bash
- name: Run unit tests inside docker
run: |
$command="curl -s -L https://uploader.codecov.io/latest/windows/codecov.exe -o codecov.exe && python -m pip install .[test] && python -m pytest -v --cov=superbench --cov-report=xml --cov-report=term-missing tests/ -k test_directx && codecov -t ${CODECOV_TOKEN} -cF directx-unit-test"
docker run --rm `
--isolation process `
--device class/5B45201D-F2F2-4F3B-85BB-30FF1F953599 `
-e CI=true $ci_env -e SB_TEST_CUDA="0" -e SB_TEST_ROCM="0" -e SB_TEST_PYTORCH="0" -e SB_TEST_DIRECTX="1" -e CODECOV_TOKEN superbench/main:win2004 cmd /c $command
shell: pwsh
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}