Unverified Commit a79bc5c6 authored by Xuehai Pan's avatar Xuehai Pan Committed by GitHub
Browse files

[CI] Fix ROCm CI (#1043)

* [CI] fix ROCm CI

* feat: add a hook to error out on no test runs
parent 1f4ffdb8
...@@ -90,7 +90,7 @@ jobs: ...@@ -90,7 +90,7 @@ jobs:
name: self-hosted-amd name: self-hosted-amd
# Format: [Nightly-]ROCm-<major>.<minor>[.<patch>]. E.g., "ROCm-6.4" or "Nightly-ROCm-7.0". # Format: [Nightly-]ROCm-<major>.<minor>[.<patch>]. E.g., "ROCm-6.4" or "Nightly-ROCm-7.0".
# Use "Nightly-" prefix to use torch nightly builds. # Use "Nightly-" prefix to use torch nightly builds.
toolkit: Nightly-ROCm-7.0 toolkit: ROCm-6.3
- tags: [macos-latest] - tags: [macos-latest]
name: macos-latest name: macos-latest
toolkit: Metal # or Nightly-Metal toolkit: Metal # or Nightly-Metal
...@@ -352,8 +352,6 @@ jobs: ...@@ -352,8 +352,6 @@ jobs:
- name: Run ROCm tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }}) - name: Run ROCm tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }})
id: rocm-tests id: rocm-tests
if: contains(matrix.runner.toolkit, 'ROCm') if: contains(matrix.runner.toolkit, 'ROCm')
# FIXME: ROCm test incorrectly skips tests
continue-on-error: true
run: | run: |
cd testing cd testing
PYTEST=( PYTEST=(
...@@ -362,7 +360,6 @@ jobs: ...@@ -362,7 +360,6 @@ jobs:
) )
"${PYTEST[@]}" --maxfail=3 --numprocesses=4 \ "${PYTEST[@]}" --maxfail=3 --numprocesses=4 \
./python/amd/test_tilelang_test_amd.py ./python/amd/test_tilelang_test_amd.py
echo "::error::ROCm tests are known to be skipped incorrectly due to ROCm TVM build issues." >&2
# Apple Metal tests # Apple Metal tests
- name: Run Metal tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }}) - name: Run Metal tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }})
......
import os import os
import random import random
import pytest
os.environ["PYTHONHASHSEED"] = "0" os.environ["PYTHONHASHSEED"] = "0"
...@@ -18,3 +19,26 @@ except ImportError: ...@@ -18,3 +19,26 @@ except ImportError:
pass pass
else: else:
np.random.seed(0) np.random.seed(0)
def pytest_terminal_summary(terminalreporter, exitstatus, config):
"""Ensure that at least one test is collected. Error out if all tests are skipped."""
known_types = {
"failed",
"passed",
"skipped",
"deselected",
"xfailed",
"xpassed",
"warnings",
"error",
}
if (sum(
len(terminalreporter.stats.get(k, []))
for k in known_types.difference({"skipped", "deselected"})) == 0):
terminalreporter.write_sep(
"!",
(f"Error: No tests were collected. "
f"{dict(sorted((k, len(v)) for k, v in terminalreporter.stats.items()))}"),
)
pytest.exit("No tests were collected.", returncode=5)
import os import os
import random import random
import pytest
os.environ["PYTHONHASHSEED"] = "0" os.environ["PYTHONHASHSEED"] = "0"
...@@ -18,3 +19,26 @@ except ImportError: ...@@ -18,3 +19,26 @@ except ImportError:
pass pass
else: else:
np.random.seed(0) np.random.seed(0)
def pytest_terminal_summary(terminalreporter, exitstatus, config):
"""Ensure that at least one test is collected. Error out if all tests are skipped."""
known_types = {
"failed",
"passed",
"skipped",
"deselected",
"xfailed",
"xpassed",
"warnings",
"error",
}
if (sum(
len(terminalreporter.stats.get(k, []))
for k in known_types.difference({"skipped", "deselected"})) == 0):
terminalreporter.write_sep(
"!",
(f"Error: No tests were collected. "
f"{dict(sorted((k, len(v)) for k, v in terminalreporter.stats.items()))}"),
)
pytest.exit("No tests were collected.", returncode=5)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment