Skip to content

Commit

Permalink
Merge branch 'main' into guzhao/generate-baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshzhao authored Nov 22, 2023
2 parents 5eb5320 + f53d941 commit fea58d5
Show file tree
Hide file tree
Showing 161 changed files with 17,744 additions and 308 deletions.
6 changes: 4 additions & 2 deletions .azure-pipelines/cuda-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pool:

container:
image: nvcr.io/nvidia/pytorch:20.12-py3
options: '-v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker'
options: '-v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/:/usr/lib/sudo/'

steps:
- script: |
Expand All @@ -21,6 +21,8 @@ steps:
python3 -m pip install --upgrade pip setuptools==65.7
python3 -m pip install .[test,nvworker]
make postinstall
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswresample-dev
displayName: Install dependencies
- script: |
python3 setup.py lint
Expand All @@ -31,7 +33,7 @@ steps:
- script: |
SB_MICRO_PATH=$PWD python3 setup.py test
displayName: Run unit tests
timeoutInMinutes: 15
timeoutInMinutes: 30
- script: |
bash <(curl -s https://codecov.io/bash) -cF cuda-unit-test
displayName: Report coverage results
Expand Down
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ coverage:
- cpu-python3.6-unit-test
- cpu-python3.7-unit-test
- cuda-unit-test
- directx-unit-test
patch:
default:
target: 80%
Expand All @@ -25,3 +26,4 @@ coverage:
- cpu-python3.6-unit-test
- cpu-python3.7-unit-test
- cuda-unit-test
- directx-unit-test
17 changes: 14 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
strategy:
matrix:
include:
- name: cuda11.8
dockerfile: cuda11.8
tags: superbench/main:cuda11.8
- name: cuda12.1
dockerfile: cuda12.1
tags: superbench/main:cuda12.1
- name: cuda11.1.1
dockerfile: cuda11.1.1
tags: superbench/main:cuda11.1.1,superbench/superbench:latest
Expand Down Expand Up @@ -64,6 +64,17 @@ jobs:
sudo apt-get clean
sudo docker rmi $(sudo docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="node" --filter=reference="buildpack-deps")
df -h
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
uses: hirnidrin/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
# All of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Prepare metadata
id: metadata
run: |
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build on Windows and run directx unit test

on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*

jobs:
docker:
name: Docker build win directx12
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: Set TAG variable based on the branch
run: |
if ($env:GITHUB_EVENT_NAME -match "release") {
$version = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1)
echo "TAG=superbench/superbench:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} elseif ($env:GITHUB_REF -match "refs/heads/release/(.*)") {
$version = $Matches[1]
echo "TAG=superbench/release:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} elseif ($env:GITHUB_BASEREF -match "release/(.*)"){
$version = $Matches[1]
echo "TAG=superbench/release:$version-directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "TAG=superbench/main:directx12" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
shell: pwsh
env:
GITHUB_REF: ${{ github.ref }}
GITHUB_BASEREF: ${{ github.base_ref }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
- 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: ${{ env.TAG }}
- 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: ${{ env.TAG }}
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 `
-v C:/Windows/System32/DriverStore:C:/Windows/System32/DriverStore `
-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 --entrypoint "cmd" $env:TAG "/c python dockerfile/directx/enable-graphics-apis.py && cmd /c $command"
shell: pwsh
env:
TAG: ${{ env.TAG }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependency
run: |
DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswresample-dev sudo
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
76 changes: 73 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -141,3 +138,76 @@ dmypy.json

# Cython debug symbols
cython_debug/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio 2015/2017 cache/options directory
.vs/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio code coverage results
*.coverage
*.coveragexml

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ cppformat:
cppbuild:
cd ./superbench/benchmarks/ && bash build.sh

directxbuild:
cd ./superbench/benchmarks/ && build.bat

thirdparty:
cd ./third_party/ && make all

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

__SuperBench__ is a validation and profiling tool for AI infrastructure.

📢 [v0.7.0](https://github.com/microsoft/superbenchmark/releases/tag/v0.7.0) has been released!
📢 [v0.9.0](https://github.com/microsoft/superbenchmark/releases/tag/v0.9.0) has been released!

## _Check [aka.ms/superbench](https://aka.ms/superbench) for more details._

Expand Down
9 changes: 7 additions & 2 deletions dockerfile/cuda11.1.1.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM nvcr.io/nvidia/pytorch:20.12-py3
# - HPC-X: v2.8.3
# - NCCL RDMA SHARP plugins: 7cccbc1
# Intel:
# - mlc: v3.9a
# - mlc: v3.10

LABEL maintainer="SuperBench"

Expand All @@ -26,13 +26,18 @@ RUN apt-get update && \
build-essential \
curl \
dmidecode \
ffmpeg \
git \
iproute2 \
jq \
libaio-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libcap2 \
libnuma-dev \
libpci-dev \
libswresample-dev \
libtinfo5 \
libtool \
lshw \
Expand Down Expand Up @@ -106,7 +111,7 @@ RUN cd /tmp && \

# Install Intel MLC
RUN cd /tmp && \
wget -q https://downloadmirror.intel.com/736634/mlc_v3.9a.tgz -O mlc.tgz && \
wget -q https://downloadmirror.intel.com/763324/mlc_v3.10.tgz -O mlc.tgz && \
tar xzf mlc.tgz Linux/mlc && \
cp ./Linux/mlc /usr/local/bin/ && \
rm -rf ./Linux mlc.tgz
Expand Down
Loading

0 comments on commit fea58d5

Please sign in to comment.