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.3 #630

Merged
merged 273 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
cd146f3
use getBooleanLoopAttribute for all boolean attributes
mostafaelhoushi Jan 31, 2022
1d8c2dc
use getOptionalIntLoopAttribute for numeric attributes
mostafaelhoushi Jan 31, 2022
c3c9997
add option for Yaml log path, and run Yaml after all optimizations
mostafaelhoushi Jan 31, 2022
093c739
use camel case for variables
mostafaelhoushi Jan 31, 2022
24288c1
fix typo and add comment
mostafaelhoushi Jan 31, 2022
9ec3413
use camel case for counts
mostafaelhoushi Jan 31, 2022
0a7c9df
update README file
mostafaelhoushi Jan 31, 2022
dec4195
fix initial value of loop-vectorize
mostafaelhoushi Jan 31, 2022
de0cad3
gRPC refactoring of actions and observations
sogartar Dec 28, 2021
e248330
Merge pull request #531 from sogartar/grpc-refactoring
ChrisCummins Feb 4, 2022
5f90f2b
Update statistics.py
uduse Feb 5, 2022
70e7ded
Rename id attribute for rewards to name such that it's consistent wit…
parthchadha Feb 6, 2022
b2ff595
Fix use of reward name in brute_force.py
parthchadha Feb 7, 2022
a1e2364
add json support
mostafaelhoushi Feb 7, 2022
e657a37
add one more attribute
mostafaelhoushi Feb 7, 2022
0760458
dedicated structure to store loop config
mostafaelhoushi Feb 7, 2022
64ede8d
refactor: Loop* to LoopConfig to json
mostafaelhoushi Feb 7, 2022
868f220
refactor YAML to use LoopConfig
mostafaelhoushi Feb 7, 2022
d0569d0
write yaml and json outside passes
mostafaelhoushi Feb 7, 2022
f129924
write json to file
mostafaelhoushi Feb 7, 2022
534c12e
dump yaml directly from list
mostafaelhoushi Feb 7, 2022
7bd1b9f
log json without for loop
mostafaelhoushi Feb 7, 2022
228457a
get json dump to work again
mostafaelhoushi Feb 7, 2022
d4871f6
some clean up
mostafaelhoushi Feb 7, 2022
cc6402e
TODOs should be blameable
mostafaelhoushi Feb 7, 2022
e14c200
add IRCanonicalizer
mostafaelhoushi Feb 7, 2022
84e76f7
move canonicalizer opts to IRCanonicalizer
mostafaelhoushi Feb 7, 2022
f835fb7
canonicalize becomes optional
mostafaelhoushi Feb 7, 2022
783628d
call canonicalize using PM
mostafaelhoushi Feb 7, 2022
dc386b8
move IRCanonicalizer to separate directory
mostafaelhoushi Feb 7, 2022
cf378a9
add license and README
mostafaelhoushi Feb 7, 2022
1b6d35a
Merge pull request #563 from uduse/patch-1
ChrisCummins Feb 7, 2022
9eaafb2
Merge pull request #565 from parthchadha/development
ChrisCummins Feb 7, 2022
67ff153
Merge pull request #555 from ChrisCummins/fix/benchmark-uri
ChrisCummins Feb 7, 2022
22ac844
Merge pull request #554 from ChrisCummins/feature/strip-opts
ChrisCummins Feb 7, 2022
ce3ed13
Remove lines from README
mostafaelhoushi Feb 8, 2022
afb01f9
Remove unnecessary flags
mostafaelhoushi Feb 8, 2022
6933bb6
Remove unnecessary line
mostafaelhoushi Feb 8, 2022
5ad5308
update README of LLVM-Canon repo
mostafaelhoushi Feb 8, 2022
d2fe980
Fix letter case
mostafaelhoushi Feb 8, 2022
df360ca
update readme instructions
mostafaelhoushi Feb 8, 2022
01177bf
Remove unused cpp-suprocess dependency.
ChrisCummins Feb 8, 2022
e72aae3
Tiny comment style tidy up.
ChrisCummins Feb 8, 2022
2bcde65
[cmake] Remove Polly from the LLVM build.
ChrisCummins Feb 8, 2022
201996d
[cmake] Fix implicit conversion to STRING warning.
ChrisCummins Feb 8, 2022
f59b597
enable CMake build of IRCanonicalizer
mostafaelhoushi Feb 8, 2022
1476ab0
make pre-commit hook happy
mostafaelhoushi Feb 9, 2022
11784d4
Merge pull request #557 from mostafaelhoushi/log-loops
mostafaelhoushi Feb 9, 2022
1d95739
Strip "include/" prefix for LLVM headers.
ChrisCummins Feb 8, 2022
eb191aa
Fix a small typo.
ChrisCummins Feb 8, 2022
f83a24c
Add a suitable menacing warning comment.
ChrisCummins Feb 8, 2022
a656289
[llvm] Improve the pass list parsing.
ChrisCummins Feb 8, 2022
d608eac
[llvm] Tidy up and minimize the included header set.
ChrisCummins Feb 15, 2022
2c2e81e
[llvm] Fix include path for LLVM headers.
ChrisCummins Feb 16, 2022
10fe4a2
Add missing copyright header.
ChrisCummins Feb 16, 2022
fa8f9c7
Alphabetize list of data dependencies.
ChrisCummins Feb 16, 2022
8a3f963
Merge pull request #567 from ChrisCummins/feature/cmake-tweaks
ChrisCummins Feb 16, 2022
debd0f8
[service] Loosen gRPC constraints on message sizes.
ChrisCummins Feb 16, 2022
1d095e2
Merge pull request #574 from ChrisCummins/feature/grpc-message-sizes
ChrisCummins Feb 16, 2022
d5a8669
[tests] Disable pytest resource warning capture.
ChrisCummins Feb 17, 2022
5f6d3e7
[tests] Re-use existing plugin.
ChrisCummins Feb 18, 2022
7bccaa0
[llvm] Compute and return -lSystem location on macOS.
ChrisCummins Feb 18, 2022
7160f73
[llvm] Create a temporary file, not an entire directory.
ChrisCummins Feb 18, 2022
ec4ca9d
[service] Improve and fix repr of connections.
ChrisCummins Feb 17, 2022
416b542
Use io_context rather than io_service alias.
ChrisCummins Feb 17, 2022
0cd8d43
[llvm] Fix bug leading to zombie llvm-size processes.
ChrisCummins Feb 17, 2022
7516096
[service] Turn off TCP port reuse for gRPC channels.
ChrisCummins Feb 17, 2022
7728ccf
[service] Set the same options consistently for gRPC in Python and C++.
ChrisCummins Feb 17, 2022
070e21c
Fix typo in variable name and dependency.
ChrisCummins Feb 18, 2022
a1a063c
[llvm] Add discussion note about env.apply() semantics.
ChrisCummins Feb 18, 2022
b65c7d1
[tests] Apply a default 5 minute timeout to all test functions.
ChrisCummins Feb 18, 2022
d4d8513
[tests] Merge cBench test files.
ChrisCummins Feb 18, 2022
359be5f
[tests] Refine flaky test timeout.
ChrisCummins Feb 18, 2022
0bf6651
Added Leaderboard Entry for PPO
ymahlau Feb 20, 2022
ce7ce98
[tests] Rename test file to match implementation file.
ChrisCummins Feb 21, 2022
1e76147
[llvm] Improve system library flag detection.
ChrisCummins Feb 21, 2022
f6c1aa1
[tests] Fix temporary environment variable setting.
ChrisCummins Feb 21, 2022
1c9c416
[llvm] Add system flags to build_cmd protos.
ChrisCummins Feb 22, 2022
4131cb2
Hold back grpcio version.
ChrisCummins Feb 22, 2022
9bbb6dc
[llvm] Add tests for system libs in ClangInvocation.
ChrisCummins Feb 22, 2022
17da4ed
[tests] Tidy up system libs tests.
ChrisCummins Feb 22, 2022
2825a09
[llvm] Raise error if system flag extraction fails.
ChrisCummins Feb 22, 2022
ae9996c
[llvm] Ensure that transient cache exists.
ChrisCummins Feb 22, 2022
9f3ee91
[tests] Unset the xfail attribute on macOS runtime tests.
ChrisCummins Feb 22, 2022
25c982d
[tests] Add missing system libraries to test.
ChrisCummins Feb 22, 2022
2c2ceae
Added proper description and results for leaderboard entry
ymahlau Feb 22, 2022
d70408f
Merge pull request #578 from ChrisCummins/fix/flaky-rpc
ChrisCummins Feb 22, 2022
41affde
[llvm] Fix error handling of llvm::Expected<T>.
ChrisCummins Feb 16, 2022
b8887db
[llvm] Split BenchmarkDynamicConfig into separate header.
ChrisCummins Feb 15, 2022
3b8c6ae
[llvm] Enable cost functions to access the dynamic benchmark config.
ChrisCummins Feb 15, 2022
912a126
[llvm] Use dynamic config's build command to compute .TEXT sizes.
ChrisCummins Feb 15, 2022
91ea4fe
[llvm] Add the TextSizeBytes() observation space.
ChrisCummins Feb 16, 2022
0c38cd2
Whitespace fix in comment.
ChrisCummins Feb 16, 2022
98ae716
[llvm] Replace debugging check with comment.
ChrisCummins Feb 17, 2022
4abc83c
Fix a code style formatting error.
ChrisCummins Feb 17, 2022
6f45c60
[llvm] Improved error handling if build_cmd fails.
ChrisCummins Feb 17, 2022
4ce9164
[llvm] Update observation spaces test.
ChrisCummins Feb 17, 2022
db9d168
[llvm] Add TestSize reward functions.
ChrisCummins Feb 17, 2022
7995e96
Update manual_env tests.
ChrisCummins Feb 17, 2022
fd57459
[tests] Update code size values.
ChrisCummins Feb 21, 2022
7048bac
[llvm] Fix docstring comment.
ChrisCummins Feb 18, 2022
edcf57c
Fix rebase errors.
ChrisCummins Feb 22, 2022
a74b552
Test fixes.
ChrisCummins Feb 17, 2022
09e8b50
[tests] Update invalid build command test.
ChrisCummins Feb 23, 2022
96c9530
[service] Ignore service errors during retry loop.
ChrisCummins Feb 23, 2022
27cf83f
[tests] Only test text size values on CI.
ChrisCummins Feb 23, 2022
ca9b9ef
Merge pull request #575 from ChrisCummins/feature/build-command-text-…
ChrisCummins Feb 23, 2022
f2ca6c2
Merge pull request #580 from xtremey/development
ChrisCummins Feb 23, 2022
c3e6ea0
[docs] Add doxygen to the list of conda dependencies.
ChrisCummins Mar 1, 2022
deeaad6
[docs] Move "report a bug" to bottom of FAQ.
ChrisCummins Mar 1, 2022
93cdec5
[docs] Improved debugging and development tips in FAQ.
ChrisCummins Mar 1, 2022
9c4c0cb
[tests] Add missing test dependency.
ChrisCummins Mar 2, 2022
7144057
[examples] Fix benchmark URI.
ChrisCummins Mar 2, 2022
bce2a9d
Update checksum of csmith tarball.
ChrisCummins Mar 2, 2022
1af5eaa
Add alternate URL for csmith tarball.
ChrisCummins Mar 2, 2022
2fe4a84
[tests] Add missing test dependency.
ChrisCummins Mar 2, 2022
13fa5a3
[tests] Set observation and reward space for type test.
ChrisCummins Mar 2, 2022
207dbb9
[examples] Update loop optimizations service dataset API.
ChrisCummins Mar 2, 2022
7f29360
Merge pull request #593 from ChrisCummins/fix/590
ChrisCummins Mar 3, 2022
aa357ec
[service] createAndRunCompilerGymService() returns exit code.
ChrisCummins Mar 2, 2022
380f7ad
[service] Add a logging message when the service is closed.
ChrisCummins Mar 2, 2022
9d6a29b
[llvm] Add debug logging for benchmark closing.
ChrisCummins Mar 2, 2022
c5a4075
[llvm] Clear the BenchmarkFactory contents on close().
ChrisCummins Mar 2, 2022
d274b28
[llvm] Make sure that BenchmarkFactory::close() is called.
ChrisCummins Mar 2, 2022
0394e60
Merge pull request #586 from ChrisCummins/feature/faq
ChrisCummins Mar 3, 2022
656efaa
[third-party] Mark inst2vec regexes as regex literals.
ChrisCummins Feb 19, 2022
a72948f
post rebase fixes
mostafaelhoushi Feb 11, 2022
3d56831
invoke autophase features
mostafaelhoushi Feb 14, 2022
01b8234
remove utils.py that we are no longer using
mostafaelhoushi Feb 14, 2022
75b19e8
build compute_programl.cc
mostafaelhoushi Feb 14, 2022
33c5707
build compute_programl.cc
mostafaelhoushi Feb 14, 2022
5831f36
get inst2vec to work correctly
mostafaelhoushi Feb 1, 2022
81887a0
post rebase fix
mostafaelhoushi Feb 14, 2022
375da94
remove -prelinked from compute_programl target name
mostafaelhoushi Feb 16, 2022
fd9ce82
use runfiles_path for compute_autophase
mostafaelhoushi Feb 16, 2022
2937715
use runfiles_path for opt_loops binary
mostafaelhoushi Feb 16, 2022
e1e19fc
print programl observation as json
mostafaelhoushi Feb 16, 2022
0f4daab
move compute_programl to third_party directory
mostafaelhoushi Feb 16, 2022
0685289
fix env_tests
mostafaelhoushi Feb 17, 2022
1e8093a
add programl and autophase test cases
mostafaelhoushi Feb 17, 2022
f908631
complete test_observations
mostafaelhoushi Feb 17, 2022
a6ed9ef
add AutoPaseDict observation
mostafaelhoushi Feb 26, 2022
aafb246
add testcase for AutoPhaseDict
mostafaelhoushi Feb 26, 2022
fe60d0f
remove unused import
mostafaelhoushi Feb 26, 2022
d5ac32a
update benchmarks definition in example_without_bazel
mostafaelhoushi Feb 27, 2022
c5de260
update benchmark class to fix example_without_bazel
mostafaelhoushi Feb 27, 2022
aea72b7
update CMakeFiles for Linux to work with runfiles_path(...)
mostafaelhoushi Feb 27, 2022
91c2290
add CMakeLists.txt for loop_optimizations_service to link it with opt…
mostafaelhoushi Feb 28, 2022
ed2bf55
workaround because runfiles_path doesn't work on linux
mostafaelhoushi Mar 2, 2022
0a40983
add CMake files to add programl and autophase as dependencies for loo…
mostafaelhoushi Mar 2, 2022
56ba97a
Merge pull request #592 from ChrisCummins/fix/582
ChrisCummins Mar 3, 2022
f8a5117
Merge pull request #594 from ChrisCummins/fix/inst2vec-regex
ChrisCummins Mar 3, 2022
1d57763
fix compute_autophase dependency name
mostafaelhoushi Mar 3, 2022
7d42155
make compute_autophase public
mostafaelhoushi Mar 4, 2022
d5d60b6
Merge pull request #570 from mostafaelhoushi/add-features-to-loop-opt…
mostafaelhoushi Mar 4, 2022
980aa3a
Fix gRPC header include path.
ChrisCummins Mar 3, 2022
d87e800
fixes so far
mostafaelhoushi Mar 6, 2022
ea99005
remove-unnecessary-lines-in-conv2d.c
mostafaelhoushi Mar 6, 2022
103de77
build succeeded!
mostafaelhoushi Mar 6, 2022
a8f29f4
get Autophase to work if its file is copied
mostafaelhoushi Mar 6, 2022
1da5a62
get AutoPhaseDict to work, give binary is copied
mostafaelhoushi Mar 6, 2022
433d209
get programl to work given compute_programl is copied manually
mostafaelhoushi Mar 6, 2022
0509377
update CMakeLists.txt to create symbolic links for compute_programl a…
mostafaelhoushi Mar 6, 2022
a9a0b79
[tests] Add missing `_test` filename suffix.
ChrisCummins Mar 1, 2022
fa05914
[tests] Add a test to demonstrate env.spec bug.
ChrisCummins Mar 1, 2022
868a29f
[service] Reduce severity of logging messages on reset() retry.
ChrisCummins Feb 22, 2022
9a48937
[tests] Increase LLVM datasets test timeout.
ChrisCummins Mar 6, 2022
8cf7edd
Merge pull request #605 from ChrisCummins/fix/grpc-header-path
ChrisCummins Mar 6, 2022
275414a
Merge pull request #607 from mostafaelhoushi/remove-unnecessary-lines…
mostafaelhoushi Mar 6, 2022
9ffdd06
Merge pull request #608 from mostafaelhoushi/fixing-cmake-opt-loops-env
mostafaelhoushi Mar 7, 2022
0b881cb
Merge pull request #589 from ChrisCummins/fix/587
ChrisCummins Mar 7, 2022
fa37566
[cbench] Fix return type of Benchmark.validate().
ChrisCummins Mar 4, 2022
3cc2a9c
Fix typo in function name.
ChrisCummins Mar 4, 2022
cd838bb
[tests] Increase LLVM datasets test timeout.
ChrisCummins Mar 6, 2022
a20e405
Add backwards compatibility for Reward.id.
ChrisCummins Mar 7, 2022
67ed37a
Merge pull request #612 from ChrisCummins/fix/reward-name-compat
ChrisCummins Mar 7, 2022
15dcc39
Merge pull request #604 from ChrisCummins/fix/cbench-validate-return-…
ChrisCummins Mar 7, 2022
2a1539b
Fix URLs of Leaderboard submission.
ChrisCummins Mar 8, 2022
054b7ab
[llvm] Fix usage docstring.
ChrisCummins Mar 6, 2022
f9eb896
Add a CMake formatter and linter to toolchain.
ChrisCummins Feb 10, 2022
cf3be96
Run CMake formatter on all CMakeLists files.
ChrisCummins Mar 9, 2022
885aeb5
Merge pull request #569 from ChrisCummins/feature/cmake-format
ChrisCummins Mar 9, 2022
2f35c68
Merge pull request #602 from ChrisCummins/feature/retry-log
ChrisCummins Mar 9, 2022
9e76f52
[llvm] Commit build-time-generated code.
ChrisCummins Mar 9, 2022
aef9f28
[llvm] Replace buildtime-generated code with commited.
ChrisCummins Mar 9, 2022
2fb60b3
[llvm] Replace buildtime-generated code with committed code.
ChrisCummins Mar 9, 2022
192a8d0
Move buildtime code to built_tools directory.
ChrisCummins Mar 9, 2022
14936ac
Remove runfiles dependency from make_specs.
ChrisCummins Mar 9, 2022
3a1dc1b
Update build systems.
ChrisCummins Mar 9, 2022
9c69fa4
Add header comment to show that files were autogenerated.
ChrisCummins Mar 10, 2022
3c619ca
Update csmith archive checksum.
ChrisCummins Mar 10, 2022
4ca7f19
Merge pull request #620 from ChrisCummins/feature/600-build-time-codegen
ChrisCummins Mar 10, 2022
eee07e8
[llvm] Bump ProGraML version to v0.3.2.
ChrisCummins Jan 21, 2022
54b8720
[llvm] Update ProGraML header file name.
ChrisCummins Jan 27, 2022
ce98aab
[cmake] Update ProGraML header path for library discovery.
ChrisCummins Mar 7, 2022
539172c
[cmake] Automatically enable ccache when it is available.
ChrisCummins Mar 9, 2022
9501b77
[cmake] Turn off exporting compile commands.
ChrisCummins Mar 9, 2022
4e49ada
[cmake] Remove conditional macOS logic.
ChrisCummins Mar 9, 2022
59383c5
[cmake] Use relative paths to build tools includes.
ChrisCummins Mar 9, 2022
771699e
[cmake] Force Ninja generator.
ChrisCummins Mar 9, 2022
9c149fe
[cmake] Find and enable lld if available.
ChrisCummins Mar 9, 2022
ed410fd
[cmake] Clarify variable usage through its name.
ChrisCummins Mar 9, 2022
8cd6c56
[ci] Add macOS step for installing build deps.
ChrisCummins Mar 9, 2022
8202bd8
[ci] Use unversioned clang/clang++.
ChrisCummins Mar 10, 2022
3748955
Bump absl-cpp dependency.
ChrisCummins Mar 4, 2022
7f1a1d2
Bump gbenchmark dependency.
ChrisCummins Mar 4, 2022
9b023e4
[cmake] Only build LLVM from source if LLVM_PROVIDE=internal.
ChrisCummins Mar 10, 2022
2dbc8f2
[INSTALL] Add note on building against pre-compiled LLVM.
ChrisCummins Mar 10, 2022
f660904
[cmake] Fix path to dead cmake targets.
ChrisCummins Mar 10, 2022
dd94fb4
[cmake] Remove "partial" workaround.
ChrisCummins Mar 10, 2022
9920fb9
[cmake] Fix regressions introduced in #600.
ChrisCummins Mar 10, 2022
0bc0612
[cmake] Bump ProGraML to pull in updated absl.
ChrisCummins Mar 10, 2022
3cdaa45
Pin back ProGraML revision to wip/CompilerGym-patches branch.
ChrisCummins Mar 10, 2022
cd94bb2
[llvm] Initialize only the native target.
ChrisCummins Mar 10, 2022
9af78f3
Reformat CMake file after rebase.
ChrisCummins Mar 10, 2022
87b70ba
[ci] Don't create versioned symlinks.
ChrisCummins Mar 10, 2022
f079693
[ci] Use pre-built clang+llvm for compilation.
ChrisCummins Mar 10, 2022
726b7f5
[cmake] Disable formatter on files gersemi fails on.
ChrisCummins Mar 10, 2022
26e287d
[ci] Disable the use of docker on macOS.
ChrisCummins Mar 10, 2022
549497a
Merge pull request #618 from ChrisCummins/feature/cmake-macos
ChrisCummins Mar 11, 2022
c65de7c
Fix for SSL err from npm packages
Mar 14, 2022
8b2f726
Optimize docker file to se cache
Mar 14, 2022
e60cb73
Updates to use react .envs to configure API endpoints
Mar 14, 2022
e20ba1c
Merge pull request #625 from ChrisCummins/fix/somya-www
ChrisCummins Mar 14, 2022
07634a1
code cleanup
sahirgomez1 Mar 15, 2022
1efaf7e
fixes ui dropdowns
sahirgomez1 Mar 16, 2022
ff5d1e9
Bumps up CI to node 17
sahirgomez1 Mar 16, 2022
f1767d4
Trim Trailing Whitespace
sahirgomez1 Mar 16, 2022
c5b9289
Merge pull request #626 from sahirgomez1/sahir/ui/code_cleanup
ChrisCummins Mar 17, 2022
a203b97
Add annotation to step() about differing arguments.
ChrisCummins Mar 6, 2022
c6cc16b
[core] Add a CompilerEnv.multistep() method.
ChrisCummins Mar 6, 2022
d685562
[core] Deprecations and updates to env.step() arguments.
sogartar Mar 5, 2022
48380bb
Use multistep instead of raw_step in wrappers
sogartar Mar 11, 2022
bc1f9e3
Fix failing tests
sogartar Mar 17, 2022
5eb1381
Fix RewardWrapper episode_reward
sogartar Mar 17, 2022
f7f8fc4
Fix build of examples/loop_optimizations_service/service_py
sogartar Mar 17, 2022
8cd9679
Add missing arguments to ValidateBenchmarkAfterEveryStep.multistep
sogartar Mar 17, 2022
b4217a9
[core] Better error message is proto is invalid.
ChrisCummins Mar 17, 2022
bc02e8e
Add missing BUILD file for //compiler_gym/third_party/programl.
ChrisCummins Mar 17, 2022
6630b7e
[examples] Split Makefile to be standalone and improve readme.
ChrisCummins Jan 19, 2022
a56c4fc
[ci] Update examples test config.
ChrisCummins Jan 19, 2022
b3cd747
Move workaround for ~/.dgl into examples Makefile.
ChrisCummins Mar 6, 2022
058be13
[examples] Use pip to install requirements.
ChrisCummins Mar 7, 2022
34f5a53
Merge pull request #629 from ChrisCummins/fix/623
ChrisCummins Mar 17, 2022
b119150
[examples] Remove makefile integration test from `make test`.
ChrisCummins Mar 17, 2022
755ba67
Merge pull request #548 from ChrisCummins/feature/examples-readme
ChrisCummins Mar 17, 2022
6bf0209
Merge pull request #627 from facebookresearch/feature/deprecate-actio…
ChrisCummins Mar 17, 2022
d22fd36
Merge pull request #628 from ChrisCummins/feature/observation-space-s…
ChrisCummins Mar 17, 2022
74dd9b0
[docs] Expand on intro amble and add badges.
ChrisCummins Mar 17, 2022
57724e1
[ci] Update target for examples tests.
ChrisCummins Mar 18, 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
6 changes: 2 additions & 4 deletions .github/actions/install-cmake-build-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ runs:
- name: Install CMake dependencies
run: |
if [ "$(uname)" = "Darwin" ]; then
echo "CMake build for Darwin is unimplemented."
exit 1
brew install bazelisk ccache cmake zlib
else
# Compiler
sudo apt-get install clang++-9 lld-9 tar bzip2 ninja-build
sudo apt-get install tar bzip2 ninja-build
sudo apt-get install -y bzip2 clang-9 clang++-9 lld-9 tar bzip2 ninja-build tar ninja-build
# 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
8 changes: 1 addition & 7 deletions .github/actions/install-runtime-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@ runs:
if [ "$(uname)" = "Darwin" ]; then
brew install zlib
fi
shell: bash

