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

CompilerGym Release v0.2.0 #439

Merged
merged 6 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ name: Build Binaries

on:
workflow_dispatch:
pull_request:
branches: [stable]
push:
branches: [stable]

jobs:
build:
Expand Down Expand Up @@ -49,7 +53,7 @@ jobs:
if-no-files-found: error
retention-days: 14

test:
examples-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -89,5 +93,5 @@ jobs:
- name: Install test dependencies
run: python -m pip install -r examples/requirements.txt -r tests/requirements.txt

- name: Run the test suite
run: make install-test
- name: Run the examples tests
run: make examples-test
14 changes: 4 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
run: python -m pip install -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov TEST_TARGET="tests" PYTEST_ARGS="--ignore tests/llvm --ignore tests/gcc --ignore tests/loop_tool"
run: make install-test-cov PYTEST_ARGS="--ignore tests/llvm --ignore tests/gcc --ignore tests/loop_tool"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
run: python -m pip install -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov TEST_TARGET="tests" PYTEST_ARGS="--ignore tests/llvm --ignore tests/gcc"
run: make install-test-cov PYTEST_ARGS="--ignore tests/llvm --ignore tests/gcc"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -468,17 +468,14 @@ jobs:
run: python -m pip install -r examples/requirements.txt -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov TEST_TARGET="examples"
run: make examples-test

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true

- name: Run the tests in the source tree
run: cd examples && pytest .

test-examples-macos:
needs: build-macos
runs-on: macos-latest
Expand Down Expand Up @@ -509,17 +506,14 @@ jobs:
run: python -m pip install -r examples/requirements.txt -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov TEST_TARGET="examples"
run: make examples-test

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true

- name: Run the tests in the source tree
run: cd examples && pytest .

build-asan-llvm-service:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__
.coverage*
.DS_Store
.env
/.act
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
## Release 0.2.0 (2021-09-28)

This release adds two new compiler optimization problems to CompilerGym: GCC
command line flag optimization and CUDA loop nest optimization.

- **[GCC]** A new `gcc-v0` environment, authored by @hughleat, exposes the
command line flags of [GCC](https://gcc.gnu.org/) as a reinforcement learning
environment. GCC is a production-grade compiler for C and C++ used throughout
industry. The environment provides several datasets and a large, high
dimensional action space that works on several GCC versions. For further
details check out the [reference
documentation](https://facebookresearch.github.io/CompilerGym/envs/gcc.html).
- **[loop_tool]** A new `loop_tool-v0` environment, authored by @bwasti,
provides an experimental intermediate representation of *n*-dimensional data
computation that can be lowered to both CPU and GPU backends. This provides a
reinforcement learning environment for manipulating nests of loop computations
to maximize throughput. For further details check out the [reference
documentation](https://facebookresearch.github.io/CompilerGym/envs/loop_tool.html).

Other highlights of this release include:

- **[Docker]** Published a
[chriscummins/compiler_gym](https://hub.docker.com/repository/docker/chriscummins/compiler_gym)
docker image that can be used to run CompilerGym services in standalone
isolated containers
([#424](https://github.com/facebookresearch/CompilerGym/pull/424)).
- **[LLVM]** Fixed a bug in the experimental `Runtime` observation space that
caused observations to slow down over time
([#398](https://github.com/facebookresearch/CompilerGym/pull/398)).
- **[LLVM]** Added a new utility module to compute observations from bitcodes
([#405](https://github.com/facebookresearch/CompilerGym/pull/405)).
- Overhauled the continuous integration services to reduce computational
requirements by 59.4% while increasing test coverage
([#392](https://github.com/facebookresearch/CompilerGym/pull/392)).
- Improved error reporting if computing an observation fails
([#380](https://github.com/facebookresearch/CompilerGym/pull/380)).
- Changed the return type of `compiler_gym.random_search()` to a `CompilerEnv`
([#387](https://github.com/facebookresearch/CompilerGym/pull/387)).
- Numerous other bug fixes and improvements.

Many thanks to code contributors: @thecoblack, @bwasti, @hughleat, and
@sahirgomez1!


## Release 0.1.10 (2021-09-08)

This release lays the foundation for several new exciting additions to
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ authors:
- family-names: "Leather"
given-names: "Hugh"
title: "CompilerGym"
version: 0.1.10
date-released: 2021-09-08
version: 0.2.0
date-released: 2021-09-28
url: "https://github.com/facebookresearch/CompilerGym"
preferred-citation:
type: article
Expand Down
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Post-installation Tests
the fuzz tests for a minimum of one minute. This requires that the
CompilerGym package has been installed (`make install`).

make examples-test
Run pytest in the examples directory. This requires that the CompilerGym
package has been installed (`make install`).


Documentation
-------------
Expand Down Expand Up @@ -302,18 +306,21 @@ itest: bazel-fetch
# symlinking the test directory into it so that pytest can be invoked.
install-test-setup:
mkdir -p "$(INSTALL_TEST_ROOT)"
rm -f "$(INSTALL_TEST_ROOT)/examples" "$(INSTALL_TEST_ROOT)/tests" "$(INSTALL_TEST_ROOT)/tox.ini"
ln -s "$(ROOT)/examples" "$(INSTALL_TEST_ROOT)"
rm -f "$(INSTALL_TEST_ROOT)/tests" "$(INSTALL_TEST_ROOT)/tox.ini"
ln -s "$(INSTALL_TEST_ROOT)"
ln -s "$(ROOT)/tests" "$(INSTALL_TEST_ROOT)"
ln -s "$(ROOT)/tox.ini" "$(INSTALL_TEST_ROOT)"

define pytest
cd "$(INSTALL_TEST_ROOT)" && pytest $(if $(TEST_TARGET),$(TEST_TARGET),examples tests) $(1) $(PYTEST_ARGS)
cd "$(INSTALL_TEST_ROOT)" && pytest $(if $(TEST_TARGET),$(TEST_TARGET),tests) $(1) $(PYTEST_ARGS)
endef

install-test: install-test-setup
install-test: | install-test-setup
$(call pytest,--no-success-flaky-report --benchmark-disable -n auto -k "not fuzz" --durations=5)

examples-test:
cd examples && pytest --no-success-flaky-report --benchmark-disable -n auto --durations=5 . --cov=compiler_gym --cov-report=xml:$(COV_REPORT) $(PYTEST_ARGS)

# Note we export $CI=1 so that the tests always run as if within the CI
# environement. This is to ensure that the reported coverage matches that of
# the value on: https://codecov.io/gh/facebookresearch/CompilerGym
Expand All @@ -331,7 +338,7 @@ post-install-test:
$(MAKE) -C examples/makefile_integration clean
SEARCH_TIME=3 $(MAKE) -C examples/makefile_integration test

.PHONY: test post-install-test
.PHONY: test post-install-test examples-test


################
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.10
0.2.0