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 v0.2.4 #686

Merged
merged 207 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
e6130db
Merge pull request #632 from facebookresearch/stable
ChrisCummins Mar 18, 2022
e785540
Refactor out Env interface from CompilerEnv
sogartar Mar 5, 2022
ecf42fb
Rename CompilerEnv to ClientServiceCompilerEnv
sogartar Mar 22, 2022
4a79017
Rename Env to CompilerEnv
sogartar Mar 22, 2022
1e6595e
Extend CompilerEnv interface
sogartar Mar 23, 2022
d667d7f
Rename back some occurrences of ClientServiceCompilerEnv to CompilerEnv
sogartar Mar 23, 2022
f760d42
Move ClientServiceCompilerEnv to service
sogartar Mar 24, 2022
621cace
Edit documentation for CompilerEnv and ClientServiceCompilerEnv
sogartar Mar 24, 2022
2acd700
Remove duplicate benchmark property from ClientServiceCompilerEnv
sogartar Mar 24, 2022
6cf4926
[docs] Update CompilerGym overview diagram.
ChrisCummins Mar 25, 2022
2b041d6
Add missing methods to CompilerEnv
sogartar Mar 25, 2022
b7f0ac0
Rename in a few places ClientServiceCompilerEnv to CompilerEnv
sogartar Mar 25, 2022
33a17cc
Add ClientServiceCompilerEnv to documentation
sogartar Mar 25, 2022
4715691
Remove comments of some members in ClientServiceCompilerEnv
sogartar Mar 25, 2022
64f3ef2
Add expected warning in test_wrapped_set_benchmark
sogartar Mar 25, 2022
4230f9f
Use convert_observation in ConcatActionsHistogram
sogartar Mar 26, 2022
165b385
Add reference to PR in a comment about circular dependency
sogartar Mar 28, 2022
3b9518a
Fix implementation of inheritace from ObservationWrapper and RewardWr…
sogartar Mar 28, 2022
3c21aee
Merge pull request #633 from sogartar/refactor-out-env-iface
ChrisCummins Mar 29, 2022
c3cae40
Make action spaces and action service message conversion configurable…
sogartar Mar 5, 2022
86e69f0
Add trivial conversion of np.int32 and np.float32 in service message …
sogartar Mar 31, 2022
08aea9a
Add dispatching on type_id during action and observation conversion
sogartar Mar 5, 2022
e6345f6
Include name in space comparison
sogartar Mar 5, 2022
58664ac
Add permutation and space sequence spaces
sogartar Mar 5, 2022
5d420f5
Add space equality tests and fix some tests
sogartar Apr 2, 2022
6fff7e2
Add docstring to TypeIdDispatchConverter
sogartar Apr 2, 2022
06696c7
Add docstring for ServiceMessageConverters
sogartar Apr 2, 2022
1a2d063
Fix formatting in compiler_gym/service/proto/CMakeLists.txt
sogartar Apr 2, 2022
1da67b5
Add SpaceSequenceSpace to documentation
sogartar Apr 2, 2022
d95c95a
Add documentation and tests
sogartar Apr 2, 2022
13658f7
Merge pull request #641 from sogartar/service-msg-conv
ChrisCummins Apr 2, 2022
c67e689
Update go package install steps.
ChrisCummins Apr 2, 2022
783f8ab
Pin version of `click`.
ChrisCummins Apr 2, 2022
eba52ad
Bump pre-commit black version.
ChrisCummins Apr 2, 2022
1a80f82
Remove double-dependency on black.
ChrisCummins Apr 2, 2022
7618154
Pin back setuptools.
ChrisCummins Apr 2, 2022
91b7452
Bump yamlfmt.
ChrisCummins Apr 2, 2022
dfe7a3a
Run pre-commit on all files.
ChrisCummins Apr 2, 2022
e579747
Remove setuptools version pin.
ChrisCummins Apr 2, 2022
17ff38e
Fix tests
sogartar Apr 4, 2022
395da4e
Fix docstring example for TypeIdDispatchConverter
sogartar Apr 4, 2022
61cff50
Merge pull request #644 from sogartar/include-name-in-space-comp
ChrisCummins Apr 6, 2022
7fd6232
Merge pull request #647 from ChrisCummins/fix/646
ChrisCummins Apr 6, 2022
61f460f
Merge pull request #643 from sogartar/type-id-dispatch
ChrisCummins Apr 8, 2022
fdbbaae
Merge branch 'development' into perm-space-seq
ChrisCummins Apr 8, 2022
b803856
Merge pull request #645 from sogartar/perm-space-seq
ChrisCummins Apr 13, 2022
d5e1dc1
Create an MLIR environment with matrix multiplication
sogartar Mar 18, 2022
264afa0
Add to libLLVMPolly.so python package when LLVM env is enabled
sogartar Apr 14, 2022
a0d1287
Fix CMake LLVM version selection
sogartar Apr 14, 2022
1ecb8c8
Disable MLIR tests in CI
sogartar Apr 14, 2022
08b323e
README: Add a "News & Events" section.
ChrisCummins Apr 18, 2022
dc0a726
Update runfiles_path.py
uduse Apr 18, 2022
89b6bfa
Bump LLVM version for MLIR env to 14.0.0
sogartar Apr 19, 2022
34712e9
Merge pull request #655 from ChrisCummins/feature/news-events
ChrisCummins Apr 19, 2022
5fbf88d
[tests] Mark runtime test as flaky.
ChrisCummins Apr 19, 2022
32872c6
Include clang, MLIRExecutionEngine and Google benchmark python package
sogartar Apr 20, 2022
8fa799f
Add building and testing of MLIR env to CI
sogartar Apr 20, 2022
04b228f
Fix auto-formatting for some files
sogartar Apr 20, 2022
a6198bb
Make CMake to always echo commands to stdout that are ran with execut…
sogartar Apr 20, 2022
4062a8c
Disable loop_optimizations_service examples when LLVM env is disabled
sogartar Apr 20, 2022
0dcc69e
Remove pre-commit instructions from Install.md
sogartar Apr 20, 2022
0baff62
Remove data dependency of random_search to llvm::service
sogartar Apr 20, 2022
fee91d2
In print_service_capabilities print type name of unspupported action …
sogartar Apr 20, 2022
044e5c6
Remove commented out code and fix comments
sogartar Apr 20, 2022
3815a0a
[llvm] Add a retry loop for system compiler timeouts.
ChrisCummins Apr 19, 2022
038404c
Merge pull request #656 from uduse/patch-2
ChrisCummins Apr 20, 2022
344e08d
attempt for #451
SoumyajitKarmakar Apr 2, 2022
f72c054
Added some unit tests for the new features
SoumyajitKarmakar Apr 14, 2022
594095f
Fixed the mistakes
SoumyajitKarmakar Apr 16, 2022
9dec64d
Allow string comparison with ObservationSpaceSpec.
ChrisCummins Apr 20, 2022
4c69c97
[tests] Fix reset() argument tests.
ChrisCummins Apr 20, 2022
bc23af3
Add clang include files to MLIR env package and add libstdc++ as a ru…
sogartar Apr 20, 2022
8b9d38a
In CI install libstdc++ as root
sogartar Apr 20, 2022
b033561
Add ray to python test dependencies
sogartar Apr 20, 2022
23fd5d0
Fix dependency to Ray's rllib and tune
sogartar Apr 20, 2022
68a78df
Shutdown Ray before initializing it in test_ppo_train_smoke
sogartar Apr 20, 2022
67fb8ec
In MLIR test_ppo_train_smoke make wrapper env compilant with Gym
sogartar Apr 21, 2022
5812027
In MLIR's test_ppo_train_smoke move Ray init before registering the env
sogartar Apr 21, 2022
18da6d9
Merge pull request #658 from ChrisCummins/fix/657
ChrisCummins Apr 21, 2022
01c42f0
Merge pull request #659 from ChrisCummins/feature/451
ChrisCummins Apr 21, 2022
d4dd586
Increase MLIR compilation timeout from 60 to 120 seconds
sogartar Apr 21, 2022
2c97d51
In MLIR's test_ppo_train_smoke disable deprication warning comming fr…
sogartar Apr 21, 2022
7f44d65
Ignore more warning in test_ppo_train_smoke
sogartar Apr 21, 2022
b2539f3
Improve the exec logging message.
ChrisCummins Apr 19, 2022
15bbfd5
Merge pull request #661 from ChrisCummins/feature/exec-logging
ChrisCummins Apr 21, 2022
ab1e1d0
Fix Py < 3.8 compatibility for shlex.join().
ChrisCummins Apr 19, 2022
4793bed
[service] Use join_cmd() over shlex.join().
ChrisCummins Apr 19, 2022
66bea84
Merge pull request #663 from ChrisCummins/feature/exec-logging
ChrisCummins Apr 21, 2022
1515b43
[core] Add docstrings for new reset() args.
ChrisCummins Apr 21, 2022
f30a042
Move reset() arguments into CompilerEnv.
ChrisCummins Apr 21, 2022
a69805e
[core] Move reward_range into CompilerEnv.
ChrisCummins Apr 19, 2022
b1d7b97
Docstring improvements.
ChrisCummins Apr 19, 2022
e2ece90
[gcc] Fix reset() arguments.
ChrisCummins Apr 19, 2022
c1f61c8
Fix Py < 3.8 compatibility for shlex.join().
ChrisCummins Apr 19, 2022
8bf9a74
Bump absl and gRPC dependencies.
ChrisCummins Apr 22, 2022
bc60bcb
Fix recursive reset() retry.
ChrisCummins Apr 22, 2022
7db7e83
Move RuntimeReward to compiler_gym.spaces
sogartar Apr 22, 2022
515625f
[tests] Permit timeout error in csmith test retry loop.
ChrisCummins Apr 22, 2022
8160bda
Move most Exceptions to compiler_gym.errors
sogartar Apr 23, 2022
85f74de
Add compiler_gym.errors to setup.py
sogartar Apr 25, 2022
4ecad77
Fix typos and comments
sogartar Apr 26, 2022
29cdbc6
Move MLIR env PPO smoke test to separate file
sogartar Apr 26, 2022
dcfddb4
In print_service_capabilities print the string representation of unsu…
sogartar Apr 26, 2022
0fcc286
Remove some misplaced names for the public interface of compiler_gym.…
sogartar Apr 26, 2022
34a1e5b
Make errorOnFalse argument of CG_PROTO_CHECK macro
sogartar Apr 27, 2022
ca4c45b
Add docstring for class SpaceContainsEventChecker
sogartar Apr 27, 2022
f7a967f
Merge pull request #664 from ChrisCummins/fix/macos-build
ChrisCummins Apr 27, 2022
a5c0d08
[core] Add missing arguments to recursive call.
ChrisCummins Apr 19, 2022
c6ab30f
[examples] Fix path to clang in example services.
ChrisCummins Apr 19, 2022
74939c5
Merge pull request #665 from ChrisCummins/fix/example-service-clang-path
ChrisCummins Apr 27, 2022
1d5da84
Remove ConversionWrapperEnv
sogartar Apr 27, 2022
ea9861d
Document and add MlirEnv to documatation
sogartar Apr 27, 2022
d697716
Fix casing of variables
sogartar Apr 27, 2022
e65c187
Add proto.rst to documentation
sogartar Apr 27, 2022
2d00327
[examples] Install *.yaml files for llvm_rl package.
ChrisCummins Apr 27, 2022
dbddb06
Make MLIR test produce test code coverage
sogartar Apr 28, 2022
4f9cb82
Merge pull request #662 from ChrisCummins/feature/reset-docstrings
ChrisCummins Apr 28, 2022
f3de372
Merge pull request #668 from ChrisCummins/feature/llvm_rl-data-files
ChrisCummins Apr 28, 2022
f63dcc2
[docs] New FAQ question "Where does CompilerGym store files?"
ChrisCummins Apr 28, 2022
f491d34
[docs] Small reword of FAQ question
ChrisCummins Apr 28, 2022
c4713d9
[util] Explain when it is safe to remove filesystem dirs.
ChrisCummins Apr 28, 2022
20dba5e
Move reset() and constructor to base class.
ChrisCummins Apr 19, 2022
1d3a710
[wrappers] Add missing implementation of close().
ChrisCummins Apr 19, 2022
441bdb2
[examples] Fix timeout not being enforced.
ChrisCummins Apr 19, 2022
28c28fb
Add more extensive documentation for the MLIR env
sogartar Apr 29, 2022
758d661
Merge pull request #670 from ChrisCummins/feature/faq
ChrisCummins Apr 29, 2022
e6cf784
In install instructions source ~/.profile
sogartar May 2, 2022
f9f8bcc
Instead of sorucing ~/.profile add ~/.local/bin to PATH directly
sogartar May 2, 2022
673fa12
Merge pull request #673 from sogartar/local-bin-path
ChrisCummins May 2, 2022
ac34498
Merge pull request #652 from facebookresearch/mlir
ChrisCummins May 3, 2022
85113f6
Don't install non-existend package clang++-9
sogartar May 4, 2022
6ebc437
In install instructions don't install cmake through conda
sogartar May 4, 2022
f8b0af6
In install instructions state that CMake build is still experimental
sogartar May 4, 2022
63f36ec
CMake: don't override variables when setting linker to lld
sogartar May 4, 2022
2b0e69c
CMake: don't force on the user ccache
sogartar May 4, 2022
2ac6f59
On Ubuntu install lld instead of lld-9
sogartar May 4, 2022
56db793
CMake: Fix finding ot lld and python
sogartar May 4, 2022
6c2a2af
CMake: Fix ProGraML dependency on LLVM
sogartar May 5, 2022
8204bf1
CMake: don't use *_INIT variables for setting lld linker
sogartar May 5, 2022
36154c7
In install instructions install cmake also through conda
sogartar May 6, 2022
9f5fd38
CMake: fix custom target dependencies
sogartar May 6, 2022
c25d3ad
CMake: in cg_py_library add GENERATED_SRCS to OUTPUTS
sogartar May 6, 2022
052cad7
Merge pull request #674 from sogartar/fix-install-insturctions-and-ci
ChrisCummins May 8, 2022
63dbfac
Merge pull request #675 from sogartar/fix-cmake-custom-target-depende…
ChrisCummins May 9, 2022
ffa8c3d
Remove `conda` from bug report issue template.
ChrisCummins May 10, 2022
9448017
Remove 'bazel version' from bug report issue template.
ChrisCummins May 10, 2022
2cfcb51
Import the collect_env.py script from pytorch.
ChrisCummins May 10, 2022
eed88fe
Update collect_info.py URL in bug report issue template.
ChrisCummins May 10, 2022
460ca27
Adapt collect_info.py for CompilerGym dependencies.
ChrisCummins May 10, 2022
9823525
Format collect_env.py.
ChrisCummins May 10, 2022
96ee4ca
Format import list.
ChrisCummins May 10, 2022
071acb2
[core] Add a ServiceCache abstraction.
ChrisCummins Apr 19, 2022
b9f2c52
[core] Add a "disk" subdirectory to service caches.
ChrisCummins Apr 19, 2022
c78aca7
[llvm] Use service working directory for benchmark cache.
ChrisCummins Apr 19, 2022
3aed87e
[service] Add __repr__ for ServiceCache.
ChrisCummins Apr 19, 2022
80489ee
[service] Don't make logs subdir in disk cache.
ChrisCummins Apr 28, 2022
0013515
Fix service connection build dependencies.
ChrisCummins Apr 19, 2022
1f408a9
[cmake] Set CMAKE_BUILD_WITH_INSTALL_RPATH by default.
ChrisCummins Apr 19, 2022
4759c31
[cmake] Don't override command line settings.
ChrisCummins Apr 19, 2022
616b4ac
[cmake] ccache is set automatically if found.
ChrisCummins Apr 19, 2022
e43ad7b
[cmake] Don't set install rpath.
ChrisCummins May 3, 2022
6091697
Import third-party gccinvocation library.
ChrisCummins Feb 7, 2022
8e7413b
Split gccinvocation tests into separate test file.
ChrisCummins Feb 7, 2022
eadcd65
[llvm] Add API to construct a benchmark from clang invocation.
ChrisCummins Feb 7, 2022
351934f
Fix shlex.join() backward compatibility.
ChrisCummins Apr 22, 2022
2e8394d
Update and fix LLVM custom benchmark tests.
ChrisCummins Apr 22, 2022
cc7fa7b
Fix cmake dependency name.
ChrisCummins Apr 19, 2022
f13f90b
[llvm] Add support for commandlines with objectfile inputs.
ChrisCummins Apr 19, 2022
ddad31b
[llvm] Raise an error if only object file inputs.
ChrisCummins Apr 19, 2022
5f2e3df
Tiny code style fix.
ChrisCummins Apr 19, 2022
bc88088
Cross-reference issue in TODO comment.
ChrisCummins Apr 19, 2022
8573d81
Fix cmake dependency name.
ChrisCummins Apr 19, 2022
72ef9b1
[llvm] Improve documentation.
ChrisCummins Apr 19, 2022
e9aa1e6
Merge pull request #666 from ChrisCummins/feature/cmake-tweaks
ChrisCummins May 12, 2022
ed9cc0f
Fix formatting.
ChrisCummins Apr 19, 2022
947b567
Merge pull request #672 from ChrisCummins/feature/671
ChrisCummins May 12, 2022
7d83233
Add a missing function docstring.
ChrisCummins Apr 19, 2022
483f640
[wrappers] Add synchronous SQLite database wrapper.
ChrisCummins Apr 19, 2022
fdc7983
Add missing cmake test targets.
ChrisCummins Apr 19, 2022
cb15908
Better documentation for the SQLite wrapper.
ChrisCummins Apr 19, 2022
de093a2
Conditionally import SQLite wrapper only if it is available.
ChrisCummins Apr 19, 2022
426f873
Force string argument to sqlite3.connect().
ChrisCummins May 15, 2022
51ff9d1
Merge pull request #679 from ChrisCummins/feature/db-wrapper
ChrisCummins May 16, 2022
1ba722c
[wrappers] Add a Counter wrapper class.
ChrisCummins Apr 19, 2022
366f218
[wrappers] Add a ForkOnStep wrapper.
ChrisCummins Apr 19, 2022
41487a6
Merge pull request #682 from ChrisCummins/feature/undo-wrapper
ChrisCummins May 17, 2022
596c242
Merge pull request #676 from facebookresearch/feature/bug-report-issu…
ChrisCummins May 17, 2022
f30ebba
Merge pull request #683 from ChrisCummins/feature/counter-wrapper
ChrisCummins May 17, 2022
b5fa476
[Minor Bug] fix typo in argument & add flag
anthony0727 May 19, 2022
38f2076
Merge pull request #577 from ChrisCummins/feature/make-env-from-clang
ChrisCummins May 20, 2022
488921a
[Minor] use predefined nproc flag instead
anthony0727 May 20, 2022
43a8af8
[Minor] no need to manually adopt flag
anthony0727 May 20, 2022
c76c513
resolve CI failure
anthony0727 May 24, 2022
52ff148
resolve CI failure
anthony0727 May 24, 2022
d73e2d2
Merge pull request #684 from anthony0727/fix-example
ChrisCummins May 24, 2022
94ee743
Update citation to CGO.
ChrisCummins May 24, 2022
bb5f684
Merge pull request #687 from ChrisCummins/citation
ChrisCummins May 24, 2022
039b016
[examples] Update and fix docstrings for sensitivity analysis scripts.
ChrisCummins May 24, 2022
1afdbb0
Move set_version.sh script into build_tools.
ChrisCummins May 24, 2022
04df4c0
[docs] Fix missing quotes to preserve whitespace.
ChrisCummins Apr 19, 2022
c0f40bc
[docs] Temporarily disable MlirEnv doc generation.
ChrisCummins Apr 19, 2022
f62e787
[docs] Fix reference to wrapper function.
ChrisCummins Apr 19, 2022
40cbc78
[docs] Add MLIR to index.
ChrisCummins Apr 19, 2022
f29bf1a
[docs] Fix function name.
ChrisCummins Apr 19, 2022
18ed285
[docs] Fix formatting of MLIR doc file.
ChrisCummins Apr 19, 2022
52671fb
[docs] Clarify documentation.
ChrisCummins Apr 19, 2022
c2c2f96
Release v0.2.4
ChrisCummins May 24, 2022
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
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/--bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,19 @@ Steps to reproduce the behavior:
Please fill in this checklist:

- CompilerGym:
- How you installed CompilerGym (conda, pip, source):
- How you installed CompilerGym (pip, source):
- OS:
- Python version:
- Build command you used (if compiling from source):
- GCC/clang version (if compiling from source):
- Bazel version (if compiling from source):
- Versions of any other relevant libraries:

You may use the PyTorch
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
You may use the
[environment collection script](https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py)
to generate most of this information. You can get the script and run it with:

```sh
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
wget https://raw.githubusercontent.com/facebookresearch/CompilerGym/stable/build_tools/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
brew install bazelisk ccache cmake zlib
else
# Compiler
sudo apt-get install -y bzip2 clang-9 clang++-9 lld-9 tar bzip2 ninja-build tar ninja-build
sudo apt install -y bzip2 clang-9 lld tar bzip2 ninja-build tar
# CMake
wget https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5-linux-x86_64.sh -O /tmp/cmake.sh
sudo bash /tmp/cmake.sh --prefix=/usr/local --exclude-subdir --skip-license
Expand Down
18 changes: 18 additions & 0 deletions .github/actions/install-mlir-env-runtime-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Install runtime dependencies
description: Install the runtime dependencies for CompilerGym.
runs:
using: composite
steps:
- uses: ./.github/actions/install-runtime-dependencies

- name: Install MLIR env runtime dependencies
run: |
if [ "$(uname)" = "Darwin" ]; then
# TODO(boian): figure out how to install the C++ std library.
echo "Error: Darwin is not supported"
exit 1
else
sudo apt-get install libstdc++-9-dev
fi
shell: bash
99 changes: 92 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ jobs:
-GNinja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCOMPILER_GYM_LLVM_PROVIDER=external \
-DLLVM_DIR=$HOME/llvm/lib/cmake/llvm \
-DPython3_FIND_VIRTUALENV=FIRST \
-DPython3_FIND_UNVERSIONED_NAMES=FIRST \
-DCOMPILER_GYM_BUILD_TESTS=ON \
-DCOMPILER_GYM_BUILD_EXAMPLES=ON \
-S . \
Expand All @@ -92,6 +89,58 @@ jobs:
if-no-files-found: error
retention-days: 7

build-mlir-env-linux-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install build dependencies
uses: ./.github/actions/install-cmake-build-dependencies

- name: Download LLVM 14.0.0 release
run: |
if [ "$(uname)" = "Darwin" ]; then
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz -O ~/llvm.tar.xz
else
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -O ~/llvm.tar.xz
fi
mkdir ~/llvm && tar xvf ~/llvm.tar.xz --strip-components 1 -C ~/llvm
rm ~/llvm.tar.xz
echo "Unpacked, testing for expected file:"
test -d ~/llvm/lib/cmake/llvm

- name: CMake Build
run: |
cmake \
-GNinja \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCOMPILER_GYM_LLVM_PROVIDER=external \
-DLLVM_DIR=$HOME/llvm/lib/cmake/llvm \
-DMLIR_DIR=$HOME/llvm/lib/cmake/mlir \
-DClang_DIR=$HOME/llvm/lib/cmake/clang \
-DPython3_FIND_UNVERSIONED_NAMES=FIRST \
-DCOMPILER_GYM_ENABLE_MLIR_ENV=ON \
-DCOMPILER_GYM_ENABLE_LLVM_ENV=OFF \
-DCOMPILER_GYM_BUILD_TESTS=ON \
-DCOMPILER_GYM_BUILD_EXAMPLES=ON \
-S . \
-B ~/cmake_build
cmake --build ~/cmake_build
shell: bash

- name: Upload Python wheel
uses: actions/upload-artifact@v2
with:
name: mlir-env-linux-wheel-cmake
path: ~/cmake_build/py_pkg/dist/*.whl
if-no-files-found: error
retention-days: 7

build-macos:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -149,7 +198,9 @@ jobs:
run: python -m pip install -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov 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 --ignore tests/mlir"

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

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

test-mlir-env-linux-cmake:
needs: build-mlir-env-linux-cmake
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Download Python wheel
uses: actions/download-artifact@v2
with:
name: mlir-env-linux-wheel-cmake

- name: Install wheel
run: python -m pip install *.whl

- name: Install runtime dependencies
uses: ./.github/actions/install-mlir-env-runtime-dependencies

- name: Install test dependencies
run: python -m pip install -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov TEST_TARGET="tests/mlir"

test-macos:
needs: build-macos
Expand Down Expand Up @@ -216,7 +299,9 @@ jobs:
run: python -m pip install -r tests/requirements.txt

- name: Run the test suite
run: make install-test-cov 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 --ignore tests/mlir"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:

- name: Install buildifier
run: |
go get github.com/bazelbuild/buildtools/buildifier
go install github.com/bazelbuild/buildtools/buildifier@latest
buildifier --version

- name: Install prototool
run: |
GO111MODULE=on go get github.com/uber/prototool/cmd/prototool@dev
GO111MODULE=on go install github.com/uber/prototool/cmd/prototool@dev
prototool version

- name: Install hadolint
Expand All @@ -54,7 +54,6 @@ jobs:
python3 -m pip install --upgrade wheel
python3 -m pip install -r requirements_pre_commit.txt
python3 -m isort --version
python3 -m black --version
python3 -m pre_commit --version

- name: Run pre-commit checks
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.0
rev: 750078a4aedba5d63c04442e697ccda3ddf71351
hooks:
- id: yamlfmt
- repo: https://github.com/timothycrosley/isort
rev: 5.7.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3.8
Expand Down
108 changes: 108 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,111 @@
## Release 0.2.4 (2022-05-24)

This release adds a new compiler environment, new APIs, and a suite of backend
improvements to improve the flexibility of CompilerGym environments. Many thanks
to code contributors: @sogartar, @KyleHerndon, @SoumyajitKarmakar, @uduse, and
@anthony0727!

Highlights of this release include:

- [mlir] Began work on a new environment for matrix multiplication using MLIR
([#652](https://github.com/facebookresearch/CompilerGym/pull/652), thanks
@KyleHerndon and @sogartar!). Note this environment is not yet included in the
pypi package and must be [compiled from
source](https://github.com/facebookresearch/CompilerGym/blob/development/INSTALL.md#building-from-source-with-cmake).
- [llvm] Added a new `env.benchmark_from_clang_invocation()` method
([#577](https://github.com/facebookresearch/CompilerGym/pull/577)) that can be
used for constructing LLVM environment automatically from C/C++ compiler
invocations. This makes it much easier to integrate CompilerGym with your
existing build scripts.
- Added three new wrapper classes: `Counter`, that provides op counts for
analysis ([#683](https://github.com/facebookresearch/CompilerGym/pull/683));
`SynchronousSqliteLogger`, that provides logging of environment interactions
to a relational database
([#679](https://github.com/facebookresearch/CompilerGym/pull/679)), and
`ForkOnStep` that provides an `undo()` operation
([#682](https://github.com/facebookresearch/CompilerGym/pull/682)).
- Added `reward_space` and `observation_space` parameters to `env.reset()`
([#659](https://github.com/facebookresearch/CompilerGym/pull/659), thanks
@SoumyajitKarmakar!)

This release includes a number of improvements to the backend APIs that make it
easier to write new CompilerGym environments:

- Refactored the backend to make `CompilerEnv` an abstract interface, and
`ClientServiceCompilerEnv` the concrete implementation of this interface. This
enables new environments to be implemented without using gRPC
([#633](https://github.com/facebookresearch/CompilerGym/pull/633), thanks
@sogartar!).
- Extended the support for different types of action and observation spaces
([#641](https://github.com/facebookresearch/CompilerGym/pull/641),
[#643](https://github.com/facebookresearch/CompilerGym/pull/643), thanks
@sogartar!), including new `Permutation` and `SpaceSequence` spaces
([#645](https://github.com/facebookresearch/CompilerGym/pull/645), thanks
@sogartar!)..
- Added a new `disk/` subdirectory to compiler service's working directories,
which is symlinked to an on-disk location for devices which support in-memory
working directories. This fixes a bug with leftover temporary directories from
LLVM ([#672](https://github.com/facebookresearch/CompilerGym/pull/672)).

This release also includes numerous bug fixes and improvements, many of which
were reported or fixed by the community. For example, fixing a bug in cache file
locations ([#656](https://github.com/facebookresearch/CompilerGym/pull/656),
thanks @uduse!), and a missing flag definition in example code
([#684](https://github.com/facebookresearch/CompilerGym/pull/684), thanks
@anthony0727!).

**Full Changelog**:
https://github.com/facebookresearch/CompilerGym/compare/v0.2.3...v0.2.4


## Release 0.2.3 (2022-03-18)

This release brings in deprecating changes to the core `env.step()` routine, and
lays the groundwork for enabling new types of compiler optimizations to be
exposed through CompilerGym. Many thanks to code contributors: @mostafaelhoushi,
@sogartar, @KyleHerndon, @uduse, @parthchadha, and @xtremey!

Highlights of this release include:

- Added a new `TextSizeInBytes` observation space for LLVM
([#575](https://github.com/facebookresearch/CompilerGym/pull/575)).
* Added a new PPO leaderboard entry
([#580](https://github.com/facebookresearch/CompilerGym/pull/580). Thanks
@xtremey!
- Fixed a bug in which temporary directories created by the LLVM environment
were not cleaned up
([#592](https://github.com/facebookresearch/CompilerGym/pull/592)).
- **[Backend]** The function `createAndRunCompilerGymService` now returns an
int, which is the exit return code
([#592](https://github.com/facebookresearch/CompilerGym/pull/592)).
- Improvements to the examples documentation
([#548](https://github.com/facebookresearch/CompilerGym/pull/548)) and FAQ
([#586](https://github.com/facebookresearch/CompilerGym/pull/586))

Deprecations and breaking changes:

- `CompilerEnv.step` no longer accepts a list of actions
([#627](https://github.com/facebookresearch/CompilerGym/pull/627)). A new
method, `CompilerEnv.multistep` provides this functionality. This is to
provide compatibility with environments whose action spaces are lists. To
update your code, replace any calls to `env.step()` which take a list of
actions to use `env.multistep()`. Thanks @sogartar!
- The arguments `observations` and `rewards` to `step()` have been renamed
`observation_spaces` and `reward_spaces`, respectively
([#627](https://github.com/facebookresearch/CompilerGym/pull/627)).
- `Reward.id` has been renamed `Reward.name`
([#565](https://github.com/facebookresearch/CompilerGym/pull/565),
[#612](https://github.com/facebookresearch/CompilerGym/pull/612)). Thanks
@parthchadha!
* The backend protocol buffer schema has been updated to natively support more
types of observation and action, and to support nested spaces
([#531](https://github.com/facebookresearch/CompilerGym/pull/531)). Thanks
@sogartar!

**Full Changelog**:
https://github.com/facebookresearch/CompilerGym/compare/v0.2.2...v0.2.3


## Release 0.2.2 (2022-01-19)

Amongst the highlights of this release are support for building with CMake and a
Expand Down
13 changes: 7 additions & 6 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ authors:
- family-names: "Leather"
given-names: "Hugh"
title: "CompilerGym"
version: 0.2.3
date-released: 2022-03-18
version: 0.2.4
date-released: 2022-05-24
url: "https://github.com/facebookresearch/CompilerGym"
preferred-citation:
type: article
type: conference-paper
conference: "CGO"
title: "CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research"
url: "https://arxiv.org/pdf/2109.08267.pdf"
year: 2022
authors:
- family-names: "Cummins"
given-names: "Chris"
Expand All @@ -62,6 +66,3 @@ preferred-citation:
given-names: "Yuandong"
- family-names: "Leather"
given-names: "Hugh"
journal: "arXiv:2109.08267"
title: "CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research"
year: 2021
Loading