From 57b4a8e98d2c29cadbb58ddce14ea2a605905516 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Sat, 27 Jul 2024 17:07:50 +0800 Subject: [PATCH] assert process replay asserts (#5737) * assert process replay asserts * one ci job is fine * test: Revert "separate process replay main loop (#5734)" This reverts commit 94d578396f3a50faeb7f2bfaf637074cccc39c58. * mac sed needs that * Revert "test: Revert "separate process replay main loop (#5734)"" This reverts commit e4ad7684d5472a64841a66b43bc1db7c9bbbf9e8. * disable process replay capture * save time * amd is tiny * send to /dev/null --- .github/workflows/test.yml | 3 +++ test/external/process_replay/test_process_replay.sh | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 test/external/process_replay/test_process_replay.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cbd7ab7b2e..12d9ae0726 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -508,6 +508,9 @@ jobs: run: TRANSCENDENTAL=2 python -m pytest -n=auto test/test_ops.py::TestOps::test_sin test/test_ops.py::TestOps::test_cos test/test_ops.py::TestOps::test_tan test/test_ops.py::TestOps::test_exp test/test_ops.py::TestOps::test_log --durations=20 - name: Run process replay tests run: | + if [ "${{ matrix.backend }}" == "amd" ]; then + MAX_DIFF_PCT=1 RUN_PROCESS_REPLAY=0 test/external/process_replay/test_process_replay.sh + fi export PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH") export COMMIT_MESSAGE=$(git show -s --format=%B ${{ github.event.pull_request.head.sha }}) cp test/external/process_replay/process_replay.py ./process_replay.py && git fetch origin master && git -c advice.detachedHead=false checkout origin/master && PYTHONPATH=. python3 process_replay.py diff --git a/test/external/process_replay/test_process_replay.sh b/test/external/process_replay/test_process_replay.sh new file mode 100755 index 0000000000..79a2093ae1 --- /dev/null +++ b/test/external/process_replay/test_process_replay.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# should assert +sed -i 's/temp/temp1/g' ./tinygrad/codegen/lowerer.py +ASSERT_PROCESS_REPLAY=1 python3 test/external/process_replay/process_replay.py &> /dev/null +if [[ $? -eq 0 ]]; then + echo "PROCESS REPLAY IS WRONG." + exit 1 +fi +# should NOT assert +git stash > /dev/null +ASSERT_PROCESS_REPLAY=1 python3 test/external/process_replay/process_replay.py &> /dev/null