diff --git a/.github/workflows/check-deserialize.yml b/.github/workflows/check-deserialize.yml new file mode 100644 index 0000000..a8a546d --- /dev/null +++ b/.github/workflows/check-deserialize.yml @@ -0,0 +1,84 @@ +# Copyright Advanced Micro Devices, Inc. +# SPDX-License-Identifier: MIT + +name: check-deserialize + +on: + pull_request: + paths: + - 'Workloads/**' + - 'src/dnn_benchmarking/graph/**' + - 'tools/check_deserialize.py' + - '.github/workflows/check-deserialize.yml' + push: + branches: [main] + paths: + - 'Workloads/**' + - 'src/dnn_benchmarking/graph/**' + - 'tools/check_deserialize.py' + - '.github/workflows/check-deserialize.yml' + +permissions: + contents: read + +jobs: + check-deserialize: + runs-on: ubuntu-24.04 + timeout-minutes: 180 + steps: + # rocm-sdk-devel unpacks to ~13 GB, same as the `rocm-build` job in + # setup.yml. No submodules: setup_env.py fetches prebuilt ROCm SDK + # wheels, it never builds against the rocm-libraries submodule source. + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /usr/local/.ghcup || true + docker system prune -af || true + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + + - name: Install DVC + run: pip install "dvc[s3]" + + # .dvc/config sets allow_anonymous_login for the S3 remote, so this + # needs no credentials. Total tracked workload size is ~1 MB. + - name: Pull DVC-tracked workloads + run: dvc pull + + - name: Extract workload tarballs + run: | + mkdir -p /tmp/workloads-extracted + find Workloads -iname '*.tar.gz' -print0 \ + | xargs -0 -n1 -I{} tar xzf {} -C /tmp/workloads-extracted + + # --level json only exercises dnn_benchmarking's pure-Python + # GraphLoader, which doesn't know hipDNN's real node contract (tensor + # rank, dtype, connected-components, per-node field constraints). It's + # a fast fail-fast gate for gross JSON/schema errors, not the safety + # net -- that's the opgraph-level check below, which calls real + # hipdnn_frontend and is the only level that has ever caught a graph + # bug in this repo (see the moe.tar.gz fix history). + - name: Fast pre-check (JSON schema only) + run: | + pip install -e . + python tools/check_deserialize.py --level json --src src \ + /tmp/workloads-extracted + + # No GPU required: from_json + validate + build_operation_graph only + # assemble and finalize the backend operation-graph descriptor, no + # plan build or kernel execution. + - name: Build hipDNN (no GPU) + env: + PIP_NO_CACHE_DIR: "1" + run: | + python setup_env.py --gpu-arch gfx90a --workspace .ci-workspace -y + + - name: Check opgraph-level graph deserialization + run: | + .ci-workspace/.venv/bin/python tools/check_deserialize.py \ + --level opgraph /tmp/workloads-extracted diff --git a/Workloads/headline/moe.tar.gz.dvc b/Workloads/headline/moe.tar.gz.dvc index 58a5ec2..7e294de 100644 --- a/Workloads/headline/moe.tar.gz.dvc +++ b/Workloads/headline/moe.tar.gz.dvc @@ -1,5 +1,5 @@ outs: -- md5: 59c000e95380ce937ac5c921879d7a69 - size: 28183 +- md5: d9702d81b85dd61f968c41aa97a748ee + size: 28433 hash: md5 path: moe.tar.gz diff --git a/Workloads/headline/norm.tar.gz.dvc b/Workloads/headline/norm.tar.gz.dvc index fd83ab2..3f7b44a 100644 --- a/Workloads/headline/norm.tar.gz.dvc +++ b/Workloads/headline/norm.tar.gz.dvc @@ -1,5 +1,5 @@ outs: -- md5: 266df8a828a6871f9857dd5b52e4bae7 - size: 6629 +- md5: d12e33a357a93f4609299c978da7cab9 + size: 8159 hash: md5 path: norm.tar.gz diff --git a/Workloads/microbench/cudnn_bench_moe.tar.gz.dvc b/Workloads/microbench/cudnn_bench_moe.tar.gz.dvc index 5290074..3cf5f31 100644 --- a/Workloads/microbench/cudnn_bench_moe.tar.gz.dvc +++ b/Workloads/microbench/cudnn_bench_moe.tar.gz.dvc @@ -1,5 +1,5 @@ outs: -- md5: 8f0a96aa10d5d9b4092158066fdfa752 - size: 13204 +- md5: a20ac7876fbe01986fae74b009e3745d + size: 8855 hash: md5 path: cudnn_bench_moe.tar.gz diff --git a/Workloads/microbench/cudnn_frontend.tar.gz.dvc b/Workloads/microbench/cudnn_frontend.tar.gz.dvc index 20fbdaa..44ab606 100644 --- a/Workloads/microbench/cudnn_frontend.tar.gz.dvc +++ b/Workloads/microbench/cudnn_frontend.tar.gz.dvc @@ -1,5 +1,5 @@ outs: -- md5: ecba7ded7a179bd4f8f64a41341218f8 - size: 10071 +- md5: b004ab3259b8b5591cb33dc40b7db91e + size: 9932 hash: md5 path: cudnn_frontend.tar.gz diff --git a/tools/check_deserialize.py b/tools/check_deserialize.py index 6fcc899..95a1df6 100755 --- a/tools/check_deserialize.py +++ b/tools/check_deserialize.py @@ -54,6 +54,14 @@ def main(): file=sys.stderr, ) return 3 + # This check only exercises from_json/validate/build_operation_graph, + # which assemble the backend graph descriptor from JSON and never + # touch an engine. Engine plugins (HIPBLASLT_ENGINE, MIOPEN_ENGINE, + # ASM_SDPA_ENGINE, ...) are otherwise loaded eagerly on Handle() + # construction and some initialize a real GPU context on load, + # which aborts hard on GPU-less machines/CI runners. Must be called + # before any Handle exists. + hipdnn.set_engine_plugin_paths([], mode=hipdnn.PluginLoadingMode.ABSOLUTE) handle = hipdnn.Handle() ok = fail = 0