# DGL creates ~/.dgl on first run and I have found that this will fail
# if run from pytest / bazel. Suppress errors if DGL is not installed.
- name: Initialize DGL
run: |
python3 -c 'import dgl; print(dgl.__version__)' || true
python -m pip install -U pip wheel
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ jobs:
uses: ./.github/actions/install-runtime-dependencies

- name: Run the examples tests
run: make examples-test
run: make -C examples test
78 changes: 26 additions & 52 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,30 @@ jobs:
- name: Install build dependencies
uses: ./.github/actions/install-cmake-build-dependencies

- name: Download LLVM 10.0.0 release
run: |
if [ "$(uname)" = "Darwin" ]; then
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz -O ~/llvm.tar.xz
else
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -O ~/llvm.tar.xz
fi
# TODO(cummins): Remove 'v' debugging flag:
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-9 \
-DCMAKE_CXX_COMPILER=clang++-9 \
-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 \
-DCOMPILER_GYM_BUILD_TESTS=ON \
-DCOMPILER_GYM_BUILD_EXAMPLES=ON \
Expand Down Expand Up @@ -345,42 +360,6 @@ jobs:
uses: codecov/codecov-action@v2

test-gcc-env-macos:
needs: build-macos
runs-on: macos-latest
steps:
- uses: docker-practice/actions-setup-docker@master

