-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes code duplication and adds regular testing of `test-triton.sh` itself
- Loading branch information
Showing
4 changed files
with
145 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,10 +97,9 @@ jobs: | |
repository: pytorch/pytorch | ||
ref: ${{ inputs.pytorch_ref }} | ||
|
||
- name: Install test dependencies | ||
- name: Install pass_rate dependencies | ||
run: | | ||
pip install pytest pytest-xdist pytest-rerunfailures pytest-select pytest-timeout expecttest defusedxml | ||
pip install git+https://github.com/kwasd/[email protected] | ||
pip install defusedxml | ||
- name: Setup Triton | ||
uses: ./.github/actions/setup-triton | ||
|
@@ -112,117 +111,49 @@ jobs: | |
cd python | ||
lit -v build/*/test | ||
- name: Create directory for tests reports | ||
- name: Create test-triton command line | ||
run: | | ||
mkdir reports | ||
echo "TRITON_TEST_REPORTS=true" >> $GITHUB_ENV | ||
echo "TRITON_TEST_WARNING_REPORTS=true" >> $GITHUB_ENV | ||
echo "TRITON_TEST_REPORTS_DIR=$GITHUB_WORKSPACE/reports" >> $GITHUB_ENV | ||
- name: Enable ignoring test errors | ||
if: inputs.ignore_errors | ||
run: | | ||
echo "TRITON_TEST_IGNORE_ERRORS=true" >> $GITHUB_ENV | ||
- name: Set a default skip list | ||
if: inputs.skip_list == '' | ||
run: | | ||
if [[ -n "${{ inputs.driver_version }}" ]]; then | ||
if [[ -n "${{ inputs.skip_list }}" ]]; then | ||
skiplist="$GITHUB_WORKSPACE/scripts/skiplist/${{ inputs.skip_list }}" | ||
elif [[ -n "${{ inputs.driver_version }}" ]]; then | ||
skiplist="$GITHUB_WORKSPACE/scripts/skiplist/${{ inputs.driver_version }}" | ||
else | ||
skiplist="$GITHUB_WORKSPACE/scripts/skiplist/default" | ||
fi | ||
if [[ -d $skiplist ]]; then | ||
echo "TRITON_TEST_SKIPLIST_DIR=$skiplist" | tee -a $GITHUB_ENV | ||
fi | ||
- name: Set a custom skip list | ||
if: inputs.skip_list != '' | ||
run: | | ||
echo "TRITON_TEST_SKIPLIST_DIR=$GITHUB_WORKSPACE/scripts/skiplist/${{ inputs.skip_list }}" | tee -a $GITHUB_ENV | ||
if [ -d "$skiplist" ]; then | ||
skiplist="--skip-list $skiplist" | ||
else | ||
skiplist= | ||
fi | ||
{ | ||
echo SKIPLIST="$skiplist" | ||
echo TRITON_TEST_CMD="bash -v -x scripts/test-triton.sh --warning-reports --skip-pytorch-install --reports-dir $GITHUB_WORKSPACE/reports --ignore-errors $skiplist" | ||
} | tee -a $GITHUB_ENV | ||
- name: Run core tests | ||
run: | | ||
source ./scripts/pytest-utils.sh | ||
ensure_spirv_dis | ||
cd python/test/unit | ||
${{ env.TRITON_TEST_CMD }} --core | ||
TRITON_TEST_SUITE=language \ | ||
pytest -vvv -n 8 --device xpu language/ --ignore=language/test_line_info.py --ignore=language/test_subprocess.py | ||
TRITON_TEST_SUITE=subprocess \ | ||
pytest -vvv -n 8 --device xpu language/test_subprocess.py | ||
# Run runtime tests serially to avoid race condition with cache handling | ||
TRITON_TEST_SUITE=runtime \ | ||
pytest -vvv --device xpu runtime/ | ||
# Run test_line_info.py separately with TRITON_DISABLE_LINE_INFO=0 | ||
TRITON_TEST_SUITE=line_info \ | ||
TRITON_DISABLE_LINE_INFO=0 \ | ||
pytest -vvv --device xpu language/test_line_info.py | ||
- name: Run instrumentation tests | ||
run: | | ||
source ./scripts/pytest-utils.sh | ||
# FIXME: the "instrumentation" test suite currently contains only one test, when all tests | ||
# are skipped pytest reports an error. If the only test is the skip list, then we shouldn't | ||
# run pytest at all. This must be changed when there is more than one instrumentation test. | ||
if [[ $TEST_UNSKIP = false && -s $TRITON_TEST_SKIPLIST_DIR/instrumentation.txt ]]; then | ||
exit 0 | ||
fi | ||
SHARED_LIB_DIR="${GITHUB_WORKSPACE}/python/build/$(ls python/build | grep -i lib)/triton/_C" | ||
if [ ! -d "${SHARED_LIB_DIR}" ]; then | ||
echo "Could not find '${SHARED_LIB_DIR}'" ; exit -1 | ||
fi | ||
cd python/test/unit | ||
TRITON_TEST_SUITE=instrumentation \ | ||
TRITON_ALWAYS_COMPILE=1 TRITON_DISABLE_LINE_INFO=0 LLVM_PASS_PLUGIN_PATH=${SHARED_LIB_DIR}/libGPUHello.so \ | ||
pytest -vvv --device xpu instrumentation/test_gpuhello.py | ||
- name: Clear cache | ||
- name: Run interpreter tests | ||
run: | | ||
rm -rf ~/.triton | ||
${{ env.TRITON_TEST_CMD }} --interpreter --skip-pip-install | ||
- name: Run interpreter tests | ||
- name: Run Tutorials | ||
run: | | ||
source ./scripts/pytest-utils.sh | ||
cd python/test/unit | ||
TRITON_INTERPRET=1 TRITON_TEST_SUITE=interpreter \ | ||
pytest -vvv -n 16 -m interpreter language/test_core.py language/test_standard.py \ | ||
language/test_random.py --device cpu | ||
${{ env.TRITON_TEST_CMD }} --tutorial --skip-pip-install | ||
- name: Regression tests | ||
- name: Run CXX unittests | ||
run: | | ||
source ./scripts/pytest-utils.sh | ||
cd python/test/regression | ||
TRITON_TEST_SUITE=regression \ | ||
pytest -vvv -s --device xpu . --reruns 10 --ignore=test_performance.py | ||
${{ env.TRITON_TEST_CMD }} --unit --skip-pip-install | ||
- name: Run Tutorials | ||
- name: Run instrumentation tests | ||
run: | | ||
source ./scripts/pytest-utils.sh | ||
cd python/tutorials | ||
run_tutorial_test "01-vector-add" | ||
run_tutorial_test "02-fused-softmax" | ||
run_tutorial_test "03-matrix-multiplication" | ||
run_tutorial_test "04-low-memory-dropout" | ||
run_tutorial_test "05-layer-norm" | ||
run_tutorial_test "06-fused-attention" | ||
run_tutorial_test "07-extern-functions" | ||
run_tutorial_test "08-grouped-gemm" | ||
run_tutorial_test "10-experimental-block-pointer" | ||
run_tutorial_test "10i-experimental-block-pointer" | ||
${{ env.TRITON_TEST_CMD }} --instrumentation --skip-pip-install | ||
- name: Run CXX unittests | ||
- name: Clear cache | ||
run: | | ||
cd python/build/*cmake* | ||
ctest | ||
rm -rf ~/.triton | ||
- name: Get transformers version | ||
run: | | ||
|
@@ -271,9 +202,9 @@ jobs: | |
- name: Pass rate | ||
run: | | ||
source ./scripts/capture-hw-details.sh | ||
python3 scripts/pass_rate.py --reports reports | ||
python3 scripts/pass_rate.py --reports reports --json > pass_rate.json | ||
python3 scripts/pass_rate.py --reports reports --suite tutorials --json > pass_rate_tutorials.json | ||
python3 scripts/pass_rate.py --reports reports ${{ env.SKIPLIST }} | ||
python3 scripts/pass_rate.py --reports reports --json ${{ env.SKIPLIST }} > pass_rate.json | ||
python3 scripts/pass_rate.py --reports reports --suite tutorials --json ${{ env.SKIPLIST }} > pass_rate_tutorials.json | ||
- name: Upload pass rate report | ||
# upload reports only for the default branch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.