Skip to content

Commit

Permalink
Sketch out regression suite
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Aug 24, 2023
1 parent 0828d05 commit 06ad259
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 8 deletions.
11 changes: 10 additions & 1 deletion experimental/regression_suite/ireers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from .compile import (
compile_iree,
)

from .execute import (
benchmark_module,
execute_module,
)

from .fetch import (
fetch_source,
fetch_source_fixture,
)
2 changes: 2 additions & 0 deletions experimental/regression_suite/ireers/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
import pytest


def compile_iree(source, flags):
return "Compiled"
13 changes: 13 additions & 0 deletions experimental/regression_suite/ireers/execute.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception


def execute_module(vmfb, driver, inputs, expected_outputs):
...


def benchmark_module(vmfb, driver, inputs):
...
2 changes: 1 addition & 1 deletion experimental/regression_suite/ireers/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest


def fetch_source(url: str):
def fetch_source_fixture(url: str):
@pytest.fixture
def fetcher(tmp_path_factory, worker_id):
return f"Hi: {tmp_path_factory}, {worker_id}"
Expand Down
2 changes: 1 addition & 1 deletion experimental/regression_suite/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
markers = [
"plat_rdna_vulkan: mark tests as running on AMD RDNA Vulkan device",
"plat_rdna3_vulkan: mark tests as running on AMD RDNA3 Vulkan device",
"presubmit: mark test as running on presubmit",
"unstable_linalg: mark test as depending on unstable, serialized linalg IR",
]
39 changes: 34 additions & 5 deletions experimental/regression_suite/tests/pregenerated/test_llama2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,40 @@
import pytest
from ireers import *

llama2_7b_f16qi4_source = fetch_source("foobar")
llama2_7b_f16qi4_source = fetch_source_fixture("foobar")


@pytest.fixture
def llama2_7b_f16qi4_rdna3_vmfb(llama2_7b_f16qi4_source):
return compile_iree(
llama2_7b_f16qi4_source,
flags=[
"--iree-input-type=none",
"--iree-hal-target-backends=vulkan",
"--iree-llvmcpu-target-cpu-features=host",
"--iree-stream-resource-index-bits=64",
"--iree-vm-target-index-bits=64",
"--iree-vulkan-target-triple=rdna3-unknown-linux",
"--iree-opt-const-expr-hoisting=false",
"--iree-stream-resource-max-allocation-size=3221225472",
],
)


@pytest.mark.plat_rdna_vulkan
@pytest.mark.presubmit
@pytest.mark.unstable_linalg
def test_step_rdna_vulkan(llama2_7b_f16qi4_source):
print("GOOD")
print(llama2_7b_f16qi4_source)
@pytest.mark.plat_rdna3_vulkan
def test_step_rdna3_vulkan(llama2_7b_f16qi4_rdna3_vmfb):
golden_inputs = "TODO"
expected_outputs = "TODO"
execute_module(
llama2_7b_f16qi4_rdna3_vmfb,
driver="vulkan",
inputs=golden_inputs,
expected_outputs=expected_outputs,
)
benchmark_module(
llama2_7b_f16qi4_rdna3_vmfb,
driver="vulkan",
inputs=golden_inputs,
)

0 comments on commit 06ad259

Please sign in to comment.