- name: Confirm docker install
run: docker version

- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Download Python wheel
uses: actions/download-artifact@v2
with:
name: macos-wheel

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

- name: Install runtime dependencies
uses: ./.github/actions/install-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/gcc"

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2

test-gcc-env-macos-no-docker:
needs: build-macos
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -446,11 +425,6 @@ jobs:
needs: build-macos
runs-on: macos-latest
steps:
- uses: docker-practice/actions-setup-docker@master

- name: Confirm docker install
run: docker version

- uses: actions/checkout@v2

- name: Set up Python
Expand Down Expand Up @@ -501,14 +475,14 @@ jobs:
- name: Install wheel
run: python -m pip install *.whl

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

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

- name: Install test dependencies
run: make -C examples install

- name: Run the test suite
run: make examples-test
run: make -C examples test

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -536,14 +510,14 @@ jobs:
- name: Install wheel
run: python -m pip install *.whl

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

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

- name: Install test dependencies
run: make -C examples install

- name: Run the test suite
run: make examples-test
run: make -C examples test

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2
Expand Down Expand Up @@ -636,7 +610,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [16]
node: [17]
steps:
- uses: actions/checkout@v2

Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/pip_install_test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
# This workflow pip install's teh compiler_gym package and checks that the
# module can be imported. The goal of this workflow is to catch failures in the
# installation process that can occur because of a breaking change in the
# dependent packages.
# This workflow pip install's the compiler_gym package and checks that the
# module can be imported.
#
# The goal of this workflow is to catch failures in the installation process
# that can occur because of a breaking change in the dependent packages, and to
# test for any import-time error.
name: Pip install test

on:
Expand All @@ -26,7 +28,12 @@ jobs:
python-version: ${{ matrix.python }}

- name: Install python wheel
run: python -m pip install compiler_gym
# We use the TestPyPI repository to install the compiler_gym
# package from because we use the install count on the main
# repository to track growth and usage of the project. We also
# provide the main PyPI repo as a fallback for installing
# dependencies.
run: python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ compiler_gym

- name: Check package version
run: python -c 'import compiler_gym; print(compiler_gym.__version__)'
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ repos:
rev: v1.0
hooks:
- id: dockerlint
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.7.5
hooks:
- id: gersemi
82 changes: 47 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,79 @@
cmake_minimum_required(VERSION 3.20)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
message(FATAL_ERROR "In-source builds are unsupported. Please, build out of the source tree.")
message(
FATAL_ERROR
"In-source builds are unsupported. Please, build out of the source tree."
)
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN TRUE)
endif()

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

project(compiler_gym ASM C CXX)

set(CMAKE_C_STANDARD 11 CACHE STRING "C standard to be used.")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to be used.")

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake/
)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake)

# Project features.
set(COMPILER_GYM_BUILD_TESTS OFF CACHE BOOL "Enable Compiler Gym tests.")
set(COMPILER_GYM_BUILD_EXAMPLES OFF CACHE BOOL "Enable Comiler Gym examples.")

