Skip to content

Commit

Permalink
gpu nightly test
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJialei-A committed Oct 15, 2024
1 parent 37a70e6 commit 71a4de7
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .github/workflows/ov-gpu-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: OpenVino GPU Nightly Test

on:
workflow_dispatch:

permissions: read-all

jobs:
nightly:
name: OpenVino GPU Nightly
runs-on: [self-hosted, l0]

env:
GH_TOKEN: ${{ github.token }}

steps:
- name: "Checkout Graph Compiler"
uses: actions/checkout@v4
with:
repository: 'intel/graph-compiler'
path: 'graph-compiler'

- name: Setup MLIR Python bindings
id: setup-mlir-python-bindings
uses: ./graph-compiler/.github/actions/setup-mlir-python-bindings

- name: Build LLVM with IMEX
working-directory: graph-compiler
run: |
scripts/compile.sh --dev --llvm --imex
echo LLVM_INST_PATH=$(pwd)/externals/llvm-project/build >>$GITHUB_ENV
- name: "Checkout OpenVino"
uses: actions/checkout@v4
with:
repository: 'dchigarev/openvino'
ref: 'gc-gpu'
path: 'openvino'
submodules: true
fetch-depth: 0
recursive: true

- name: Build OpenVino
working-directory: openvino
run: |
cmake -B build -G Ninja -DLLVM_DIR=${LLVM_INST_PATH}/lib/cmake/llvm -DMLIR_DIR=${LLVM_INST_PATH}/lib/cmake/mlir -DENABLE_GRAPH_COMPILER=ON -DENABLE_INTEL_GPU=ON -DENABLE_TESTS=ON
cmake --build build --target all
- name: Benchmark
working-directory: openvino
run: |
for param in 'linear[512,512,512]' 'linear[1024,1024,1024]' 'linear[2048,2048,2048]', 'linear[4096,4096,4096]' 'linear[8192,8192,8192]' 'linear[4096,512,4096]'; do
python3 ./tools/mlir_bench/ov_model_gen.py -l=$param -t f16 -n test.xml
OV_MLIR_MODE=GC_GPU ./bin/intel64/Release/benchmark_app -m ./test.xml -d GPU -use_device_mem -ip f16 -infer_precision f16 -niter 100 -hint none -nstreams 1 -nthreads 1 >tmp
echo 'gc-gpu: ' $param
cat tmp
COMPILE_TIME=$(grep "Compile model took" tmp|tr -cd '0-9.')
FIRST_INFERENCE_TIME=$(grep "First inference took" tmp|tr -cd '0-9.')
THROUGHPUT=$(grep "Throughput" tmp|tr -cd '0-9.')
echo "openvino,$param,$COMPILE_TIME,$FIRST_INFERENCE_TIME,$THROUGHPUT" >> perf.csv
OV_MLIR_MODE=0 ./bin/intel64/Release/benchmark_app -m ./test.xml -d GPU -use_device_mem -ip f16 -infer_precision f16 -niter 100 -hint none -nstreams 1 -nthreads 1 >tmp
echo 'baseline: ' $param
cat tmp
COMPILE_TIME=$(grep "Compile model took" tmp|tr -cd '0-9.')
FIRST_INFERENCE_TIME=$(grep "First inference took" tmp|tr -cd '0-9.')
THROUGHPUT=$(grep "Throughput" tmp|tr -cd '0-9.')
echo "openvino,$param,$COMPILE_TIME,$FIRST_INFERENCE_TIME,$THROUGHPUT" >> perf-baseline.csv
done
- name: Upload Performance Artifact
uses: actions/upload-artifact@v4
with:
name: perf.csv
path: openvino/perf.csv

- name: Upload Baseline Artifact
uses: actions/upload-artifact@v4
with:
name: perf-baseline.csv
path: openvino/perf-baseline.csv
2 changes: 1 addition & 1 deletion scripts/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ build_llvm() {
local llvm_dir="$EXTERNALS_DIR/llvm-project"
LLVM_BUILD_DIR="$llvm_dir/build$BUILD_DIR_SFX"
MLIR_DIR="$LLVM_BUILD_DIR/lib/cmake/mlir"
mkdir -p "$LLVM_BUILD_DIR"

if ! [ -d "$llvm_dir" ]; then
git clone https://github.com/llvm/llvm-project.git
Expand All @@ -126,6 +125,7 @@ build_llvm() {
# build that would break 'git checkout ${LLVM_HASH}')
git checkout -- .
fi
mkdir -p "$LLVM_BUILD_DIR"

git checkout ${LLVM_HASH}
[ -z "$CLEANUP" ] || rm -rf "$LLVM_BUILD_DIR"
Expand Down

0 comments on commit 71a4de7

Please sign in to comment.