Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVino GPU single matmul test #379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/ov-gpu-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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
Copy link
Contributor

@dchigarev dchigarev Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also add this step that runs sanity tests for the gpu integration in OV:

OV_MLIR_MODE=GC_GPU ./bin/intel64/Release/ov_gpu_func_tests --gtest_filter=MLIRExecution.*

working-directory: openvino
run: |
pip install openvino torch
for param in 'matmul[512,512,512]' 'matmul[1024,1024,1024]' 'matmul[2048,2048,2048]', 'matmul[4096,4096,4096]' 'matmul[8192,8192,8192]' 'matmul[4096,512,4096]'; do
python3 ./tools/mlir_bench/ov_model_gen.py -l=$param -t f16 -n test.xml
Copy link
Contributor

@dchigarev dchigarev Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the root-cause for the error we see in CI is this bug (#360)

loc(fused<{name = "aten::linear/Add", type = "Add"}>["aten::linear/Add"]): error: operand #0 does not dominate this use

The GPU pipeline is currently not working for models generated by ov_model_gen.py; only simple matmul modules like this are functioning (but I'm already working to fix this)

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=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
Loading