include(cg_macros)
include(cg_copts)
include(cg_genrule)
include(cg_cc_binary)
include(cg_cc_library)
include(cg_cc_test)
include(cg_py_binary)
include(cg_py_library)
include(cg_py_test)
include(cg_python)
include(cg_add_all_subdirs)
include(cg_filegroup)
include(grpc)
include(protobuf)

set(COMPILER_GYM_PYTHONPATH "$ENV{PYTHONPATH}" CACHE STRING "PYTHONPATH environment variable during build step.")
if (COMPILER_GYM_PYTHONPATH)
string(PREPEND COMPILER_GYM_PYTHONPATH ":")
# Toolchain configuration.
include(build_tools/cmake/FindAndEnableCcache.cmake)
include(build_tools/cmake/FindAndEnableLld.cmake)

include(build_tools/cmake/cg_macros.cmake)
include(build_tools/cmake/cg_copts.cmake)
include(build_tools/cmake/cg_genrule.cmake)
include(build_tools/cmake/cg_cc_binary.cmake)
include(build_tools/cmake/cg_cc_library.cmake)
include(build_tools/cmake/cg_cc_test.cmake)
include(build_tools/cmake/cg_py_binary.cmake)
include(build_tools/cmake/cg_py_library.cmake)
include(build_tools/cmake/cg_py_test.cmake)
include(build_tools/cmake/cg_python.cmake)
include(build_tools/cmake/cg_add_all_subdirs.cmake)
include(build_tools/cmake/cg_filegroup.cmake)
include(build_tools/cmake/grpc.cmake)
include(build_tools/cmake/protobuf.cmake)

