Skip to content

Commit

Permalink
Testing portability tweaks to benchmark_config_test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Nov 4, 2022
1 parent c566e37 commit fd8cbad
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,30 +252,30 @@ jobs:
################################## Subsets ###################################
# Jobs that build some subset of IREE
##############################################################################
build_test_runtime:
needs: setup
if: needs.setup.outputs.should-run == 'true'
runs-on: ubuntu-20.04
env:
BUILD_DIR: build-runtime
steps:
- name: "Checking out repository"
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
- name: "Checking out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- name: "Building runtime"
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/base@sha256:5d43683c6b50aebe1fca6c85f2012f3b0fa153bf4dd268e8767b619b1891423a \
./build_tools/cmake/build_runtime.sh \
"${BUILD_DIR}"
- name: "Testing runtime"
run: |
./build_tools/github_actions/docker_run.sh \
--env IREE_VULKAN_DISABLE=1 \
gcr.io/iree-oss/base@sha256:5d43683c6b50aebe1fca6c85f2012f3b0fa153bf4dd268e8767b619b1891423a \
./build_tools/cmake/ctest_all.sh \
"${BUILD_DIR}"
# build_test_runtime:
# needs: setup
# if: needs.setup.outputs.should-run == 'true'
# runs-on: ubuntu-20.04
# env:
# BUILD_DIR: build-runtime
# steps:
# - name: "Checking out repository"
# uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
# - name: "Checking out runtime submodules"
# run: ./build_tools/scripts/git/update_runtime_submodules.sh
# - name: "Building runtime"
# run: |
# ./build_tools/github_actions/docker_run.sh \
# gcr.io/iree-oss/base@sha256:5d43683c6b50aebe1fca6c85f2012f3b0fa153bf4dd268e8767b619b1891423a \
# ./build_tools/cmake/build_runtime.sh \
# "${BUILD_DIR}"
# - name: "Testing runtime"
# run: |
# ./build_tools/github_actions/docker_run.sh \
# --env IREE_VULKAN_DISABLE=1 \
# gcr.io/iree-oss/base@sha256:5d43683c6b50aebe1fca6c85f2012f3b0fa153bf4dd268e8767b619b1891423a \
# ./build_tools/cmake/ctest_all.sh \
# "${BUILD_DIR}"

build_test_runtime_windows:
needs: setup
Expand Down Expand Up @@ -747,7 +747,7 @@ jobs:
# - test_gpu

# Subsets
- build_test_runtime
# - build_test_runtime
- build_test_runtime_windows

# # Tensorflow
Expand Down
22 changes: 12 additions & 10 deletions build_tools/benchmarks/common/benchmark_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ class BenchmarkConfigTest(unittest.TestCase):
def setUp(self):
self.build_dir = tempfile.TemporaryDirectory()
self.tmp_dir = tempfile.TemporaryDirectory()
self.normal_tool_dir = os.path.join(self.build_dir.name, "normal_tool")
self.normal_tool_dir = os.path.realpath(
os.path.join(self.build_dir.name, "normal_tool"))
os.mkdir(self.normal_tool_dir)
self.traced_tool_dir = os.path.join(self.build_dir.name, "traced_tool")
self.traced_tool_dir = os.path.realpath(
os.path.join(self.build_dir.name, "traced_tool"))
os.mkdir(self.traced_tool_dir)
self.trace_capture_tool = tempfile.NamedTemporaryFile()
os.chmod(self.trace_capture_tool.name, stat.S_IEXEC)
Expand All @@ -44,19 +46,18 @@ def test_build_from_args(self):

config = BenchmarkConfig.build_from_args(args=args, git_commit_hash="abcd")

per_commit_tmp_dir = os.path.join(self.tmp_dir.name, "abcd")
per_commit_tmp_dir = os.path.realpath(
os.path.join(self.tmp_dir.name, "abcd"))
expected_trace_capture_config = TraceCaptureConfig(
traced_benchmark_tool_dir=self.traced_tool_dir,
trace_capture_tool=self.trace_capture_tool.name,
trace_capture_tool=os.path.realpath(self.trace_capture_tool.name),
capture_tarball=os.path.realpath("capture.tar"),
capture_tmp_dir=os.path.join(per_commit_tmp_dir, "captures"))
# DO NOT SUBMIT
print(config)
explicit_config = BenchmarkConfig(
root_benchmark_dir=os.path.join(self.build_dir.name,
"benchmark_suites"),
benchmark_results_dir=os.path.join(per_commit_tmp_dir,
"benchmark-results"),
root_benchmark_dir=os.path.realpath(
os.path.join(self.build_dir.name, "benchmark_suites")),
benchmark_results_dir=os.path.realpath(
os.path.join(per_commit_tmp_dir, "benchmark-results")),
git_commit_hash="abcd",
normal_benchmark_tool_dir=self.normal_tool_dir,
trace_capture_config=expected_trace_capture_config,
Expand All @@ -65,6 +66,7 @@ def test_build_from_args(self):
mode_filter="c",
keep_going=True,
benchmark_min_time=10)
print(config)
print(explicit_config)
self.assertEqual(config, explicit_config)

Expand Down

0 comments on commit fd8cbad

Please sign in to comment.