Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable and Fix Environment Examples in CMake CI #642

13 changes: 2 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,6 @@ jobs:
test ./examples/loop_optimizations_service/opt_loops/opt_loops
shell: bash

- name: Run environment examples
run: |
cd examples
python example_compiler_gym_service/demo_without_bazel.py
python example_unrolling_service/example_without_bazel.py
python loop_optimizations_service/example_without_bazel.py
cd -
shell: bash

- name: Run the test suite
run: make install-test PYTEST_ARGS="--ignore tests/mlir"

Expand Down Expand Up @@ -627,7 +618,7 @@ jobs:
run: make -C examples install

- name: Run the test suite
run: make -C examples test
run: make -C examples test PYTEST_ARGS="--ignore example_unrolling_service --ignore loop_optimizations_service"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -662,7 +653,7 @@ jobs:
run: make -C examples install

- name: Run the test suite
run: make -C examples test
run: make -C examples test PYTEST_ARGS="--ignore example_unrolling_service --ignore loop_optimizations_service"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down
13 changes: 9 additions & 4 deletions examples/example_unrolling_service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""This module defines and registers the example gym environments."""
import os
import subprocess
from pathlib import Path
from typing import Iterable
Expand All @@ -13,17 +14,24 @@
from compiler_gym.spaces import Reward
from compiler_gym.third_party import llvm
from compiler_gym.util.registration import register
from compiler_gym.util.runfiles_path import runfiles_path, site_data_path
from compiler_gym.util.runfiles_path import runfiles_path

UNROLLING_PY_SERVICE_BINARY: Path = runfiles_path(
"examples/example_unrolling_service/service_py/example-unrolling-service-py"
)

BENCHMARKS_PATH: Path = runfiles_path("examples/example_unrolling_service/benchmarks")
if not os.path.exists(BENCHMARKS_PATH):
BENCHMARKS_PATH = Path("example_unrolling_service/benchmarks")


NEURO_VECTORIZER_HEADER: Path = runfiles_path(
"compiler_gym/third_party/neuro-vectorizer/header.h"
)
if not os.path.exists(NEURO_VECTORIZER_HEADER):
NEURO_VECTORIZER_HEADER: Path = Path(
"../compiler_gym/third_party/neuro-vectorizer/header.h"
)


class RuntimeReward(Reward):
Expand Down Expand Up @@ -84,9 +92,6 @@ def __init__(self, *args, **kwargs):
name="benchmark://unrolling-v0",
license="MIT",
description="Unrolling example dataset",
site_data_base=site_data_path(
"example_dataset"
), # TODO: what should we set this to? we are not using it
)

self._benchmarks = {
Expand Down
Loading