# Set up the build Python path.
set(COMPILER_GYM_BUILD_PYTHONPATH "$ENV{PYTHONPATH}"
CACHE STRING "PYTHONPATH environment variable during build step."
)
if(COMPILER_GYM_BUILD_PYTHONPATH)
string(PREPEND COMPILER_GYM_BUILD_PYTHONPATH ":")
endif()
string(PREPEND COMPILER_GYM_PYTHONPATH "${CMAKE_BINARY_DIR}")
include(set_command_pythonpath)
string(PREPEND COMPILER_GYM_BUILD_PYTHONPATH "${CMAKE_BINARY_DIR}")
include(build_tools/cmake/set_command_pythonpath.cmake)

set(DEFAULT_CMAKE_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to ${DEFAULT_CMAKE_BUILD_TYPE}")
set(CMAKE_BUILD_TYPE "${DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Build type (default ${DEFAULT_CMAKE_BUILD_TYPE})" FORCE)
message(
STATUS
"No build type selected, default to ${DEFAULT_CMAKE_BUILD_TYPE}"
)
set(CMAKE_BUILD_TYPE "${DEFAULT_CMAKE_BUILD_TYPE}"
CACHE STRING "Build type (default ${DEFAULT_CMAKE_BUILD_TYPE})"
FORCE
)
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

find_package(Python3 REQUIRED COMPONENTS Interpreter)

include(external/external.cmake)

add_subdirectory(compiler_gym)

if(COMPILER_GYM_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
enable_testing()
add_subdirectory(tests)
endif()

if(COMPILER_GYM_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(examples)
endif()
25 changes: 20 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ with the required dependencies:

conda create -y -n compiler_gym python=3.8
conda activate compiler_gym
conda install -y -c conda-forge cmake pandoc patchelf
conda install -y -c conda-forge cmake doxygen pandoc patchelf

Then clone the CompilerGym source code using:

Expand Down Expand Up @@ -122,24 +122,24 @@ By default most dependencies are built together with Compiler Gym. To search for
* `COMPILER_GYM_GLOG_PROVIDER`
* `COMPILER_GYM_GRPC_PROVIDER`
* `COMPILER_GYM_GTEST_PROVIDER`
* `COMPILER_GYM_LLVM_PROVIDER`
* `COMPILER_GYM_NLOHMANN_JSON_PROVIDER`
* `COMPILER_GYM_PROTOBUF_PROVIDER`

```bash
cmake -GNinja \
cmake \
-DCMAKE_C_COMPILER=clang-9 \
-DCMAKE_CXX_COMPILER=clang++-9 \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ # For faster rebuilds, can be removed
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \ # For faster builds, can be removed
-DPython3_FIND_VIRTUALENV=FIRST \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=true \
-S "<path to source directory>" \
-B "<path to build directory>"

cmake --build "<path to build directory>"
cmake --build "<path to build directory>"

pip install <path to build directory>/py_pkg/dist/compiler_gym*.whl --force-reinstall
```

Additional optional configuration arguments:

* Enables testing.
Expand Down Expand Up @@ -168,3 +168,18 @@ Additional optional configuration arguments:
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
```

By default, CompilerGym builds LLVM from source. This takes a long time and a
lot of compute resources. To prevent this, download a pre-compiled clang+llvm
release of LLVM 10.0.0 from the [llvm-project releases
page](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0), unpack
it, and pass path of the `lib/cmake/llvm` subdirectory in the archive you just
extracted to `LLVM_DIR`:

```
$ cmake ... \
-DCOMPILER_GYM_LLVM_PROVIDER=external \
-DLLVM_DIR=/path/to/llvm/lib/cmake/llvm
```

⚠️ CompilerGym requires exactly LLVM 10.0.0.
Loading