Skip to content

Commit 50da997

Browse files
[Intel] Move UTs to third_party/intel (#3104)
Similar to AMD, this PR moves unit tests added downstream only to `third_party/intel`. Signed-off-by: Whitney Tsang <[email protected]>
1 parent 36aa1cc commit 50da997

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

scripts/test-triton.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ run_core_tests() {
203203

204204
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=tools \
205205
pytest --verbose tools/
206+
207+
cd $TRITON_PROJ/third_party/intel/python/test
208+
TRITON_DISABLE_LINE_INFO=1 TRITON_TEST_SUITE=third_party \
209+
pytest --device xpu .
206210
}
207211

208212
run_regression_tests() {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import pytest
3+
import tempfile
4+
5+
6+
def pytest_addoption(parser):
7+
parser.addoption("--device", action="store", default="cuda")
8+
9+
10+
@pytest.fixture
11+
def device(request):
12+
return request.config.getoption("--device")
13+
14+
15+
@pytest.fixture
16+
def fresh_triton_cache():
17+
try:
18+
with tempfile.TemporaryDirectory() as tmpdir:
19+
try:
20+
os.environ["TRITON_CACHE_DIR"] = tmpdir
21+
yield tmpdir
22+
finally:
23+
os.environ.pop("TRITON_CACHE_DIR", None)
24+
except OSError:
25+
# Ignore errors, such as PermissionError, on Windows
26+
pass

0 commit comments

Comments
 (0)