Giter Club home page Giter Club logo

compilergym's Introduction

CompilerGym

Colab Python versions PyPi Downloads PyPI version License CI status

Reinforcement learning environments for compiler optimization tasks.

Check the website for more information.

Introduction

CompilerGym is a library of easy to use and performant reinforcement learning environments for compiler tasks. It allows ML researchers to interact with important compiler optimization problems in a language and vocabulary with which they are comfortable, and provides a toolkit for systems developers to expose new compiler tasks for ML research. We aim to act as a catalyst for making compilers faster using ML. Key features include:

  • Ease of use: built on the the popular Gym interface - use Python to write your agent. With CompilerGym, building ML models for compiler research problems is as easy as building ML models to play video games.

  • Batteries included: includes everything required to get started. Wraps real world programs and compilers to provide millions of instances for training. Provides multiple kinds of pre-computed program representations: you can focus on end-to-end deep learning or features + boosted trees, all the way up to graph models. Appropriate reward functions and loss functions for optimization targets are provided out of the box.

  • Reproducible: provides validation for correctness of results, common baselines, and leaderboards for you to submit your results.

For a glimpse of what's to come, check out our roadmap.

News

  • November 2022: CompilerGym v0.2.5 adds support for Python 3.10 and drops support for 3.7. See release notes for full details.
  • April 2022: ⭐️ CompilerGym wins the distinguished paper award at CGO'22! You can read our work here.
  • April 2022: πŸ“– Our tutorial at CGO'22 was well attended. If you missed the event, you can work through the materials here.
  • September 2021: πŸ“„ CompilerGym was featured on the Meta AI research blog. You can read the post here.

Installation

Install the latest CompilerGym release using:

pip install -U compiler_gym

See INSTALL.md for further details.

Usage

Starting with CompilerGym is simple. If you not already familiar with the gym interface, refer to the getting started guide for an overview of the key concepts.

In Python, import compiler_gym to use the environments:

>>> import compiler_gym                      # imports the CompilerGym environments
>>> env = compiler_gym.make(                 # creates a new environment (same as gym.make)
...     "llvm-v0",                           # selects the compiler to use
...     benchmark="cbench-v1/qsort",         # selects the program to compile
...     observation_space="Autophase",       # selects the observation space
...     reward_space="IrInstructionCountOz", # selects the optimization target
... )
>>> env.reset()                              # starts a new compilation session
>>> env.render()                             # prints the IR of the program
>>> env.step(env.action_space.sample())      # applies a random optimization, updates state/reward/actions
>>> env.close()                              # closes the environment, freeing resources

See the examples directory for agent implementations, environment extensions, and more. See the documentation website for the API reference.

Leaderboards

These leaderboards track the performance of user-submitted algorithms for CompilerGym tasks. To submit a result please see this document.

LLVM Instruction Count

LLVM is a popular open source compiler used widely in industry and research. The llvm-ic-v0 environment exposes LLVM's optimizing passes as a set of actions that can be applied to a particular program. The goal of the agent is to select the sequence of optimizations that lead to the greatest reduction in instruction count in the program being compiled. Reward is the reduction in instruction count achieved scaled to the reduction achieved by LLVM's builtin -Oz pipeline.

This leaderboard tracks the results achieved by algorithms on the llvm-ic-v0 environment on the 23 benchmarks in the cbench-v1 dataset.

Author Algorithm Links Date Walltime (mean) Codesize Reduction (geomean)
Robin SchmΓΆcker, Yannik Mahlau, Nicolas FrΓΆhlich PPO + Guided Search write-up, results 2022-02 69.821s 1.070Γ—
Facebook Random search (t=10800) write-up, results 2021-03 10,512.356s 1.062Γ—
Facebook Random search (t=3600) write-up, results 2021-03 3,630.821s 1.061Γ—
Facebook Greedy search write-up, results 2021-03 169.237s 1.055Γ—
Anthony. W. Jung GATv2 + DD-PPO write-up, results 2022-06 258.149s 1.047Γ—
Facebook Random search (t=60) write-up, results 2021-03 91.215s 1.045Γ—
Facebook e-Greedy search (e=0.1) write-up, results 2021-03 351.611s 1.041Γ—
Jiadong Guo Tabular Q (N=5000, H=10) write-up, results 2021-04 2534.305 1.036Γ—
Facebook Random search (t=10) write-up, results 2021-03 42.939s 1.031Γ—
Patrick Hesse DQN (N=4000, H=10) write-up, results 2021-06 91.018s 1.029Γ—
Jiadong Guo Tabular Q (N=2000, H=5) write-up, results 2021-04 694.105 0.988Γ—

Contributing

We welcome contributions to CompilerGym. If you are interested in contributing please see this document.

Citation

If you use CompilerGym in any of your work, please cite our paper:

@inproceedings{CompilerGym,
      title={{CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research}},
      author={Chris Cummins and Bram Wasti and Jiadong Guo and Brandon Cui and Jason Ansel and Sahir Gomez and Somya Jain and Jia Liu and Olivier Teytaud and Benoit Steiner and Yuandong Tian and Hugh Leather},
      booktitle={CGO},
      year={2022},
}

compilergym's People

Contributors

anthony0727 avatar bcui19 avatar benoitsteiner avatar broune avatar bwasti avatar canesche avatar chriscummins avatar fivosts avatar hughleat avatar jaopaulolc avatar jd-at-work avatar jd-eth avatar lqwk avatar mostafaelhoushi avatar nluu175 avatar parthchadha avatar phesse001 avatar ricardoprins avatar ryanrussell avatar sahirgomez1 avatar sogartar avatar soumith avatar soumyajitkarmakar avatar thecoblack avatar trellixvulnteam avatar uduse avatar ymahlau avatar youweiliang avatar yqtianust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compilergym's Issues

[validation] cBench-v0/susan validation failures

πŸ› Bug

Validation failure in episodes using the cBench-v0/susan benchmark.

To Reproduce

Case 1, -mergereturn

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/susan', commandline='opt -ipsccp -irce -reg2mem -loop-versioning-licm -hotcoldsplit -memcpyopt -partially-inline-libcalls -ipsccp -flattencfg -die -loop-extract-single -mem2reg -partial-inliner -partially-inline-libcalls -extract-blocks -mldst-motion -objc-arc -bounds-checking -redundant-dbg-inst-elim -loop-deletion -constprop -redundant-dbg-inst-elim -lower-widenable-condition -consthoist -float2int -die -deadargelim -globaldce -loop-simplifycfg -elim-avail-extern -structurizecfg -loop-deletion -inferattrs -early-cse-memssa -gvn -loop-extract -bdce -called-value-propagation -mldst-motion -alignment-from-assumptions -gvn -lower-matrix-intrinsics -callsite-splitting -reg2mem -ipconstprop -ipsccp -objc-arc-contract -load-store-vectorizer -loop-load-elim -dse -globalopt -redundant-dbg-inst-elim -loop-simplify -mergereturn -ipsccp -irce -reg2mem -loop-versioning-licm -hotcoldsplit -memcpyopt -partially-inline-libcalls -ipsccp -flattencfg -die -loop-extract-single -mem2reg -partial-inliner -partially-inline-libcalls -extract-blocks -mldst-motion -objc-arc -bounds-checking -redundant-dbg-inst-elim -loop-deletion -constprop -redundant-dbg-inst-elim -lower-widenable-condition -consthoist -float2int -die -deadargelim -globaldce -loop-simplifycfg -elim-avail-extern -structurizecfg -loop-deletion -inferattrs -early-cse-memssa -gvn -loop-extract -bdce -called-value-propagation -mldst-motion -alignment-from-assumptions -gvn -lower-matrix-intrinsics -callsite-splitting -reg2mem -ipconstprop -ipsccp -objc-arc-contract -load-store-vectorizer -loop-load-elim -dse -globalopt -redundant-dbg-inst-elim -loop-simplify -mergereturn input.bc -o output.bc', walltime=4.003221750259399, reward=-1.506353591160221)
env.apply(state)
print(env.validate())

Case 2, -newgvn

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/susan', commandline='opt -reg2mem -mem2reg -loweratomic -lower-constant-intrinsics -libcalls-shrinkwrap -instcombine -loop-versioning -ee-instrument -strip -newgvn -sccp -callsite-splitting -correlated-propagation -elim-avail-extern -simplifycfg -lower-widenable-condition -constmerge -lcssa -name-anon-globals -break-crit-edges -gvn-hoist -elim-avail-extern -libcalls-shrinkwrap -newgvn input.bc -o output.bc', walltime=0.9716546535491943, reward=1.0320441988950275)
env.apply(state)
print(env.validate())

Expected behavior

Validation succeeds.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8

"UnsupportedOperation: fileno" in Colaboratory

πŸ› Bug

UnsupportedOperation: fileno error is raised on environment creation in Google Colaboratory.

To Reproduce

image

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.0
  • How you installed CompilerGym (conda, pip, source): pip
  • OS: Colab hosted runtime

Remove redundant envs

πŸš€ Feature

Currently there are environments that pick out particular observation and reward spaces. To be consistent this should have the Cartesian product of them. This isn't very scalable.
Since there are easy ways to specify them on the command line, we should get rid of everything but the base environment - e.g. llvm-v0

Motivation

There are 17 observation spaces and 8 reward spaces. If you allow for leaving them unset as well, then there should be 162 different environment strings. This seems like a generally bad thing. There are already command line arguments and api calls to set observation and reward.

Pitch

Remove redundant envs.

If it not there already, add the ability to do:
` gym.make("llvm-v0", benchmark="..", observation_space="...", reward_space="...")

Alternatives

Put in the Cartesian product of all combinations.

Additional context

None.

Call env.require_dataset() when required

πŸš€ Feature

If a benchmark is requested that is not installed but belongs to an available dataset, we could just implicitly call env.require_dataset() rather than throwing an error.

Reduce module import time

πŸš€ Feature

Importing the python module is quite slow compared to other packages:

$ time python -c "import compiler_gym"
python -c "import compiler_gym"  1.99s user 0.59s system 260% cpu 0.991 total

for reference:

$ time python -c "import gym"
python -c "import gym"  0.65s user 0.31s system 487% cpu 0.196 total

Motivation

User QoL. Low priority.

Pitch

Do less work on module import. I expect that file I/O like this could be replaced with built-time python codegen and module imports.

It would be worth drilling down into the import profile first:

$ python -X importtime -c 'import compiler_gym'
import time: self [us] | cumulative | imported package
import time:       698 |        698 | _frozen_importlib_external
import time:       925 |        925 |   time
import time:       318 |       1243 | zipimport
import time:        84 |         84 |     _codecs
import time:       745 |        829 |   codecs
import time:       844 |        844 |   encodings.aliases
import time:      1387 |       3059 | encodings
import time:       367 |        367 | encodings.utf_8
import time:       110 |        110 | _signal
import time:       512 |        512 | encodings.latin_1
import time:        65 |         65 |     _abc
import time:       440 |        504 |   abc
import time:       446 |        949 | io
import time:        81 |         81 |       _stat
import time:       390 |        471 |     stat
import time:      1335 |       1335 |     _collections_abc
import time:       327 |        327 |       genericpath
import time:       575 |        901 |     posixpath
import time:       814 |       3520 |   os
import time:       346 |        346 |   _sitebuiltins
import time:        90 |         90 |     _locale
import time:       295 |        385 |   _bootlocale
import time:       480 |        480 |   types
import time:       473 |        473 |       warnings
import time:       458 |        931 |     importlib
import time:       331 |        331 |       importlib.machinery
import time:       853 |       1183 |     importlib.abc
import time:       108 |        108 |           _operator
import time:       594 |        701 |         operator
import time:       298 |        298 |         keyword
import time:      1101 |       1101 |           _heapq
import time:       340 |       1441 |         heapq
import time:       118 |        118 |         itertools
import time:       372 |        372 |         reprlib
import time:        85 |         85 |         _collections
import time:      1739 |       4751 |       collections
import time:        64 |         64 |         _functools
import time:       786 |        849 |       functools
import time:       869 |       6468 |     contextlib
import time:       641 |       9221 |   importlib.util
import time:       224 |        224 |   sitecustomize
import time:       110 |        110 |   usercustomize
import time:      7028 |      21309 | site
import time:       340 |        340 |     compiler_gym.util
import time:       326 |        666 |   compiler_gym.util.version
import time:      1015 |       1015 |         enum
import time:       235 |        235 |           _sre
import time:       540 |        540 |             sre_constants
import time:       590 |       1130 |           sre_parse
import time:       508 |       1872 |         sre_compile
import time:       380 |        380 |         copyreg
import time:       773 |       4038 |       re
import time:       752 |        752 |       _csv
import time:       635 |       5424 |     csv
import time:       405 |        405 |       collections.abc
import time:      2115 |       2520 |     typing
import time:      1632 |       9574 |   compiler_gym.compiler_env_state
import time:       388 |        388 |               token
import time:      1379 |       1766 |             tokenize
import time:       379 |       2144 |           linecache
import time:       519 |       2663 |         traceback
import time:       496 |        496 |           _weakrefset
import time:       994 |       1489 |         weakref
import time:        54 |         54 |           _string
import time:      1424 |       1477 |         string
import time:       924 |        924 |         threading
import time:        76 |         76 |         atexit
import time:      2925 |       9552 |       logging
import time:       190 |        190 |             org
import time:        27 |        216 |           org.python
import time:        24 |        239 |         org.python.core
import time:       546 |        785 |       copy
import time:       950 |        950 |       math
import time:       403 |        403 |         fnmatch
import time:       188 |        188 |           nt
import time:       160 |        160 |           nt
import time:       154 |        154 |           nt
import time:       152 |        152 |           nt
import time:       504 |       1156 |         ntpath
import time:        92 |         92 |         errno
import time:       344 |        344 |           urllib
import time:      1743 |       2086 |         urllib.parse
import time:      1171 |       4906 |       pathlib
import time:       378 |        378 |         __future__
import time:       782 |        782 |                 _struct
import time:       397 |       1178 |               struct
import time:      1982 |       3160 |             six
import time:       360 |        360 |             monotonic
import time:       358 |       3877 |           fasteners._utils
import time:       198 |        198 |           eventlet
import time:       557 |       4631 |         fasteners.lock
import time:       715 |        715 |           fcntl
import time:       349 |       1064 |         fasteners.process_lock
import time:       392 |       6464 |       fasteners
import time:       358 |        358 |           distutils
import time:      1098 |       1456 |         distutils.version
import time:       792 |        792 |         gym.error
import time:       197 |        197 |         gym.version
import time:       304 |        304 |             gym.utils.colorize
import time:       213 |        213 |             gym.utils.ezpickle
import time:       235 |        751 |           gym.utils
import time:       218 |        218 |           gym.utils.closer
import time:       563 |       1531 |         gym.core
import time:      2188 |       2188 |                 _hashlib
import time:       673 |        673 |                 _blake2
import time:       680 |        680 |                 _sha3
import time:       477 |       4017 |               hashlib
import time:       437 |        437 |                 numpy._globals
import time:       231 |        231 |                 numpy.__config__
import time:       191 |        191 |                 numpy.version
import time:       179 |        179 |                 numpy._distributor_init
import time:      1615 |       1615 |                       textwrap
import time:       970 |        970 |                           _datetime
import time:      1384 |       2353 |                         datetime
import time:      6327 |       8679 |                       numpy.core._multiarray_umath
import time:       403 |        403 |                           numpy.compat._inspect
import time:       191 |        191 |                             pickle5
import time:       605 |        605 |                               _compat_pickle
import time:      1013 |       1013 |                               _pickle
import time:       193 |        193 |                                   org
import time:        37 |        229 |                                 org.python
import time:        28 |        257 |                               org.python.core
import time:      1247 |       3120 |                             pickle
import time:       394 |       3705 |                           numpy.compat.py3k
import time:       402 |       4509 |                         numpy.compat
import time:        36 |       4544 |                       numpy.compat._inspect
import time:       671 |      15508 |                     numpy.core.overrides
import time:      2047 |      17554 |                   numpy.core.multiarray
import time:       344 |        344 |                   numpy.core.umath
import time:       681 |        681 |                     numbers
import time:       349 |        349 |                     numpy.core._string_helpers
import time:       297 |        297 |                       numpy.core._dtype
import time:       664 |        961 |                     numpy.core._type_aliases
import time:       582 |       2571 |                   numpy.core.numerictypes
import time:       230 |        230 |                       numpy.core._asarray
import time:       430 |        430 |                           numpy.core._exceptions
import time:       366 |        796 |                         numpy.core._methods
import time:      4125 |       4920 |                       numpy.core.fromnumeric
import time:      1054 |       6203 |                     numpy.core.shape_base
import time:       388 |        388 |                     numpy.core._ufunc_config
import time:      1027 |       1027 |                     numpy.core.arrayprint
import time:      2068 |       9685 |                   numpy.core.numeric
import time:      4061 |       4061 |                   numpy.core.defchararray
import time:       588 |        588 |                   numpy.core.records
import time:      1026 |       1026 |                   numpy.core.memmap
import time:       634 |        634 |                   numpy.core.function_base
import time:       269 |        269 |                   numpy.core.machar
import time:       421 |        421 |                   numpy.core.getlimits
import time:       492 |        492 |                   numpy.core.einsumfunc
import time:      1322 |       1322 |                     numpy.core._multiarray_tests
import time:      2041 |       3363 |                   numpy.core._add_newdocs
import time:       334 |        334 |                   numpy.core._dtype_ctypes
import time:        93 |         93 |                       _ast
import time:       573 |        666 |                     ast
import time:      2216 |       2216 |                     platform
import time:      1250 |       1250 |                       _ctypes
import time:       419 |        419 |                       ctypes._endian
import time:      1111 |       2779 |                     ctypes
import time:       937 |       6597 |                   numpy.core._internal
import time:       268 |        268 |                   numpy._pytesttester
import time:       876 |      49075 |                 numpy.core
import time:       455 |        455 |                   numpy.lib.mixins
import time:       517 |        517 |                       numpy.lib.ufunclike
import time:      1078 |       1595 |                     numpy.lib.type_check
import time:      1001 |       2595 |                   numpy.lib.scimath
import time:       930 |        930 |                             numpy.lib.twodim_base
import time:       615 |        615 |                             numpy.linalg.lapack_lite
import time:      1008 |       1008 |                             numpy.linalg._umath_linalg
import time:      1789 |       4341 |                           numpy.linalg.linalg
import time:       210 |       4551 |                         numpy.linalg
import time:       410 |       4960 |                       numpy.matrixlib.defmatrix
import time:       197 |       5157 |                     numpy.matrixlib
import time:       513 |        513 |                       numpy.lib.histograms
import time:      2249 |       2761 |                     numpy.lib.function_base
import time:       458 |        458 |                     numpy.lib.stride_tricks
import time:       770 |       9145 |                   numpy.lib.index_tricks
import time:      1111 |       1111 |                   numpy.lib.nanfunctions
import time:      1461 |       1461 |                   numpy.lib.shape_base
import time:      1389 |       1389 |                   numpy.lib.polynomial
import time:       803 |        803 |                   numpy.lib.utils
import time:       771 |        771 |                   numpy.lib.arraysetops
import time:       366 |        366 |                     numpy.lib.format
import time:       869 |        869 |                         zlib
import time:       344 |        344 |                           _compression
import time:       702 |        702 |                           _bz2
import time:       546 |       1591 |                         bz2
import time:      1000 |       1000 |                           _lzma
import time:       462 |       1461 |                         lzma
import time:        70 |         70 |                         pwd
import time:       675 |        675 |                         grp
import time:       838 |       5502 |                       shutil
import time:       374 |       5876 |                     numpy.lib._datasource
import time:       523 |        523 |                     numpy.lib._iotools
import time:      1153 |       7916 |                   numpy.lib.npyio
import time:      1144 |       1144 |                       _decimal
import time:       318 |       1461 |                     decimal
import time:      1032 |       2493 |                   numpy.lib.financial
import time:       358 |        358 |                   numpy.lib.arrayterator
import time:       522 |        522 |                   numpy.lib.arraypad
import time:       263 |        263 |                   numpy.lib._version
import time:       515 |      29789 |                 numpy.lib
import time:       474 |        474 |                     numpy.fft._pocketfft_internal
import time:      1169 |       1643 |                   numpy.fft._pocketfft
import time:       446 |        446 |                   numpy.fft.helper
import time:       223 |       2311 |                 numpy.fft
import time:       328 |        328 |                     numpy.polynomial.polyutils
import time:      1020 |       1020 |                     numpy.polynomial._polybase
import time:       484 |       1832 |                   numpy.polynomial.polynomial
import time:       437 |        437 |                   numpy.polynomial.chebyshev
import time:       354 |        354 |                   numpy.polynomial.legendre
import time:       707 |        707 |                   numpy.polynomial.hermite
import time:       418 |        418 |                   numpy.polynomial.hermite_e
import time:       363 |        363 |                   numpy.polynomial.laguerre
import time:       299 |       4407 |                 numpy.polynomial
import time:       160 |        160 |                           backports_abc
import time:       980 |       1139 |                         numpy.random._common
import time:       579 |        579 |                             binascii
import time:       548 |       1126 |                           base64
import time:       455 |        455 |                           hmac
import time:       473 |        473 |                               _bisect
import time:       267 |        739 |                             bisect
import time:       580 |        580 |                             _sha512
import time:       650 |        650 |                             _random
import time:       581 |       2548 |                           random
import time:       368 |       4496 |                         secrets
import time:       786 |       6420 |                       numpy.random.bit_generator
import time:       608 |        608 |                       numpy.random._bounded_integers
import time:       564 |        564 |                       numpy.random._mt19937
import time:      1485 |       9076 |                     numpy.random.mtrand
import time:       596 |        596 |                     numpy.random._philox
import time:       574 |        574 |                     numpy.random._pcg64
import time:       462 |        462 |                     numpy.random._sfc64
import time:      1071 |       1071 |                     numpy.random._generator
import time:       443 |      12219 |                   numpy.random._pickle
import time:       317 |      12536 |                 numpy.random
import time:       521 |        521 |                 numpy.ctypeslib
import time:      2884 |       2884 |                   numpy.ma.core
import time:       866 |        866 |                   numpy.ma.extras
import time:       397 |       4146 |                 numpy.ma
import time:      3025 |     106842 |               numpy
import time:       250 |     111108 |             gym.utils.seeding
import time:       377 |     111485 |           gym.spaces.space
import time:       187 |        187 |             gym.logger
import time:       438 |        625 |           gym.spaces.box
import time:       231 |        231 |           gym.spaces.discrete
import time:       249 |        249 |           gym.spaces.multi_discrete
import time:       243 |        243 |           gym.spaces.multi_binary
import time:       227 |        227 |           gym.spaces.tuple
import time:       244 |        244 |           gym.spaces.dict
import time:       232 |        232 |           gym.spaces.utils
import time:       320 |     113852 |         gym.spaces
import time:       697 |        697 |           gym.envs.registration
import time:      3967 |       4664 |         gym.envs
import time:      1040 |       1040 |                   signal
import time:       628 |       1667 |                 multiprocessing.process
import time:       867 |        867 |                     _socket
import time:       643 |        643 |                       select
import time:      1204 |       1846 |                     selectors
import time:      1728 |       4441 |                   socket
import time:       568 |        568 |                   array
import time:       470 |       5477 |                 multiprocessing.reduction
import time:       674 |       7818 |               multiprocessing.context
import time:       358 |       8175 |             multiprocessing
import time:       305 |        305 |                   gym.vector.utils.misc
import time:       182 |        182 |                     gym.vector.utils.spaces
import time:       286 |        467 |                   gym.vector.utils.numpy_utils
import time:       219 |        219 |                   gym.vector.utils.shared_memory
import time:       204 |       1193 |                 gym.vector.utils
import time:        20 |       1212 |               gym.vector.utils.spaces
import time:       267 |       1479 |             gym.vector.vector_env
import time:       469 |      10122 |           gym.vector.async_vector_env
import time:       221 |        221 |           gym.vector.sync_vector_env
import time:       245 |      10587 |         gym.vector
import time:       517 |        517 |                   _json
import time:       520 |       1037 |                 json.scanner
import time:       556 |       1592 |               json.decoder
import time:       556 |        556 |               json.encoder
import time:       372 |       2519 |             json
import time:       187 |        187 |             gym.wrappers.monitoring
import time:       176 |        176 |               gym.utils.atomic_write
import time:       152 |        152 |               gym.utils.json_utils
import time:       339 |        666 |             gym.wrappers.monitoring.stats_recorder
import time:       149 |        149 |                 msvcrt
import time:       573 |        573 |                 _posixsubprocess
import time:       609 |       1330 |               subprocess
import time:       493 |        493 |               tempfile
import time:       453 |        453 |                 distutils.errors
import time:       208 |        208 |                 distutils.debug
import time:       233 |        233 |                 distutils.log
import time:       289 |       1181 |               distutils.spawn
import time:       380 |       3382 |             gym.wrappers.monitoring.video_recorder
import time:       463 |       7215 |           gym.wrappers.monitor
import time:       191 |        191 |           gym.wrappers.time_limit
import time:       205 |        205 |           gym.wrappers.filter_observation
import time:       153 |        153 |             cv2
import time:       253 |        406 |           gym.wrappers.atari_preprocessing
import time:       203 |        203 |           gym.wrappers.rescale_action
import time:       203 |        203 |           gym.wrappers.flatten_observation
import time:       184 |        184 |           gym.wrappers.gray_scale_observation
import time:       243 |        243 |           gym.wrappers.frame_stack
import time:       181 |        181 |           gym.wrappers.transform_observation
import time:       179 |        179 |           gym.wrappers.transform_reward
import time:       188 |        188 |           gym.wrappers.resize_observation
import time:       186 |        186 |           gym.wrappers.clip_action
import time:       190 |        190 |           gym.wrappers.record_episode_statistics
import time:       305 |      10073 |         gym.wrappers
import time:       976 |     144124 |       gym
import time:      1066 |       1066 |             tarfile
import time:      1952 |       1952 |                                 _ssl
import time:      3040 |       4992 |                               ssl
import time:       311 |       5302 |                             urllib3.packages.ssl_match_hostname
import time:       271 |       5572 |                           urllib3.packages
import time:       988 |       6560 |                         urllib3.packages.six
import time:        52 |       6611 |                       urllib3.packages.six.moves
import time:       903 |        903 |                         http
import time:       317 |        317 |                           email
import time:       624 |        624 |                             email.errors
import time:       364 |        364 |                                 email.quoprimime
import time:       234 |        234 |                                 email.base64mime
import time:       292 |        292 |                                     quopri
import time:       232 |        524 |                                   email.encoders
import time:       302 |        826 |                                 email.charset
import time:       897 |       2320 |                               email.header
import time:       930 |        930 |                                     locale
import time:       644 |       1574 |                                   calendar
import time:       396 |       1970 |                                 email._parseaddr
import time:      1243 |       3213 |                               email.utils
import time:       452 |       5983 |                             email._policybase
import time:       747 |       7353 |                           email.feedparser
import time:       429 |       8098 |                         email.parser
import time:       316 |        316 |                           uu
import time:       387 |        387 |                           email._encoded_words
import time:       240 |        240 |                           email.iterators
import time:       601 |       1543 |                         email.message
import time:      1155 |      11698 |                       http.client
import time:        65 |      18373 |                     urllib3.packages.six.moves.http_client
import time:       879 |      19252 |                   urllib3.exceptions
import time:       171 |        171 |                   urllib3._version
import time:       168 |        168 |                             urllib3.contrib
import time:       256 |        256 |                             urllib3.contrib._appengine_environ
import time:       209 |        209 |                             urllib3.util.wait
import time:       467 |       1099 |                           urllib3.util.connection
import time:       153 |        153 |                             brotli
import time:       203 |        355 |                           urllib3.util.request
import time:       176 |        176 |                           urllib3.util.response
import time:       442 |        442 |                           urllib3.util.retry
import time:      9797 |       9797 |                             urllib3.util.url
import time:       332 |        332 |                             urllib3.util.ssltransport
import time:       403 |      10531 |                           urllib3.util.ssl_
import time:       224 |        224 |                           urllib3.util.timeout
import time:       259 |      13084 |                         urllib3.util
import time:       206 |      13290 |                       urllib3.util.proxy
import time:       328 |        328 |                       urllib3._collections
import time:       503 |      14120 |                     urllib3.connection
import time:       608 |        608 |                       _queue
import time:       447 |       1054 |                     queue
import time:       163 |        163 |                             winreg
import time:       465 |        628 |                           mimetypes
import time:       284 |        911 |                         urllib3.fields
import time:       333 |       1244 |                       urllib3.filepost
import time:        53 |         53 |                         urllib3.packages.six.moves.urllib
import time:        61 |        114 |                       urllib3.packages.six.moves.urllib.parse
import time:       244 |       1601 |                     urllib3.request
import time:       160 |        160 |                       brotli
import time:       521 |        681 |                     urllib3.response
import time:       215 |        215 |                     urllib3.util.queue
import time:       488 |      18156 |                   urllib3.connectionpool
import time:       687 |        687 |                   urllib3.poolmanager
import time:       407 |      38670 |                 urllib3
import time:       317 |        317 |                   chardet.compat
import time:       237 |        237 |                       chardet.enums
import time:       216 |        216 |                       chardet.charsetprober
import time:       201 |        653 |                     chardet.charsetgroupprober
import time:       194 |        194 |                       chardet.codingstatemachine
import time:       194 |        194 |                       chardet.escsm
import time:       377 |        763 |                     chardet.escprober
import time:       202 |        202 |                     chardet.latin1prober
import time:       245 |        245 |                         chardet.mbcssm
import time:       194 |        439 |                       chardet.utf8prober
import time:       201 |        201 |                         chardet.mbcharsetprober
import time:       357 |        357 |                           chardet.euctwfreq
import time:       242 |        242 |                           chardet.euckrfreq
import time:       312 |        312 |                           chardet.gb2312freq
import time:       397 |        397 |                           chardet.big5freq
import time:       326 |        326 |                           chardet.jisfreq
import time:       321 |       1953 |                         chardet.chardistribution
import time:       369 |        369 |                         chardet.jpcntx
import time:       242 |       2763 |                       chardet.sjisprober
import time:       213 |        213 |                       chardet.eucjpprober
import time:       193 |        193 |                       chardet.gb2312prober
import time:       212 |        212 |                       chardet.euckrprober
import time:       184 |        184 |                       chardet.cp949prober
import time:       183 |        183 |                       chardet.big5prober
import time:       187 |        187 |                       chardet.euctwprober
import time:       260 |       4629 |                     chardet.mbcsgroupprober
import time:       199 |        199 |                       chardet.sbcharsetprober
import time:       243 |        243 |                       chardet.langcyrillicmodel
import time:       234 |        234 |                       chardet.langgreekmodel
import time:       231 |        231 |                       chardet.langbulgarianmodel
import time:       231 |        231 |                       chardet.langthaimodel
import time:       224 |        224 |                       chardet.langhebrewmodel
import time:       191 |        191 |                       chardet.hebrewprober
import time:       227 |        227 |                       chardet.langturkishmodel
import time:       535 |       2312 |                     chardet.sbcsgroupprober
import time:       424 |       8980 |                   chardet.universaldetector
import time:       162 |        162 |                   chardet.version
import time:       349 |       9807 |                 chardet
import time:       599 |        599 |                 requests.exceptions
import time:       173 |        173 |                 requests.__version__
import time:      1131 |       1131 |                   zipfile
import time:       381 |        381 |                         importlib.resources
import time:       304 |        685 |                       certifi.core
import time:       362 |       1046 |                     certifi
import time:       179 |       1225 |                   requests.certs
import time:       142 |        142 |                       simplejson
import time:       281 |        281 |                           urllib.response
import time:       304 |        585 |                         urllib.error
import time:      5084 |       5084 |                         _scproxy
import time:      1449 |       7118 |                       urllib.request
import time:      3980 |       3980 |                       http.cookiejar
import time:      1913 |       1913 |                       http.cookies
import time:       259 |      13410 |                     requests.compat
import time:       183 |      13593 |                   requests._internal_utils
import time:       524 |        524 |                   requests.cookies
import time:       336 |        336 |                   requests.structures
import time:       806 |      17613 |                 requests.utils
import time:       289 |        289 |                     idna.package_data
import time:       306 |        306 |                       idna.idnadata
import time:       668 |        668 |                       unicodedata
import time:       215 |        215 |                       idna.intranges
import time:       947 |       2134 |                     idna.core
import time:       357 |       2779 |                   idna
import time:       722 |       3500 |                 requests.packages
import time:       471 |        471 |                     stringprep
import time:       404 |        874 |                   encodings.idna
import time:       216 |        216 |                   requests.hooks
import time:       350 |        350 |                   requests.auth
import time:       506 |        506 |                   requests.status_codes
import time:       553 |       2498 |                 requests.models
import time:       162 |        162 |                         socks
import time:       254 |        415 |                       urllib3.contrib.socks
import time:       384 |        798 |                     requests.adapters
import time:       527 |       1325 |                   requests.sessions
import time:       270 |       1594 |                 requests.api
import time:       502 |      74951 |               requests
import time:       362 |        362 |               compiler_gym.util.runfiles_path
import time:       296 |      75609 |             compiler_gym.util.download
import time:       606 |      77280 |           compiler_gym.datasets.dataset
import time:       228 |      77507 |         compiler_gym.datasets
import time:        26 |      77533 |       compiler_gym.datasets.dataset
import time:       315 |        315 |             grpc._cython
import time:       208 |        208 |               backports_abc
import time:        49 |         49 |               grpc._cython.logging
import time:        42 |         42 |               grpc._cython.os
import time:        41 |         41 |               grpc._cython.sys
import time:        40 |         40 |               grpc._cython.threading
import time:        58 |         58 |               grpc._cython.time
import time:        57 |         57 |               grpc._cython.grpc
import time:        41 |         41 |               grpc._cython.asyncio
import time:       285 |        285 |                     concurrent
import time:       715 |        715 |                     concurrent.futures._base
import time:       349 |       1348 |                   concurrent.futures
import time:       330 |        330 |                   asyncio.constants
import time:       574 |        574 |                           _opcode
import time:       422 |        996 |                         opcode
import time:       672 |       1667 |                       dis
import time:      1748 |       3414 |                     inspect
import time:       309 |        309 |                       asyncio.format_helpers
import time:       295 |        603 |                     asyncio.base_futures
import time:       233 |        233 |                     asyncio.log
import time:       438 |       4687 |                   asyncio.coroutines
import time:       524 |        524 |                       _contextvars
import time:       276 |        800 |                     contextvars
import time:       316 |        316 |                     asyncio.exceptions
import time:       258 |        258 |                       asyncio.base_tasks
import time:       678 |        935 |                     _asyncio
import time:       642 |       2692 |                   asyncio.events
import time:       394 |        394 |                   asyncio.futures
import time:       307 |        307 |                   asyncio.protocols
import time:       407 |        407 |                     asyncio.transports
import time:       551 |        958 |                   asyncio.sslproto
import time:       446 |        446 |                     asyncio.locks
import time:       590 |        590 |                     asyncio.tasks
import time:       472 |       1506 |                   asyncio.staggered
import time:       318 |        318 |                   asyncio.trsock
import time:      1035 |      13571 |                 asyncio.base_events
import time:       299 |        299 |                 asyncio.runners
import time:       403 |        403 |                 asyncio.queues
import time:       558 |        558 |                 asyncio.streams
import time:       511 |        511 |                 asyncio.subprocess
import time:       430 |        430 |                   asyncio.base_subprocess
import time:       747 |        747 |                   asyncio.selector_events
import time:       829 |       2004 |                 asyncio.unix_events
import time:       460 |      17803 |               asyncio
import time:        78 |         78 |               grpc._cython.collections
import time:        65 |         65 |               grpc._cython.pkgutil
import time:       560 |        560 |               pkgutil
import time:        60 |         60 |               grpc._cython.errno
import time:        48 |         48 |               grpc._cython.contextvars
import time:        41 |         41 |               grpc._cython.contextvars
import time:        48 |         48 |               grpc._cython.platform
import time:        41 |         41 |               grpc._cython.socket
import time:        38 |         38 |               grpc._cython.ipaddress
import time:      1347 |       1347 |               ipaddress
import time:        64 |         64 |               grpc._cython.socket
import time:        67 |         67 |               grpc._cython.socket
import time:        79 |         79 |               grpc._cython.enum
import time:        74 |         74 |               grpc._cython.inspect
import time:        63 |         63 |               grpc._cython.traceback
import time:        48 |         48 |               grpc._cython.functools
import time:      5059 |      26105 |             grpc._cython.cygrpc
import time:       208 |        208 |             grpc._compression
import time:       173 |        173 |             grpc._grpcio_metadata
import time:       169 |        169 |               grpc_tools
import time:       324 |        492 |             grpc._runtime_protos
import time:       137 |        137 |             grpc_tools
import time:       133 |        133 |             grpc_health
import time:       128 |        128 |             grpc_reflection
import time:       361 |        361 |                   grpc.aio._metadata
import time:       341 |        702 |                 grpc.aio._typing
import time:       765 |       1467 |               grpc.aio._base_call
import time:       556 |        556 |               grpc.aio._base_channel
import time:       295 |        295 |                 grpc._common
import time:       906 |       1201 |               grpc.aio._call
import time:       314 |        314 |                 grpc.aio._utils
import time:      1505 |       1818 |               grpc.aio._interceptor
import time:       442 |        442 |                 grpc.aio._base_server
import time:       474 |        915 |               grpc.aio._server
import time:       800 |        800 |               grpc.aio._channel
import time:       321 |       7076 |             grpc.aio
import time:      3060 |      37822 |           grpc
import time:       418 |        418 |                         xml
import time:       377 |        794 |                       xml.parsers
import time:       861 |        861 |                       pyexpat
import time:       369 |       2024 |                     xml.parsers.expat
import time:      1411 |       3434 |                   plistlib
import time:       390 |        390 |                   pkg_resources.extern
import time:       207 |        207 |                       pkg_resources._vendor
import time:       516 |        723 |                     pkg_resources._vendor.appdirs
import time:       191 |        913 |                   pkg_resources.extern.appdirs
import time:       322 |        322 |                       pkg_resources._vendor.packaging.__about__
import time:       260 |        581 |                     pkg_resources._vendor.packaging
import time:        89 |        669 |                   pkg_resources.extern.packaging
import time:       246 |        246 |                     pkg_resources.extern.packaging._structures
import time:       212 |        212 |                     pkg_resources.extern.packaging._typing
import time:      2636 |       3094 |                   pkg_resources.extern.packaging.version
import time:       213 |        213 |                     pkg_resources.extern.packaging._compat
import time:       302 |        302 |                     pkg_resources.extern.packaging.utils
import time:      6013 |       6527 |                   pkg_resources.extern.packaging.specifiers
import time:       569 |        569 |                         pprint
import time:     15541 |      16109 |                       pkg_resources._vendor.pyparsing
import time:       117 |      16226 |                     pkg_resources.extern.pyparsing
import time:      1550 |       1550 |                     pkg_resources.extern.packaging.markers
import time:      8399 |      26174 |                   pkg_resources.extern.packaging.requirements
import time:       808 |        808 |                   sysconfig
import time:       419 |        419 |                   _osx_support
import time:      1422 |       1422 |                   _sysconfigdata__darwin_darwin
import time:    114025 |     157871 |                 pkg_resources
import time:       754 |     158624 |               google.protobuf
import time:       219 |        219 |                 google.protobuf.internal
import time:       492 |        492 |                   google.protobuf.internal._api_implementation
import time:        79 |         79 |                   google.protobuf.enable_deterministic_proto_serialization
import time:       442 |       1011 |                 google.protobuf.internal.api_implementation
import time:       411 |        411 |                 google.protobuf.pyext
import time:       674 |        674 |                   google.protobuf.internal.containers
import time:       253 |        253 |                   google.protobuf.internal.enum_type_wrapper
import time:       332 |        332 |                   google.protobuf.message
import time:      3642 |       4900 |                 google.protobuf.pyext._message
import time:       923 |       7463 |               google.protobuf.descriptor
import time:       295 |        295 |                     google.protobuf.descriptor_database
import time:       516 |        516 |                     google.protobuf.text_encoding
import time:       468 |       1278 |                   google.protobuf.descriptor_pool
import time:       240 |        240 |                   google.protobuf.pyext.cpp_message
import time:       301 |       1817 |                 google.protobuf.message_factory
import time:       258 |        258 |                 google.protobuf.symbol_database
import time:       245 |       2319 |               google.protobuf.reflection
import time:      1033 |       1033 |               google.protobuf.internal.well_known_types
import time:      1454 |     170891 |             compiler_gym.service.proto.compiler_gym_service_pb2
import time:       345 |        345 |             compiler_gym.service.proto.compiler_gym_service_pb2_grpc
import time:       284 |     171518 |           compiler_gym.service.proto
import time:       222 |        222 |           compiler_gym.util.debug_util
import time:       923 |     210483 |         compiler_gym.service.connection
import time:       201 |        201 |               version
import time:       525 |        726 |             networkx.release
import time:       412 |        412 |             networkx.exception
import time:      1406 |       1406 |                   _uuid
import time:     10786 |      12192 |                 uuid
import time:       573 |      12764 |               networkx.utils.misc
import time:      1580 |       1580 |                 decorator
import time:       575 |       2155 |               networkx.utils.decorators
import time:      1355 |       1355 |               networkx.utils.random_sequence
import time:       266 |        266 |               networkx.utils.union_find
import time:       256 |        256 |               networkx.utils.rcm
import time:       401 |        401 |               networkx.utils.heaps
import time:       234 |        234 |               networkx.utils.contextmanagers
import time:       431 |      17859 |             networkx.utils
import time:       811 |        811 |                   networkx.classes.coreviews
import time:       923 |        923 |                   networkx.classes.reportviews
import time:       291 |        291 |                   networkx.convert
import time:       663 |       2687 |                 networkx.classes.graph
import time:       369 |        369 |                 networkx.classes.digraph
import time:       336 |        336 |                 networkx.classes.multigraph
import time:       343 |        343 |                 networkx.classes.multidigraph
import time:       409 |        409 |                 networkx.classes.ordered
import time:       232 |        232 |                     networkx.classes.filters
import time:       497 |        728 |                   networkx.classes.graphviews
import time:       621 |       1349 |                 networkx.classes.function
import time:       372 |       5862 |               networkx.classes
import time:        22 |       5883 |             networkx.classes.filters
import time:       634 |        634 |             networkx.convert_matrix
import time:       266 |        266 |             networkx.relabel
import time:       683 |        683 |                 gzip
import time:       454 |       1136 |               networkx.generators.atlas
import time:      1806 |       1806 |               networkx.generators.classic
import time:       446 |        446 |               networkx.generators.cographs
import time:       502 |        502 |                         scipy._lib._testutils
import time:       376 |        878 |                       scipy._lib
import time:       280 |       1157 |                     scipy._lib.deprecation
import time:       338 |        338 |                     scipy.__config__
import time:       199 |        199 |                     scipy.version
import time:       182 |        182 |                     scipy._distributor_init
import time:       649 |        649 |                     scipy._lib._pep440
import time:       973 |        973 |                       scipy._lib._ccallback_c
import time:       381 |       1354 |                     scipy._lib._ccallback
import time:       239 |        239 |                           uarray
import time:       740 |        740 |                               scipy._lib._uarray._uarray
import time:       846 |       1586 |                             scipy._lib._uarray._backend
import time:       255 |       1840 |                           scipy._lib._uarray
import time:       243 |       2320 |                         scipy._lib.uarray
import time:      1224 |       3544 |                       scipy.fft._basic
import time:       643 |        643 |                       scipy.fft._realtransforms
import time:      1086 |       1086 |                             scipy.fft._pocketfft.pypocketfft
import time:       323 |        323 |                             scipy.fft._pocketfft.helper
import time:       422 |       1830 |                           scipy.fft._pocketfft.basic
import time:       246 |        246 |                           scipy.fft._pocketfft.realtransforms
import time:       254 |       2330 |                         scipy.fft._pocketfft
import time:       265 |       2594 |                       scipy.fft._helper
import time:       259 |        259 |                       scipy.fft._backend
import time:       462 |       7501 |                     scipy.fft
import time:      4738 |      16114 |                   scipy
import time:       412 |        412 |                   scipy.special.sf_error
import time:      1159 |       1159 |                     scipy.special._ufuncs_cxx
import time:      5664 |       6823 |                   scipy.special._ufuncs
import time:       664 |        664 |                     scipy.special.specfun
import time:      1017 |       1017 |                             scipy.linalg._fblas
import time:        80 |         80 |                             scipy.linalg._cblas
import time:       409 |       1505 |                           scipy.linalg.blas
import time:      1603 |       1603 |                             scipy.linalg._flapack
import time:        79 |         79 |                             scipy.linalg._clapack
import time:       557 |        557 |                             scipy._lib._util
import time:      1463 |       3700 |                           scipy.linalg.lapack
import time:       468 |       5672 |                         scipy.linalg.misc
import time:       872 |        872 |                             scipy.linalg._flinalg
import time:       237 |       1109 |                           scipy.linalg.flinalg
import time:      1349 |       1349 |                           scipy.linalg.decomp
import time:       287 |        287 |                           scipy.linalg.decomp_svd
import time:       881 |        881 |                           scipy.linalg._solve_toeplitz
import time:       447 |       4071 |                         scipy.linalg.basic
import time:       302 |        302 |                         scipy.linalg.decomp_lu
import time:       320 |        320 |                         scipy.linalg._decomp_ldl
import time:       242 |        242 |                         scipy.linalg.decomp_cholesky
import time:       238 |        238 |                         scipy.linalg.decomp_qr
import time:       256 |        256 |                         scipy.linalg._decomp_qz
import time:       340 |        340 |                         scipy.linalg.decomp_schur
import time:       401 |        401 |                         scipy.linalg._decomp_polar
import time:       515 |        515 |                           scipy.linalg.special_matrices
import time:       359 |        359 |                           scipy.linalg._expm_frechet
import time:     14680 |      14680 |                           scipy.linalg._matfuncs_sqrtm
import time:       526 |      16078 |                         scipy.linalg.matfuncs
import time:       467 |        467 |                         scipy.linalg._solvers
import time:       238 |        238 |                         scipy.linalg._procrustes
import time:      1206 |       1206 |                           scipy.linalg.cython_blas
import time:      2281 |       2281 |                           scipy.linalg.cython_lapack
import time:       830 |       4317 |                         scipy.linalg._decomp_update
import time:       267 |        267 |                               scipy.sparse.sputils
import time:       731 |        997 |                             scipy.sparse.base
import time:       812 |        812 |                               scipy.sparse._sparsetools
import time:       313 |        313 |                                 scipy.sparse.data
import time:       346 |        346 |                                 scipy.sparse.dia
import time:       273 |        273 |                                 scipy.sparse._index
import time:       533 |       1464 |                               scipy.sparse.compressed
import time:       309 |       2584 |                             scipy.sparse.csr
import time:       269 |        269 |                             scipy.sparse.csc
import time:      1041 |       1041 |                               scipy.sparse._csparsetools
import time:       386 |       1427 |                             scipy.sparse.lil
import time:       323 |        323 |                             scipy.sparse.dok
import time:       306 |        306 |                             scipy.sparse.coo
import time:       351 |        351 |                             scipy.sparse.bsr
import time:       284 |        284 |                             scipy.sparse.construct
import time:       179 |        179 |                             scipy.sparse.extract
import time:       175 |        175 |                             scipy.sparse._matrix_io
import time:       303 |        303 |                               scipy.sparse.csgraph._laplacian
import time:       523 |        523 |                                   scipy.sparse.csgraph._tools
import time:       257 |        779 |                                 scipy.sparse.csgraph._validation
import time:       931 |       1710 |                               scipy.sparse.csgraph._shortest_path
import time:       626 |        626 |                               scipy.sparse.csgraph._traversal
import time:       618 |        618 |                               scipy.sparse.csgraph._min_spanning_tree
import time:       773 |        773 |                               scipy.sparse.csgraph._flow
import time:       717 |        717 |                               scipy.sparse.csgraph._matching
import time:       761 |        761 |                               scipy.sparse.csgraph._reordering
import time:       317 |       5821 |                             scipy.sparse.csgraph
import time:       536 |      13246 |                           scipy.sparse
import time:       220 |      13466 |                         scipy.linalg._sketches
import time:       321 |        321 |                         scipy.linalg._decomp_cossin
import time:       971 |      47692 |                       scipy.linalg
import time:       716 |      48408 |                     scipy.special.orthogonal
import time:       546 |        546 |                     scipy.special._comb
import time:       594 |      50210 |                   scipy.special._basic
import time:       229 |        229 |                   scipy.special._logsumexp
import time:       189 |        189 |                   scipy.special.spfun_stats
import time:       624 |        624 |                     scipy.special._ellip_harm_2
import time:       221 |        845 |                   scipy.special._ellip_harm
import time:       215 |        215 |                   scipy.special._lambertw
import time:       191 |        191 |                   scipy.special._spherical_bessel
import time:       553 |      75777 |                 scipy.special
import time:      1717 |      77494 |               networkx.generators.community
import time:      1073 |       1073 |               networkx.generators.degree_seq
import time:      1373 |       1373 |               networkx.generators.directed
import time:       575 |        575 |               networkx.generators.duplication
import time:       195 |        195 |               networkx.generators.ego
import time:       183 |        183 |               networkx.generators.expanders
import time:       493 |        493 |                   scipy.spatial.kdtree
import time:       948 |        948 |                   scipy.spatial.ckdtree
import time:       491 |        491 |                     scipy._lib.messagestream
import time:      1126 |       1617 |                   scipy.spatial.qhull
import time:       576 |        576 |                     scipy.spatial._voronoi
import time:       305 |        880 |                   scipy.spatial._spherical_voronoi
import time:       557 |        557 |                     scipy._lib.decorator
import time:       541 |       1098 |                   scipy.spatial._plotutils
import time:       189 |        189 |                   scipy.spatial._procrustes
import time:       790 |        790 |                       scipy.spatial._distance_wrap
import time:       571 |        571 |                       scipy.spatial._hausdorff
import time:       641 |       2000 |                     scipy.spatial.distance
import time:       188 |       2188 |                   scipy.spatial._geometric_slerp
import time:      4108 |       4108 |                           scipy.constants.codata
import time:       259 |        259 |                           scipy.constants.constants
import time:       971 |       5338 |                         scipy.constants
import time:       204 |       5541 |                       scipy.spatial.transform._rotation_groups
import time:       497 |       6037 |                     scipy.spatial.transform.rotation
import time:       267 |        267 |                     scipy.spatial.transform._rotation_spline
import time:       223 |       6526 |                   scipy.spatial.transform
import time:       321 |      14256 |                 scipy.spatial
import time:      2463 |      16718 |               networkx.generators.geometric
import time:       466 |        466 |               networkx.generators.internet_as_graphs
import time:       308 |        308 |                     networkx.algorithms.assortativity.connectivity
import time:       165 |        165 |                         networkx.algorithms.assortativity.pairs
import time:       190 |        354 |                       networkx.algorithms.assortativity.mixing
import time:       197 |        551 |                     networkx.algorithms.assortativity.correlation
import time:       163 |        163 |                     networkx.algorithms.assortativity.neighbor_degree
import time:       421 |       1442 |                   networkx.algorithms.assortativity
import time:      1085 |       1085 |                   networkx.algorithms.asteroidal
import time:       192 |        192 |                   networkx.algorithms.boundary
import time:      1190 |       1190 |                   networkx.algorithms.bridges
import time:       566 |        566 |                   networkx.algorithms.chains
import time:       951 |        951 |                     networkx.algorithms.centrality.betweenness
import time:       203 |        203 |                     networkx.algorithms.centrality.betweenness_subset
import time:       503 |        503 |                     networkx.algorithms.centrality.closeness
import time:      1081 |       1081 |                     networkx.algorithms.centrality.subgraph_alg
import time:       268 |        268 |                       networkx.algorithms.centrality.flow_matrix
import time:       498 |        765 |                     networkx.algorithms.centrality.current_flow_closeness
import time:      1019 |       1019 |                     networkx.algorithms.centrality.current_flow_betweenness
import time:       677 |        677 |                     networkx.algorithms.centrality.current_flow_betweenness_subset
import time:       568 |        568 |                     networkx.algorithms.centrality.degree_alg
import time:       210 |        210 |                     networkx.algorithms.centrality.dispersion
import time:       433 |        433 |                     networkx.algorithms.centrality.eigenvector
import time:       557 |        557 |                     networkx.algorithms.centrality.group
import time:       196 |        196 |                     networkx.algorithms.centrality.harmonic
import time:       638 |        638 |                     networkx.algorithms.centrality.katz
import time:       202 |        202 |                     networkx.algorithms.centrality.load
import time:       294 |        294 |                     networkx.algorithms.centrality.reaching
import time:       190 |        190 |                     networkx.algorithms.centrality.percolation
import time:       402 |        402 |                     networkx.algorithms.centrality.second_order
import time:       695 |        695 |                     networkx.algorithms.centrality.trophic
import time:       183 |        183 |                     networkx.algorithms.centrality.voterank_alg
import time:       488 |      10247 |                   networkx.algorithms.centrality
import time:       835 |        835 |                       networkx.algorithms.components.connected
import time:      1161 |       1161 |                       networkx.algorithms.components.strongly_connected
import time:       667 |        667 |                       networkx.algorithms.components.weakly_connected
import time:       633 |        633 |                       networkx.algorithms.components.attracting
import time:      1044 |       1044 |                       networkx.algorithms.components.biconnected
import time:       408 |        408 |                       networkx.algorithms.components.semiconnected
import time:       277 |       5022 |                     networkx.algorithms.components
import time:       421 |       5443 |                   networkx.algorithms.chordal
import time:      1232 |       1232 |                   networkx.algorithms.cluster
import time:       792 |        792 |                   networkx.algorithms.clique
import time:       794 |        794 |                   networkx.algorithms.communicability_alg
import time:       233 |        233 |                       networkx.algorithms.coloring.greedy_coloring_with_interchange
import time:       573 |        805 |                     networkx.algorithms.coloring.greedy_coloring
import time:       243 |        243 |                     networkx.algorithms.coloring.equitable_coloring
import time:       224 |       1270 |                   networkx.algorithms.coloring
import time:      1074 |       1074 |                   networkx.algorithms.core
import time:       677 |        677 |                   networkx.algorithms.covering
import time:      1167 |       1167 |                   networkx.algorithms.cycles
import time:       204 |        204 |                   networkx.algorithms.cuts
import time:       392 |        392 |                   networkx.algorithms.d_separation
import time:       185 |        185 |                           networkx.algorithms.traversal.breadth_first_search
import time:       278 |        463 |                         networkx.algorithms.traversal.beamsearch
import time:       195 |        195 |                         networkx.algorithms.traversal.depth_first_search
import time:       182 |        182 |                         networkx.algorithms.traversal.edgedfs
import time:       175 |        175 |                         networkx.algorithms.traversal.edgebfs
import time:       226 |       1239 |                       networkx.algorithms.traversal
import time:        20 |       1259 |                     networkx.algorithms.traversal.breadth_first_search
import time:       387 |        387 |                     networkx.generators.trees
import time:      1724 |       3369 |                   networkx.algorithms.dag
import time:       481 |        481 |                   networkx.algorithms.distance_measures
import time:       579 |        579 |                   networkx.algorithms.distance_regular
import time:       384 |        384 |                   networkx.algorithms.dominance
import time:       191 |        191 |                   networkx.algorithms.dominating
import time:       662 |        662 |                   networkx.algorithms.efficiency_measures
import time:       463 |        463 |                   networkx.algorithms.euler
import time:       263 |        263 |                   networkx.algorithms.graphical
import time:       217 |        217 |                   networkx.algorithms.hierarchy
import time:       205 |        205 |                   networkx.algorithms.hybrid
import time:       561 |        561 |                     networkx.algorithms.link_analysis.pagerank_alg
import time:       207 |        207 |                     networkx.algorithms.link_analysis.hits_alg
import time:       197 |        964 |                   networkx.algorithms.link_analysis
import time:      2901 |       2901 |                   networkx.algorithms.link_prediction
import time:      1447 |       1447 |                   networkx.algorithms.lowest_common_ancestors
import time:       270 |        270 |                   networkx.algorithms.isolate
import time:       278 |        278 |                   networkx.algorithms.matching
import time:       250 |        250 |                   networkx.algorithms.minors
import time:       577 |        577 |                   networkx.algorithms.mis
import time:       371 |        371 |                   networkx.algorithms.moral
import time:       552 |        552 |                   networkx.algorithms.non_randomness
import time:       308 |        308 |                     networkx.algorithms.operators.all
import time:       310 |        310 |                     networkx.algorithms.operators.binary
import time:       739 |        739 |                     networkx.algorithms.operators.product
import time:       192 |        192 |                     networkx.algorithms.operators.unary
import time:       253 |       1801 |                   networkx.algorithms.operators
import time:       370 |        370 |                   networkx.algorithms.planarity
import time:       223 |        223 |                   networkx.algorithms.planar_drawing
import time:       535 |        535 |                   networkx.algorithms.reciprocity
import time:       869 |        869 |                   networkx.algorithms.regular
import time:       570 |        570 |                   networkx.algorithms.richclub
import time:       337 |        337 |                     networkx.algorithms.shortest_paths.generic
import time:       221 |        221 |                     networkx.algorithms.shortest_paths.unweighted
import time:       421 |        421 |                     networkx.algorithms.shortest_paths.weighted
import time:       206 |        206 |                     networkx.algorithms.shortest_paths.astar
import time:       193 |        193 |                     networkx.algorithms.shortest_paths.dense
import time:       258 |       1635 |                   networkx.algorithms.shortest_paths
import time:       317 |        317 |                   networkx.algorithms.similarity
import time:       192 |        192 |                   networkx.algorithms.graph_hashing
import time:       519 |        519 |                   networkx.algorithms.simple_paths
import time:      2236 |       2236 |                   networkx.algorithms.smallworld
import time:       192 |        192 |                   networkx.algorithms.smetric
import time:       222 |        222 |                   networkx.algorithms.structuralholes
import time:       726 |        726 |                   networkx.algorithms.sparsifiers
import time:       593 |        593 |                   networkx.algorithms.swap
import time:      1149 |       1149 |                   networkx.algorithms.triads
import time:       200 |        200 |                   networkx.algorithms.vitality
import time:       174 |        174 |                   networkx.algorithms.voronoi
import time:       173 |        173 |                   networkx.algorithms.wiener
import time:       341 |        341 |                     networkx.algorithms.bipartite.basic
import time:       186 |        186 |                     networkx.algorithms.bipartite.centrality
import time:       195 |        195 |                     networkx.algorithms.bipartite.cluster
import time:       219 |        219 |                         networkx.algorithms.bipartite.matrix
import time:       258 |        477 |                       networkx.algorithms.bipartite.matching
import time:       538 |       1014 |                     networkx.algorithms.bipartite.covering
import time:       884 |        884 |                     networkx.algorithms.bipartite.edgelist
import time:       911 |        911 |                     networkx.algorithms.bipartite.projection
import time:       194 |        194 |                     networkx.algorithms.bipartite.redundancy
import time:       172 |        172 |                     networkx.algorithms.bipartite.spectral
import time:      1181 |       1181 |                     networkx.algorithms.bipartite.generators
import time:       303 |       5375 |                   networkx.algorithms.bipartite
import time:       176 |        176 |                       networkx.algorithms.node_classification.utils
import time:       506 |        682 |                     networkx.algorithms.node_classification.hmn
import time:       408 |        408 |                     networkx.algorithms.node_classification.lgc
import time:       219 |       1308 |                   networkx.algorithms.node_classification
import time:       333 |        333 |                             networkx.algorithms.flow.utils
import time:       225 |        558 |                           networkx.algorithms.flow.boykovkolmogorov
import time:       194 |        194 |                           networkx.algorithms.flow.dinitz_alg
import time:       186 |        186 |                           networkx.algorithms.flow.edmondskarp
import time:       230 |        230 |                           networkx.algorithms.flow.preflowpush
import time:       212 |        212 |                           networkx.algorithms.flow.shortestaugmentingpath
import time:       363 |       1740 |                         networkx.algorithms.flow.maxflow
import time:       185 |        185 |                         networkx.algorithms.flow.mincost
import time:       395 |        395 |                         networkx.algorithms.flow.gomory_hu
import time:       497 |        497 |                         networkx.algorithms.flow.capacityscaling
import time:       477 |        477 |                         networkx.algorithms.flow.networksimplex
import time:       244 |       3535 |                       networkx.algorithms.flow
import time:       184 |        184 |                       networkx.algorithms.connectivity.utils
import time:       349 |       4067 |                     networkx.algorithms.connectivity.connectivity
import time:       213 |        213 |                     networkx.algorithms.connectivity.cuts
import time:      3448 |       3448 |                     networkx.algorithms.connectivity.edge_augmentation
import time:      1094 |       1094 |                     networkx.algorithms.connectivity.edge_kcomponents
import time:       325 |        325 |                     networkx.algorithms.connectivity.disjoint_paths
import time:       570 |        570 |                     networkx.algorithms.connectivity.kcomponents
import time:       296 |        296 |                     networkx.algorithms.connectivity.kcutsets
import time:       694 |        694 |                     networkx.algorithms.connectivity.stoerwagner
import time:       332 |      11035 |                   networkx.algorithms.connectivity
import time:       865 |        865 |                     networkx.algorithms.community.asyn_fluid
import time:       279 |        279 |                     networkx.algorithms.community.centrality
import time:       223 |        223 |                     networkx.algorithms.community.kclique
import time:       193 |        193 |                       networkx.algorithms.community.community_utils
import time:       773 |        965 |                     networkx.algorithms.community.kernighan_lin
import time:       721 |        721 |                     networkx.algorithms.community.label_propagation
import time:       491 |        491 |                     networkx.algorithms.community.lukes
import time:       602 |        602 |                       networkx.algorithms.community.quality
import time:       258 |        258 |                       networkx.utils.mapped_queue
import time:       287 |       1146 |                     networkx.algorithms.community.modularity_max
import time:       452 |       5138 |                   networkx.algorithms.community
import time:       360 |        360 |                     networkx.algorithms.isomorphism.isomorph
import time:       359 |        359 |                       networkx.algorithms.isomorphism.isomorphvf2
import time:       304 |        662 |                     networkx.algorithms.isomorphism.vf2userfunc
import time:       314 |        314 |                     networkx.algorithms.isomorphism.matchhelpers
import time:       318 |        318 |                     networkx.algorithms.isomorphism.temporalisomorphvf2
import time:       555 |        555 |                     networkx.algorithms.isomorphism.ismags
import time:       528 |        528 |                     networkx.algorithms.isomorphism.tree_isomorphism
import time:       299 |       3034 |                   networkx.algorithms.isomorphism
import time:      2489 |       2489 |                   networkx.algorithms.tournament
import time:       630 |        630 |                       networkx.algorithms.tree.recognition
import time:       946 |       1576 |                     networkx.algorithms.tree.branchings
import time:       788 |        788 |                     networkx.algorithms.tree.coding
import time:      1011 |       1011 |                     networkx.algorithms.tree.mst
import time:       235 |        235 |                     networkx.algorithms.tree.operations
import time:       440 |        440 |                     networkx.algorithms.tree.decomposition
import time:       309 |       4356 |                   networkx.algorithms.tree
import time:      1672 |      89262 |                 networkx.algorithms
import time:       836 |      90098 |               networkx.generators.intersection
import time:       236 |        236 |               networkx.generators.interval_graph
import time:       722 |        722 |               networkx.generators.joint_degree_seq
import time:       575 |        575 |               networkx.generators.lattice
import time:       689 |        689 |               networkx.generators.line
import time:       640 |        640 |               networkx.generators.mycielski
import time:       239 |        239 |               networkx.generators.nonisomorphic_trees
import time:       440 |        440 |               networkx.generators.random_clustered
import time:      3823 |       3823 |               networkx.generators.random_graphs
import time:       310 |        310 |               networkx.generators.small
import time:       288 |        288 |               networkx.generators.social
import time:       206 |        206 |               networkx.generators.sudoku
import time:       478 |        478 |               networkx.generators.spectral_graph_forge
import time:       441 |        441 |               networkx.generators.stochastic
import time:       220 |        220 |               networkx.generators.triads
import time:       605 |     201461 |             networkx.generators
import time:       871 |        871 |               networkx.readwrite.adjlist
import time:       835 |        835 |               networkx.readwrite.multiline_adjlist
import time:       764 |        764 |               networkx.readwrite.edgelist
import time:       616 |        616 |               networkx.readwrite.gpickle
import time:       696 |        696 |               networkx.readwrite.pajek
import time:       460 |        460 |               networkx.readwrite.leda
import time:      1569 |       1569 |                 networkx.readwrite.graph6
import time:       857 |       2426 |               networkx.readwrite.sparse6
import time:       661 |        661 |               networkx.readwrite.nx_yaml
import time:      1518 |       1518 |                     html.entities
import time:       726 |       2243 |                   html
import time:        26 |       2269 |                 html.entities
import time:      1210 |       3479 |               networkx.readwrite.gml
import time:       333 |        333 |                   xml.etree
import time:       965 |        965 |                   xml.etree.ElementPath
import time:       974 |        974 |                   _elementtree
import time:      1201 |       3472 |                 xml.etree.ElementTree
import time:       230 |        230 |                   lxml
import time:        31 |        260 |                 lxml.etree
import time:      1534 |       5265 |               networkx.readwrite.graphml
import time:      1061 |       1061 |               networkx.readwrite.gexf
import time:       305 |        305 |               networkx.readwrite.nx_shp
import time:       419 |        419 |                 networkx.readwrite.json_graph.node_link
import time:       230 |        230 |                 networkx.readwrite.json_graph.adjacency
import time:       383 |        383 |                 networkx.readwrite.json_graph.tree
import time:       491 |        491 |                 networkx.readwrite.json_graph.jit
import time:       243 |        243 |                 networkx.readwrite.json_graph.cytoscape
import time:       401 |       2165 |               networkx.readwrite.json_graph
import time:       409 |      20006 |             networkx.readwrite
import time:       363 |        363 |               networkx.linalg.attrmatrix
import time:       223 |        223 |               networkx.linalg.spectrum
import time:       215 |        215 |               networkx.linalg.graphmatrix
import time:      1578 |       1578 |               networkx.linalg.laplacianmatrix
import time:      1066 |       1066 |                       scipy.sparse.linalg.isolve._iterative
import time:       673 |        673 |                       scipy.sparse.linalg.interface
import time:       249 |        249 |                       scipy.sparse.linalg.isolve.utils
import time:       271 |        271 |                       scipy._lib._threadsafety
import time:      1543 |       3799 |                     scipy.sparse.linalg.isolve.iterative
import time:       286 |        286 |                     scipy.sparse.linalg.isolve.minres
import time:       272 |        272 |                       scipy.sparse.linalg.isolve._gcrotmk
import time:       252 |        524 |                     scipy.sparse.linalg.isolve.lgmres
import time:       267 |        267 |                     scipy.sparse.linalg.isolve.lsqr
import time:       269 |        269 |                     scipy.sparse.linalg.isolve.lsmr
import time:       428 |       5571 |                   scipy.sparse.linalg.isolve
import time:       815 |        815 |                       scipy.sparse.linalg.dsolve._superlu
import time:       221 |        221 |                         scikits
import time:        27 |        247 |                       scikits.umfpack
import time:       509 |       1570 |                     scipy.sparse.linalg.dsolve.linsolve
import time:       240 |        240 |                     scipy.sparse.linalg.dsolve._add_newdocs
import time:       277 |       2086 |                   scipy.sparse.linalg.dsolve
import time:      1066 |       1066 |                         scipy.sparse.linalg.eigen.arpack._arpack
import time:       419 |        419 |                           scipy.sparse.linalg.eigen.lobpcg.lobpcg
import time:       252 |        671 |                         scipy.sparse.linalg.eigen.lobpcg
import time:       867 |       2603 |                       scipy.sparse.linalg.eigen.arpack.arpack
import time:       334 |       2937 |                     scipy.sparse.linalg.eigen.arpack
import time:       247 |       3183 |                   scipy.sparse.linalg.eigen
import time:       349 |        349 |                     scipy.sparse.linalg._expm_multiply
import time:       449 |        797 |                   scipy.sparse.linalg.matfuncs
import time:       274 |        274 |                   scipy.sparse.linalg._onenormest
import time:       211 |        211 |                   scipy.sparse.linalg._norm
import time:       342 |      12460 |                 scipy.sparse.linalg
import time:       193 |        193 |                     scikits
import time:        19 |        212 |                   scikits.sparse
import time:        19 |        230 |                 scikits.sparse.cholmod
import time:      1766 |      14456 |               networkx.linalg.algebraicconnectivity
import time:      1006 |       1006 |               networkx.linalg.modularitymatrix
import time:       652 |        652 |               networkx.linalg.bethehessianmatrix
import time:       366 |      18854 |             networkx.linalg
import time:       325 |        325 |                 networkx.testing.utils
import time:       193 |        193 |                 networkx.testing.test
import time:       256 |        773 |               networkx.testing
import time:        25 |        797 |             networkx.testing.test
import time:      1472 |       1472 |               networkx.drawing.layout
import time:       378 |        378 |               networkx.drawing.nx_pylab
import time:       555 |        555 |               networkx.drawing.nx_agraph
import time:      1690 |       1690 |               networkx.drawing.nx_pydot
import time:       312 |       4404 |             networkx.drawing
import time:       773 |     272070 |           networkx
import time:       367 |     272436 |         compiler_gym.service.proto2py
import time:       266 |     483185 |       compiler_gym.service
import time:       377 |        377 |           compiler_gym.spaces.named_discrete
import time:       611 |        988 |         compiler_gym.spaces.commandline
import time:       257 |        257 |           compiler_gym.spaces.scalar
import time:       399 |        655 |         compiler_gym.spaces.reward
import time:       294 |        294 |         compiler_gym.spaces.sequence
import time:       366 |       2301 |       compiler_gym.spaces
import time:       317 |        317 |           absl
import time:       806 |        806 |             termios
import time:       418 |       1224 |           getpass
import time:       104 |        104 |             gc
import time:       462 |        565 |           timeit
import time:      1443 |       1443 |               gettext
import time:       539 |       1982 |             getopt
import time:        56 |         56 |                 six.moves
import time:      1239 |       1295 |               absl.flags._helpers
import time:       902 |       2196 |             absl.flags._argument_parser
import time:       345 |        345 |               absl.flags._exceptions
import time:       199 |        199 |                 absl._collections_abc
import time:       448 |        647 |               absl.flags._flag
import time:       401 |        401 |                   xml.dom.domreg
import time:       738 |       1138 |                 xml.dom
import time:       325 |        325 |                   xml.dom.minicompat
import time:       278 |        278 |                     xml.dom.NodeFilter
import time:       593 |        870 |                   xml.dom.xmlbuilder
import time:      1144 |       2338 |                 xml.dom.minidom
import time:       655 |       4130 |               absl.flags._flagvalues
import time:       371 |        371 |               absl.flags._validators
import time:       494 |       5984 |             absl.flags._defines
import time:       507 |      10667 |           absl.flags
import time:       392 |        392 |           absl.logging.converter
import time:      1252 |      14414 |         absl.logging
import time:       312 |      14725 |       compiler_gym.util.timer
import time:       446 |        446 |       compiler_gym.validation_result
import time:       499 |        499 |           compiler_gym.views.observation_space_spec
import time:       420 |        919 |         compiler_gym.views.observation
import time:       280 |        280 |         compiler_gym.views.reward
import time:       255 |       1452 |       compiler_gym.views
import time:      1277 |     747694 |     compiler_gym.envs.compiler_env
import time:       188 |        188 |               rules_python
import time:        25 |        213 |             rules_python.python
import time:        21 |        234 |           rules_python.python.runfiles
import time:       165 |        165 |               rules_python
import time:        20 |        184 |             rules_python.python
import time:        18 |        201 |           rules_python.python.runfiles
import time:       646 |       1080 |         compiler_gym.envs.llvm.benchmarks
import time:       429 |        429 |             concurrent.futures.thread
import time:       190 |        190 |                 rules_python
import time:        21 |        211 |               rules_python.python
import time:        19 |        229 |             rules_python.python.runfiles
import time:      3014 |       3671 |           compiler_gym.envs.llvm.datasets
import time:       419 |        419 |           compiler_gym.envs.llvm.llvm_rewards
import time:       228 |        228 |             compiler_gym.third_party
import time:       395 |        623 |           compiler_gym.third_party.autophase
import time:       255 |        255 |               compiler_gym.third_party.inst2vec.inst2vec_utils
import time:      3186 |       3186 |               compiler_gym.third_party.inst2vec.rgx_utils
import time:       897 |       4338 |             compiler_gym.third_party.inst2vec.inst2vec_preprocess
import time:       242 |        242 |                 rules_python
import time:        23 |        265 |               rules_python.python
import time:        23 |        288 |             rules_python.python.runfiles
import time:       175 |        175 |                 rules_python
import time:        20 |        195 |               rules_python.python
import time:        19 |        213 |             rules_python.python.runfiles
import time:       401 |       5238 |           compiler_gym.third_party.inst2vec
import time:       173 |        173 |               rules_python
import time:        20 |        193 |             rules_python.python
import time:        21 |        213 |           rules_python.python.runfiles
import time:       168 |        168 |               rules_python
import time:        19 |        186 |             rules_python.python
import time:        18 |        204 |           rules_python.python.runfiles
import time:       163 |        163 |               rules_python
import time:        19 |        182 |             rules_python.python
import time:        17 |        199 |           rules_python.python.runfiles
import time:     15899 |      26461 |         compiler_gym.envs.llvm.llvm_env
import time:       638 |        638 |         compiler_gym.envs.llvm.specs
import time:       232 |        232 |         compiler_gym.util.registration
import time:       192 |        192 |             rules_python
import time:        22 |        213 |           rules_python.python
import time:        19 |        232 |         rules_python.python.runfiles
import time:       420 |      29060 |       compiler_gym.envs.llvm
import time:        34 |      29094 |     compiler_gym.envs.llvm.llvm_env
import time:       300 |     777087 |   compiler_gym.envs
import time:       323 |        323 |       humanize.filesize
import time:       222 |        222 |       humanize.i18n
import time:      1392 |       1392 |         fractions
import time:       282 |       1673 |       humanize.number
import time:       467 |        467 |       humanize.time
import time:       884 |       3567 |     humanize
import time:       404 |        404 |       compiler_gym.util.logs
import time:       261 |        261 |               wcwidth.table_wide
import time:       465 |        465 |               wcwidth.table_zero
import time:       198 |        198 |               wcwidth.unicode_versions
import time:       441 |       1363 |             wcwidth.wcwidth
import time:       344 |       1707 |           wcwidth
import time:      1733 |       3439 |         tabulate
import time:       286 |       3724 |       compiler_gym.util.tabulate
import time:       294 |       4421 |     compiler_gym.random_replay
import time:       460 |       8447 |   compiler_gym.random_search
import time:       675 |        675 |       multiprocessing.util
import time:       809 |        809 |         _multiprocessing
import time:       197 |        197 |         _winapi
import time:       712 |       1717 |       multiprocessing.connection
import time:       739 |       3130 |     multiprocessing.pool
import time:       327 |       3457 |   compiler_gym.validate
import time:       580 |     799809 | compiler_gym

Redesign of DataSet API

Redesign the Dataset class to not depend on tar balls and particular data structures.

Currently the datasets are hard coded as tarballs - https://github.com/facebookresearch/CompilerGym/blob/development/compiler_gym/envs/llvm/datasets.py
these later get unpacked into a particular format where the directory structure is very important.

This means that we have to curate them. E.g. we can't pull benchmarks from Anghabench directly, we have to host a tarball somewhere.

Also, if we had random program generators, e.g. CSmith, CLGen, we couldn't really work with them.

Instead, add methods to the Dataset class to install and extract:

class Dataset:
  ...
  def name() -> String
  def install(path_to_use: Path)    # e.g. ~/.compiler_gym/datasets/<name>
  def benchmark_ids() -> Iterable[Any] # Possibly lazy list of benchmark names
  def benchmarks() -> Iterable[Benchmark] # Possibly lazy list of benchmarks
  def benchmark(id: Any) -> Benchmark

class TarballDataset(Dataset):
  def __init__(name: String, url: Stirng, etc..)
  def install(p): download_unpack(p, url)
  def benchmark_ids(): get_filenames_from_install_dir()
  ...

class Anghabench(Dataset):
  ...
  def name(): return "anghabench"
  def install(p): git_clone_into(p, "https://github.com/brenocfg/AnghaBench.git")
  
class CSmith(Dataset):
  def install(p): install_csmith_binary(p)
  def benchmark_ids(): range_all_ints
  def benchmark(id: int): csmith_for_seed(id)

At the same time, something like this would free datasets to have their own directory structure. This might be useful when considering input data for correctness and performance. Sometimes multiple benchmarks will share things.

At init time, the gym could look in the dataset dir (e.g. ~/.compiler_gym/datasets or [ENV COMPILER_GYM_DIR]). Any python scripts in there could be run to register datasets.
Programmatically, people could register their own datasets, outside of that common mechanism.
A command line tool, install_dataset url, could fetch a script from the url, drop it in the dataset dir, then run install.

cBench benchmarks have 'noinline' attribute set

πŸ› Bug

The noinline attribute is set on the cBench-v0 benchmarks (and possibly others, I have not checked). This prevents future inlining operations on them.

The cause appears to be the result of preparing the LLVM-IRs with -O0. The same issue should affect env.make_benchmark(), but there is currently a typo in the implementation (-O instead of -O0) which means that -O1 is used and env.make_benchmark() is not affected:

# NOTE(cummins): There is some discussion about the best way to create
# a bitcode that is unoptimized yet does not hinder downstream
# optimization opportunities. Here we are using a configuration based
# on -O0, yet there is a suggestion that an optimized configuration
# can produce better results if the optimizations themselves are
# explicitly disabled, as in: ["-Oz", "-Xclang", "-disable-llvm-optzns"]
# See: https://lists.llvm.org/pipermail/llvm-dev/2018-August/thread.html#125365
DEFAULT_COPT = [
"-O",
"-Xclang",
"-disable-O0-optnone",
"-Xclang",
"-disable-llvm-passes",
]

To Reproduce

Steps to reproduce the behavior:

$ cd ~/.local/share/compiler_gym/llvm/10.0.0/bitcode_benchmarks/cBench-v0
$ llvm-dis adpcm.bc
$ grep noinline adpcm.ll
; Function Attrs: noinline nounwind ssp uwtable
; Function Attrs: noinline nounwind ssp uwtable
; Function Attrs: noinline nounwind ssp uwtable
attributes #0 = { noinline nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }

Expected behavior

Functions do not have the noinline attribute set.

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.3
  • How you installed CompilerGym (conda, pip, source): pip
  • OS: macOS 11.2.1
  • Python version: 3.8

Additional Context

Thank you @rcorcs for reporting this!

[validation] cBench-v0/stringsearch validation failure

πŸ› Bug

Validation failure of a random episode using the cBench-v0/stringsearch benchmark.

To Reproduce

Steps to reproduce:

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/stringsearch', commandline='opt -deadargelim -scalarizer -bdce -reg2mem -deadargelim -instcombine -ipsccp -prune-eh -flattencfg -jump-threading -post-inline-ee-instrument -sroa -objc-arc-apelim -strip-debug-declare -aggressive-instcombine -tailcallelim -ee-instrument -objc-arc-apelim -coro-split -loop-simplify -lower-constant-intrinsics -loop-idiom -float2int -early-cse-memssa -redundant-dbg-inst-elim -name-anon-globals -loop-unroll -inject-tli-mappings -loop-data-prefetch -loweratomic -break-crit-edges -called-value-propagation -mldst-motion -licm -loop-idiom -loweratomic -structurizecfg -globalsplit input.bc -o output.bc', walltime=0.7697172164916992, reward=0.006134969325153228),
env.apply(state)
print(env.validate())

Expected behavior

Validation succeeds.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8

[validation] cBench-v0/stringsearch validation failure

πŸ› Bug

Unexpected validation failure of benchmark found using random search.

To Reproduce

Steps to reproduce the behavior:

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/stringsearch', commandline='opt -reg2mem -slp-vectorizer -loop-instsimplify -lower-matrix-intrinsics -objc-arc-apelim -sink -objc-arc -loop-distribute -callsite-splitting -loop-unroll -lower-guard-intrinsic -rpo-functionattrs -callsite-splitting -mergeicmps -loop-simplifycfg -lower-expect -insert-gcov-profiling -coro-cleanup -loop-load-elim -loop-reduce -rewrite-statepoints-for-gc -adce -constprop -lower-matrix-intrinsics -licm -pgo-memop-opt -add-discriminators -elim-avail-extern -objc-arc-apelim -lower-expect -inject-tli-mappings -load-store-vectorizer -gvn-hoist -callsite-splitting -extract-blocks -strip-debug-declare -deadargelim -lowerinvoke -loop-vectorize -constmerge -barrier -scalarizer -coro-early -simplifycfg -loop-versioning -gvn -called-value-propagation -loop-interchange -libcalls-shrinkwrap -instcombine -coro-early -lowerswitch -scalarizer -loop-guard-widening -loop-deletion -flattencfg -inject-tli-mappings -die -licm -gvn -loop-unswitch -sroa -instsimplify -loop-simplifycfg -loop-extract-single -loop-unroll -infer-address-spaces -extract-blocks -callsite-splitting -aggressive-instcombine -loop-predication -mergereturn -sink -simple-loop-unswitch -rewrite-statepoints-for-gc -objc-arc-apelim -loop-deletion -lowerinvoke -newgvn -jump-threading -post-inline-ee-instrument -inline -slsr -ipconstprop -instnamer -loop-reduce -gvn -always-inline -slp-vectorizer -indvars -redundant-dbg-inst-elim -globaldce -alignment-from-assumptions -infer-address-spaces -tailcallelim -loop-reroll -argpromotion -loop-instsimplify -early-cse-memssa -partially-inline-libcalls -instsimplify -reg2mem -slsr -objc-arc -loop-unroll -licm -gvn -separate-const-offset-from-gep -redundant-dbg-inst-elim -strip-debug-declare -callsite-splitting -dse -argpromotion -ipsccp -barrier -loop-vectorize -loop-idiom -loop-interchange -guard-widening -structurizecfg input.bc -o output.bc', walltime=0.921574592590332, reward=-1.9938650306748467)
env.apply(state)
print(env.validate())
#> ❌  cBench-v0/stringsearch  Failed 20 of 20 validators: [1/1] 20Γ— Benchmark exited with returncode 139. Output: Segmentat

Expected behavior

Validation succeeds.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.2
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8

[llvm] -gvn-sink action produces nondeterministic states

πŸ› Bug

The -gvn-sink action has been found to produce different states when run multiple times on the same input.

To Reproduce

Steps to reproduce the behavior:

  1. Create an episode that runs -gvn-sink:
cat <<EOF > states.csv
benchmark,reward,walltime,commandline
benchmark://cBench-v0/blowfish,0.35070822,,opt -gvn-sink input.bc -o output.bc
EOF
  1. Run the episode:
python -m compiler_gym.bin.validate --env=llvm-ic-v0 < states.csv
  1. Check the output reported by the validation script. Sometimes it succeeds:
$ python -m compiler_gym.bin.validate --env=llvm-ic-v0 < states.csv
βœ…  benchmark://cBench-v0/blowfish  0.3507

Sometimes it fails:

$ python -m compiler_gym.bin.validate --env=llvm-ic-v0 < states.csv
❌  benchmark://cBench-v0/blowfish  Expected reward 0.3507 but received reward 0.3547

Expected behavior

The -gvn-action should reliably produce the same state.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.2
  • How you installed CompilerGym (conda, pip, source): pip
  • OS: Linux
  • Python version: 3.8

Use URIs for benchmarks and {action,observation,reward} spaces

The RPC interface currently uses a mixture of list indices and names for specifying action/observation/reward spaces. Unify all of those to instead use URIs.

  • Make observation space selector a URI. Suggested URI format:
  • observation-v0://llvm-v0/static/autophase, where llvm-v0/ specifies the service, static means that the observation requires only the code to compute, and autophase is the name of the observation.
  • Make reward space selector a URI and merge the three codesize reward spaces into a single one with a baseline parameter. Suggested URI format:
  • reward-v0://llvm-v0/static/instructioncount?baseline=-Oz, where llvm-v0/ specifies the service, static means that the reward requires only the code to compute, instructioncount is the name of the reward, and basline=-Oz is an optional parameter to the reward space.
  • Make action and action a URI. Suggested URI format:
  • actions-v0://llvm-v0/passes for the action space (possibly parameterized).
  • actions-v0://llvm-v0/passes/dce for the actions (again, possibly parameterized).
  • Make GetSpaces() RPC calls return a list of URIs (without parameters).

Thanks @hughleat for the suggestion.

Ship all data files as separate downloads

πŸš€ Feature

Move the following three large files out of the compiler_gym wheel and into a data archive that is download on-demand for the LLVM environment:

3.8M  ./third_party/inst2vec/dictionary.pickle
6.6M  ./third_party/inst2vec/embeddings.pickle
73M ./envs/llvm/service/compiler_gym-llvm-service

Motivation

We should keep the wheel small, especially as we plan to add support for multiple compilers. Not every user should have to install large binaries and data files for compiler environments that they will not use.

[util/minimize_trajectory] Add a binary recursive partition strategy

πŸš€ Feature

Originally posted by @hughleat in #133 (comment)

I'd like to propose a different search. This first tries to delete all actions. If that doesn't work it tries to delete the first half, then second half. And so on recursively. Max cost is nlgn, but much smaller if there are large regions of dead actions.

def recursive_binary_partition(actions, mask=ones, lo=0, hi=len(actions)):
  if lo == hi:
    return
  mask[lo:hi] = 0
  if hypothesis(masked actions):
    return
  mask[lo:hi] = 1
  md = (lo+hi)/2
  recursive_binary_partition(actions, mask, lo, md)
  recursive_binary_partition(actions, mask, md, hi)

Stateless Service

Making the service stateless would make everyone happy!
This feature req is more a place for thrashing out ideas.

Basic idea is that the service has a set of things, indexed by some hashes.
The client asks for operations to be done to a thing. The service does them and returns the results.

Two commands:

  • upload(blob): hash
    This uploads a blob of something to the service. We don't need to know what it is. The hash lets it be referred to thereafter.
  • apply(hash, function+): any+
    Apply some functions to the thing with the hash, in sequence (i.e. function composition). Return the result of each function.

A session might look like:

  • client: apply(h1, compile-to-bc, opt(-adce), ir-size, opt(-mem2reg), compile-to-bin, binary_size)
  • service: 404 - I don't recognise your h1!
  • client: upload(my-C-file)
  • service: h2. client can check it matches h1
  • client: apply(h2, compile-to-bc, opt(-adce), ir-size, opt(-mem2reg), compile-to-bin, binary_size)
  • service: h3, h4, 10KB, h5, h6, 8KB. I.e. Hashes for each command, query results for each query.
  • client: apply(h5, opt(-inline), compile-to-bin, binary_size)
  • service: h7, h8, 9KB. I.e. starting from an existing point, do something a little different.

The service would be responsible for caching command and query results to make things fast.

Not sure about time to live - especially for uploads.

Polybench dataset has optnone attribute set

πŸ› Bug

The polybench-v0 dataset has been compiled with -O0 and all optimizations suppressed. You can see this by inspecting the IR for the benchmarks, noticing the optnone attribute on the IR functions:

; Function Attrs: noinline nounwind optnone ssp uwtable
define internal void @print_array(i32 %0, double* %1) #0 {

This means that no optimization will ever have an effect on the polybench benchmarks, rendering them unsuitable for use.

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.2

Make all strings accessible from objects.

πŸš€ Feature

String use is error prone and has little support from IDEs.
Instead of writing:
env.observation_space = "IRInstructionCountOs"
which has an error that an IDE can't help me with because that space does not exist,
Write:
env.observation_space = compiler_gym.llvm.observation_spaces.IrInstructionCountOz
Or something like that.
This way the IDE or debugger will auto complete for me and may even tell me there is an error before running it.

compiler_gym.llvm.observation_spaces.IrInstructionCountOz can still be a string, so minimal changes are required.

Motivation

I don't like remembering things or continually having to look things up when the computer can do it for me.

The classes for this could be auto generated from the c++?

Pitch

See above

Alternatives

Don't do it?

Additional context

None

Provide default reward function implementations

πŸš€ Feature

The majority of use cases for reward functions fall under the same basic categories: e.g. "compute incremental change in some observation", "compute incremental change in some scalar observation and normalize the value", etc. Provide subclasses of Reward to implement these common use cases so that users do not have to roll their own. Concretely:

  • Add new Reward subclasses.
  • Refactor the LLVM service to use them.
  • Refactor the example services to use them.

Thanks @bwasti for the suggestion :-)

--benchmark flag not working as expected

πŸ› Bug

--benchmark flag not working correctly. Results in error: AssertionError: Must call reset() before step()

To Reproduce

Steps to reproduce the behavior:

Pass in a --benchmark and then run any action

(compiler_gym) bwasti@devfair0187:~/compiler_gym$ COMPILER_GYM_DEBUG=3 python -m compiler_gym.bin.manual_env --local_service_binary CompilerGym/examples/example_compiler_gym_service/service_py/example_service.py --benchmark bar
I0322 12:18:25.167602 140345274726208 example_service.py:215] Starting service on 42673 with working dir /dev/shm/compiler_gym/service-2021-03-22T12:18:24.112461-60ea
I0322 12:18:25.423372 140342182409984 example_service.py:146] GetSpaces()
Initialized environment in 1.314s
I0322 12:18:25.425686 140342182409984 example_service.py:157] GetBenchmarks()
I0322 12:18:25.426420 140342182409984 example_service.py:157] GetBenchmarks()
Welcome to the CompilerGym Shell!
---------------------------------
Type help or ? for more information.
The 'tutorial' command will give a step by step guide.

compilergym:bar> action -
Action b
Traceback (most recent call last):
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/bin/manual_env.py", line 909, in <module>
    main(sys.argv)
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/bin/manual_env.py", line 904, in main
    shell.cmdloop()
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/cmd.py", line 217, in onecmd
    return func(arg)
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/bin/manual_env.py", line 495, in do_action
    observation, reward, done, info = self.env.step(index)
  File "/private/home/bwasti/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/compiler_env.py", line 761, in step
    assert self.in_episode, "Must call reset() before step()"
AssertionError: Must call reset() before step()

Expected behavior

Same behavior as set_benchmark:

(compiler_gym) bwasti@devfair0187:~/compiler_gym$ COMPILER_GYM_DEBUG=3 python -m compiler_gym.bin.manual_env --local_service_binary CompilerGym/examples/example_compiler_gym_service/service_py/example_service.py
I0322 12:17:23.826539 140646749136704 example_service.py:215] Starting service on 41035 with working dir /dev/shm/compiler_gym/service-2021-03-22T12:17:22.682603-4f26
I0322 12:17:23.992188 140643586266880 example_service.py:146] GetSpaces()
Initialized environment in 1.311s
I0322 12:17:23.994066 140643586266880 example_service.py:157] GetBenchmarks()
I0322 12:17:23.994649 140643586266880 example_service.py:157] GetBenchmarks()
Welcome to the CompilerGym Shell!
---------------------------------
Type help or ? for more information.
The 'tutorial' command will give a step by step guide.

compilergym:NO-BENCHMARK> list_benchmarks
bar, foo

compilergym:NO-BENCHMARK> set_benchmark bar
I0322 12:17:38.067934 140643586266880 example_service.py:164] StartSession(benchmark=bar)
Reset bar environment in 1.4ms

compilergym:bar> action -
Action c
I0322 12:17:40.889100 140643586266880 example_service.py:194] Step()
I0322 12:17:40.889228 140643586266880 example_service.py:101] Apply action 2
Actions c in 4.1ms with reward 0.

compilergym:bar>

Environment

Please fill in this checklist:

  • CompilerGym: 2623458 (Mon Mar 22 11:13:18 2021)
  • How you installed CompilerGym (conda, pip, source): source
  • OS: linux
  • Python version: Python 3.8.8
  • Build command you used (if compiling from source): make install; python setup.py install
  • GCC/clang version (if compiling from source): gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
  • Bazel version (if compiling from source): not sure

[validation] cBench-v0/ghostscript validation failures

πŸ› Bug

In addition to the three failures reported in #103, further validation failures have been discovered using cBench-v0/ghostscript using different random actions.

To Reproduce

Case 1, -ipconstprop

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -strip -callsite-splitting -irce -loop-extract-single -extract-blocks -lcssa -loop-simplify -called-value-propagation -dce -instnamer -lcssa -coro-elide -loop-deletion -mem2reg -loop-unswitch -mergefunc -lower-widenable-condition -add-discriminators -structurizecfg -ipconstprop input.bc -o output.bc', walltime=33.00168228149414, reward=-0.2236433633831916)
env.apply(state)
print(env.validate())

Case 2, -loop-predication

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -inline -separate-const-offset-from-gep -loop-unroll-and-jam -objc-arc -dse -dce -globalopt -reg2mem -slp-vectorizer -load-store-vectorizer -adce -loop-load-elim -loop-idiom -irce -argpromotion -structurizecfg -loop-predication input.bc -o output.bc', walltime=27.421886444091797, reward=-0.6403388729439454)
env.apply(state)
print(env.validate())

Case 3, -mem2reg

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -ipconstprop -insert-gcov-profiling -attributor -scalarizer -jump-threading -globaldce -die -simplifycfg -pgo-memop-opt -rewrite-statepoints-for-gc -loop-reroll -canonicalize-aliases -tailcallelim -canonicalize-aliases -objc-arc-contract -mem2reg -lowerswitch -barrier -irce -globaldce -div-rem-pairs -coro-early -reg2mem -flattencfg -structurizecfg -mem2reg input.bc -o output.bc', walltime=30.639193773269653, reward=-0.2835957592958429)
env.apply(state)
print(env.validate())

Case 4, -slp-vectorizer

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -elim-avail-extern -objc-arc-contract -partially-inline-libcalls -speculative-execution -constmerge -forceattrs -objc-arc-apelim -coro-cleanup -deadargelim -loop-simplifycfg -elim-avail-extern -gvn -constprop -loop-deletion -sancov -mergereturn -dse -strip-nondebug -libcalls-shrinkwrap -post-inline-ee-instrument -sink -loop-load-elim -mem2reg -gvn-hoist -ipsccp -hotcoldsplit -loop-unswitch -inferattrs -sancov -attributor -prune-eh -libcalls-shrinkwrap -sroa -consthoist -loop-guard-widening -dce -lower-constant-intrinsics -lower-guard-intrinsic -adce -globalsplit -loop-extract-single -ee-instrument -consthoist -sroa -instsimplify -loop-simplifycfg -lower-guard-intrinsic -indvars -gvn-hoist -elim-avail-extern -hotcoldsplit -mldst-motion -loop-unroll-and-jam -alignment-from-assumptions -gvn -coro-early -mergefunc -objc-arc-expand -pgo-memop-opt -consthoist -nary-reassociate -licm -inline -lcssa -scalarizer -structurizecfg -slp-vectorizer input.bc -o output.bc', walltime=52.84897208213806, reward=-0.24302046336774957)
env.apply(state)
print(env.validate())

Case 5, -partially-inline-libcalls

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -slp-vectorizer -prune-eh -dse -barrier -nary-reassociate -simplifycfg -flattencfg -attributor -add-discriminators -loop-instsimplify -instsimplify -correlated-propagation -mergeicmps -always-inline -loweratomic -mergereturn -loop-versioning-licm -slp-vectorizer -instnamer -redundant-dbg-inst-elim -sancov -break-crit-edges -div-rem-pairs -memcpyopt -instsimplify -slsr -objc-arc-apelim -hotcoldsplit -sancov -structurizecfg -partially-inline-libcalls input.bc -o output.bc', walltime=32.236912965774536, reward=-0.4733678028104516)
env.apply(state)
print(env.validate())

Case 6, -cross-dso-cfi

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -constmerge -coro-elide -loop-unroll -loop-deletion -add-discriminators -insert-gcov-profiling -coro-elide -deadargelim -globalsplit -newgvn -cross-dso-cfi -mergefunc -loop-extract-single -loop-unroll-and-jam -licm -objc-arc-apelim -add-discriminators -cross-dso-cfi -structurizecfg -cross-dso-cfi input.bc -o output.bc', walltime=27.9717960357666, reward=-0.3990063844855404)
env.apply(state)
print(env.validate())

Expected behavior

Validation succeeds.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8

__version__ is missing when importing gym

πŸ› Bug

When trying to run some scripts in compiler_gym/bin, for example random_search.py

Traceback (most recent call last):
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/Users/jdguo/CompilerGym/compiler_gym/__init__.py", line 21, in <module>
    from compiler_gym.util.version import __version__  # isort:skip
ModuleNotFoundError: No module named 'compiler_gym.util.version'
```## To Reproduce

Steps to reproduce the behavior:

1. In a new environment, pip install compilerGym
2. `python -m compiler_gym.bin.random_search`

## Expected behavior

example should run. 

## Environment

Please fill in this checklist:

- CompilerGym: recent development branch
- How you installed CompilerGym (conda, pip, source): pip install in conda env
- OS: Mac 
- Python version: 3.8
- 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)
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
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

Additional context

Github CI actions are flaky because of network errors during bazel fetch

πŸ› Bug

When running bazel on GitHub, the repository fetch stage occasionally fails with error Tried to reconnect at offset xxx but server didn't support it. Example failure:

ERROR: An error occurred during the fetch of repository 'com_github_grpc_grpc':
   java.io.IOException: Error downloading [https://github.com/grpc/grpc/archive/v1.34.0.tar.gz] to /private/var/tmp/_bazel_runner/079b33da0ef26a5d53e8a115deeb0011/external/com_github_grpc_grpc/v1.34.0.tar.gz: Tried to reconnect at offset 393,216 but server didn't support it
ERROR: no such package '@com_github_grpc_grpc//bazel': java.io.IOException: Error downloading [https://github.com/grpc/grpc/archive/v1.34.0.tar.gz] to /private/var/tmp/_bazel_runner/079b33da0ef26a5d53e8a115deeb0011/external/com_github_grpc_grpc/v1.34.0.tar.gz: Tried to reconnect at offset 393,216 but server didn't support it

To Reproduce

Steps to reproduce the behavior:

  1. Trigger a CI github action.

Add support for Python 3.9

πŸš€ Feature

Add support for python 3.9. This shouldn't require any code changes, but the dependencies may not updating.

Getting error while Build from source in Ubuntu 20.04

❓ Questions and Help

I just forked the repo, try to install the package using pip3 install -e . but got this weird error:

pip3 install -e .
Obtaining file:///home/debo/CompilerGym
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/debo/CompilerGym/setup.py'"'"'; __file__='"'"'/home/debo/CompilerGym/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /home/debo/CompilerGym/
    Complete output (2 lines):
    running egg_info
    error: error in 'egg_base' option: 'bazel-bin/package.runfiles/CompilerGym' does not exist or is not a directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Now my question is how to install it locally in edit mode or it's an error of the package?
I think the contributing guide also needs a section for developers with the instructions of building from source.

Release v0.1.5 is broken

πŸ› Bug

Two clear mistakes:

  1. the macOS image contains a linux binary
  2. make install-test consistently fails due to errors in CompilerGym service startup, but I have been unable to diagnose or repro the error elsewhere yet. Git bisect confirmed that b87ff73 is to blame.

I'll patch those two and aim to get a correct v0.1.6 release prepared by end-of-day.

Environment

  • CompilerGym: 0.1.5
  • How you installed CompilerGym (conda, pip, source): pip
  • OS: macOS and ubuntu 20.04
  • Python version: 3.8.5

CompilerGym v0.1.7 wheel does not install all required package dependencies

πŸ› Bug

CompilerGym release v0.1.7 contains references to third-party packages that are not in the setup.py requirements list:

  • GPUtil>=1.4.0
  • psutil>=5.8.0
  • py-cpuinfo>=7.0.0
  • tqdm>=4.55.0

All references are in the compiler_gym.leaderboard.llvm_instcount module, and will be removed for v0.1.8.

Workaround

Until the next CompilerGym release, please install these requirements manually:

$ pip install 'GPUtil>=1.4.0' 'psutil>=5.8.0' 'py-cpuinfo>=7.0.0' 'tqdm>=4.55.0'

How to execute the generated bitcode?

❓ Questions and Help

I was wondering if there was a standard api in compiler gym to run executed bitcode?

For example if I have the following environment

env = gym.make("llvm-autophase-ic-v0")
env.require_datasets(['cBench-v0'])

And go to the directory containing the datasets bitcode files, try to run one with

lli bitcount.bc

which seg faults - I tried a few other programs and got undefined reference to main. My question is if there is a common way to run these packaged dataset programs pre and post compiler transformations to be able to compute rewards from speedup.

Need eval_policy to operate on environments with observations

πŸš€ Feature

Add observation type to eval_policy. Add a field in Write-up where submitter has to specify whether and which observation they have used for the algorithm.

Motivation

Currently the eval_policy has a hard coded environment of llvm-lc-v0. For someone who wants to submit to the leaderboard, using any of the provided features this will fail the evaluation process.

Pitch

Allow observation to be used.

Add support for discrete and continuous action spaces

πŸš€ Feature

Add the ability to describe discrete and continuous action spaces, with optional bounds.

Motivation

Currently, the ActionSpace specification supports only categorical spaces. This is fine for some problems, such as LLVM phase ordering, but is not sufficiently expressive for many other optimizations such as unroll factors, tiling sizes, inlining thresholds, etc.

Shell improvements

Really just a place to dump some suggested improvements to the shell while I work on something else for a while. All assuming the PR makes it :-)

  • Rename from compiler_gym.bin.manual_env to compiler_gym.shell
  • Ensure benchmark is settable from the command line (no effect currently)
  • Allow changing environment at runtime - currently required to be set on commandline and then can't be changed
  • Command list_envs (see above)
  • require_dataset should update benchmark list without needing restart
  • Add other capabilities from compiler_gym.bin.datasets
  • Long running commands (e.g. greedy 1000, hill_climb 1000, try_all_actions) should be interruptible
  • Allow greedy and hill_climb to have never stop variants, greedy - and hill_climb - (thx Chris!)
  • Allow saving of current actions or the stack view
  • Allow action subsets for greedy and hill_climb
  • random n do action - n times. random - do it forever.
  • The searches aren't really searches as they don't restart or record the best. Consider adding
  • simplify_stack strict so that the final reward or IR doesn't change
  • Update docs to account for change to manual_env
  • exhaustive to do the exhaustive search that I think Bjarke is doing. I.e. BFS on actions while new IRs are produced, on interrupt, report stuff and best found.
  • Make greedy and hill climb available from outside the shell. Currently a bit irritating if you wanted to run greedy on all the benchmarks you have. Likewise, consider the action stack being a first class thing (not sure about this, though).
  • The current approach of redoing the entire stack all the time sucks, and really shows with slow compiles and deep stacks. Get fork working fast instead.
  • Add in an RL agent.
  • Colours for rewards. Red for neg, green for pos, white for 0.

[validation] Timeout during LLVM environment reset()

πŸ› Bug

Running validaiton on the attached results set causes timeout errors during environment reset with an unhelpful error message.

To Reproduce

Run validation on this dataset: results.csv.zip

$ bazel run -c opt //compiler_gym/bin:validate -- --env=llvm-ic-v0 results.csv
INFO: Analyzed target //compiler_gym/bin:validate (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //compiler_gym/bin:validate up-to-date:
  bazel-bin/compiler_gym/bin/validate
INFO: Elapsed time: 0.301s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/compiler_gym/bin/validate '--env=llvm-ic-v0' /home/cec/data/compiler_gym/leaderboard/l
INFO: Build completed successfully, 1 total action
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/adpcm                           1.0000
βœ…  cBench-v0/adpcm                           1.0000
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/adpcm                           1.0000
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/adpcm                           1.0041
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/bitcount                        1.0141
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/blowfish                        1.0352
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/crc32                           1.0000
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/bzip2                           1.0322
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/dijkstra                        1.0194
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/ispell                          1.0005
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/jpeg-d                          1.0218
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/gsm                             1.1495
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/lame                            1.1138
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/patricia                        0.9693
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/qsort                           1.0292
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/rijndael                        1.1148
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/sha                             1.5532
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/jpeg-c                          1.0229
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/stringsearch                    1.0143
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/stringsearch2                   0.9742
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/susan                           1.0061
βœ…  cBench-v0/tiff2bw                         1.0044
βœ…  cBench-v0/tiff2bw                         1.0044
βœ…  cBench-v0/tiff2bw                         1.0044
βœ…  cBench-v0/patricia                        0.9693
51 remaining states to validate ... multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/cec/anaconda3/envs/compiler_gym/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/validate.py", line 22, in _validate_states_worker
    result = env.validate(state)
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/envs/compiler_env.py", line 972, in validate
    fkd = self.fork()
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/envs/compiler_env.py", line 499, in fork
    self.reset()
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/envs/compiler_env.py", line 637, in reset
    reply = self.service(
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/service/connection.py", line 627, in __call__
    return self.connection(
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/service/connection.py", line 208, in __call__
    raise TimeoutError(
TimeoutError: Deadline Exceeded (300.0 seconds)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/bin/validate.py", line 292, in <module>
    app.run(main)
  File "/home/cec/anaconda3/envs/compiler_gym/lib/python3.8/site-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/home/cec/anaconda3/envs/compiler_gym/lib/python3.8/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/bin/validate.py", line 258, in main
    for i, result in enumerate(validation_results, start=1):
  File "/mnt/cache/cec/bazel/_bazel_cec/932e895778ce021fb3c14db8871e2059/execroot/CompilerGym/bazel-out/k8-opt/bin/compiler_gym/bin/validate.runfiles/CompilerGym/compiler_gym/validate.py", line 67, in validate_states
    yield from map_func(
  File "/home/cec/anaconda3/envs/compiler_gym/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
TimeoutError: Deadline Exceeded (300.0 seconds)
bazel run -c opt //compiler_gym/bin:validate -- --env=llvm-ic-v0   1490.37s user 373.11s system 487% cpu 6:22.24 total

Expected behavior

Helpful error message and for the validation script to complete.

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.2
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8
  • Build command you used (if compiling from source): bazel
  • GCC/clang version (if compiling from source): gcc 10.2.0
  • Bazel version (if compiling from source): 3.1.0

[llvm] github-v0 and linux-v0 contain invalid programs

πŸ› Bug

The following benchmarks do not load and should be removed:

benchmark://github-v0/11592
benchmark://github-v0/11615
benchmark://github-v0/11631
benchmark://github-v0/11648
benchmark://github-v0/12084
benchmark://github-v0/12336
benchmark://github-v0/12346
benchmark://github-v0/13003
benchmark://github-v0/1318
benchmark://github-v0/1319
benchmark://github-v0/13341
benchmark://github-v0/13343
benchmark://github-v0/13683
benchmark://github-v0/14058
benchmark://github-v0/1408
benchmark://github-v0/1409
benchmark://github-v0/14468
benchmark://github-v0/14482
benchmark://github-v0/14617
benchmark://github-v0/14618
benchmark://github-v0/14654
benchmark://github-v0/14658
benchmark://github-v0/14666
benchmark://github-v0/15024
benchmark://github-v0/15025
benchmark://github-v0/15026
benchmark://github-v0/15030
benchmark://github-v0/1507
benchmark://github-v0/15542
benchmark://github-v0/15607
benchmark://github-v0/15691
benchmark://github-v0/16063
benchmark://github-v0/16078
benchmark://github-v0/16421
benchmark://github-v0/16428
benchmark://github-v0/16478
benchmark://github-v0/1676
benchmark://github-v0/16807
benchmark://github-v0/17025
benchmark://github-v0/17053
benchmark://github-v0/17082
benchmark://github-v0/17084
benchmark://github-v0/17085
benchmark://github-v0/17086
benchmark://github-v0/17087
benchmark://github-v0/17089
benchmark://github-v0/17090
benchmark://github-v0/17091
benchmark://github-v0/17092
benchmark://github-v0/17093
benchmark://github-v0/17094
benchmark://github-v0/17095
benchmark://github-v0/17096
benchmark://github-v0/17097
benchmark://github-v0/17098
benchmark://github-v0/17099
benchmark://github-v0/17100
benchmark://github-v0/17101
benchmark://github-v0/17102
benchmark://github-v0/17103
benchmark://github-v0/17104
benchmark://github-v0/17105
benchmark://github-v0/17106
benchmark://github-v0/17107
benchmark://github-v0/17108
benchmark://github-v0/17109
benchmark://github-v0/17110
benchmark://github-v0/17111
benchmark://github-v0/17112
benchmark://github-v0/17113
benchmark://github-v0/17114
benchmark://github-v0/17115
benchmark://github-v0/17116
benchmark://github-v0/17117
benchmark://github-v0/17118
benchmark://github-v0/17119
benchmark://github-v0/17120
benchmark://github-v0/17121
benchmark://github-v0/17122
benchmark://github-v0/17123
benchmark://github-v0/17124
benchmark://github-v0/17125
benchmark://github-v0/17126
benchmark://github-v0/17127
benchmark://github-v0/17128
benchmark://github-v0/17129
benchmark://github-v0/17130
benchmark://github-v0/17131
benchmark://github-v0/17132
benchmark://github-v0/17133
benchmark://github-v0/17134
benchmark://github-v0/17135
benchmark://github-v0/17136
benchmark://github-v0/17137
benchmark://github-v0/17138
benchmark://github-v0/17139
benchmark://github-v0/17140
benchmark://github-v0/17141
benchmark://github-v0/17142
benchmark://github-v0/17143
benchmark://github-v0/17144
benchmark://github-v0/17145
benchmark://github-v0/17146
benchmark://github-v0/17147
benchmark://github-v0/17148
benchmark://github-v0/17149
benchmark://github-v0/17150
benchmark://github-v0/17151
benchmark://github-v0/17152
benchmark://github-v0/17153
benchmark://github-v0/17154
benchmark://github-v0/17155
benchmark://github-v0/17156
benchmark://github-v0/17157
benchmark://github-v0/17158
benchmark://github-v0/17159
benchmark://github-v0/17160
benchmark://github-v0/17161
benchmark://github-v0/17162
benchmark://github-v0/17163
benchmark://github-v0/17164
benchmark://github-v0/17165
benchmark://github-v0/17166
benchmark://github-v0/17167
benchmark://github-v0/17168
benchmark://github-v0/17169
benchmark://github-v0/17170
benchmark://github-v0/17171
benchmark://github-v0/17172
benchmark://github-v0/17173
benchmark://github-v0/17174
benchmark://github-v0/17175
benchmark://github-v0/17176
benchmark://github-v0/17177
benchmark://github-v0/17178
benchmark://github-v0/17179
benchmark://github-v0/17180
benchmark://github-v0/17181
benchmark://github-v0/17182
benchmark://github-v0/17183
benchmark://github-v0/17184
benchmark://github-v0/17185
benchmark://github-v0/17186
benchmark://github-v0/17187
benchmark://github-v0/17188
benchmark://github-v0/17189
benchmark://github-v0/17190
benchmark://github-v0/17191
benchmark://github-v0/17192
benchmark://github-v0/17193
benchmark://github-v0/17194
benchmark://github-v0/17195
benchmark://github-v0/17196
benchmark://github-v0/17197
benchmark://github-v0/17198
benchmark://github-v0/17199
benchmark://github-v0/17200
benchmark://github-v0/17201
benchmark://github-v0/17202
benchmark://github-v0/17203
benchmark://github-v0/17204
benchmark://github-v0/17205
benchmark://github-v0/17206
benchmark://github-v0/17207
benchmark://github-v0/17208
benchmark://github-v0/17209
benchmark://github-v0/17214
benchmark://github-v0/17215
benchmark://github-v0/17216
benchmark://github-v0/17220
benchmark://github-v0/17229
benchmark://github-v0/17231
benchmark://github-v0/17232
benchmark://github-v0/17233
benchmark://github-v0/17234
benchmark://github-v0/17238
benchmark://github-v0/17239
benchmark://github-v0/17240
benchmark://github-v0/17241
benchmark://github-v0/17242
benchmark://github-v0/17243
benchmark://github-v0/17244
benchmark://github-v0/17245
benchmark://github-v0/17246
benchmark://github-v0/17247
benchmark://github-v0/17344
benchmark://github-v0/17431
benchmark://github-v0/17436
benchmark://github-v0/17479
benchmark://github-v0/17591
benchmark://github-v0/17594
benchmark://github-v0/17595
benchmark://github-v0/17596
benchmark://github-v0/17597
benchmark://github-v0/17602
benchmark://github-v0/17605
benchmark://github-v0/17612
benchmark://github-v0/17616
benchmark://github-v0/17816
benchmark://github-v0/17817
benchmark://github-v0/17819
benchmark://github-v0/18447
benchmark://github-v0/19928
benchmark://github-v0/19940
benchmark://github-v0/19941
benchmark://github-v0/19973
benchmark://github-v0/2009
benchmark://github-v0/20183
benchmark://github-v0/20200
benchmark://github-v0/20201
benchmark://github-v0/20203
benchmark://github-v0/20204
benchmark://github-v0/20208
benchmark://github-v0/20209
benchmark://github-v0/20215
benchmark://github-v0/20244
benchmark://github-v0/20245
benchmark://github-v0/20246
benchmark://github-v0/20248
benchmark://github-v0/20249
benchmark://github-v0/20253
benchmark://github-v0/20257
benchmark://github-v0/20258
benchmark://github-v0/20259
benchmark://github-v0/20260
benchmark://github-v0/20262
benchmark://github-v0/20263
benchmark://github-v0/20269
benchmark://github-v0/20270
benchmark://github-v0/20271
benchmark://github-v0/20272
benchmark://github-v0/20968
benchmark://github-v0/21880
benchmark://github-v0/22434
benchmark://github-v0/22437
benchmark://github-v0/22457
benchmark://github-v0/22505
benchmark://github-v0/22694
benchmark://github-v0/23301
benchmark://github-v0/23302
benchmark://github-v0/23457
benchmark://github-v0/24497
benchmark://github-v0/24880
benchmark://github-v0/25087
benchmark://github-v0/25296
benchmark://github-v0/25408
benchmark://github-v0/25412
benchmark://github-v0/25446
benchmark://github-v0/25452
benchmark://github-v0/25453
benchmark://github-v0/25457
benchmark://github-v0/25463
benchmark://github-v0/25465
benchmark://github-v0/25468
benchmark://github-v0/25469
benchmark://github-v0/25475
benchmark://github-v0/25537
benchmark://github-v0/25554
benchmark://github-v0/25841
benchmark://github-v0/26104
benchmark://github-v0/26461
benchmark://github-v0/26519
benchmark://github-v0/26866
benchmark://github-v0/26874
benchmark://github-v0/26953
benchmark://github-v0/27360
benchmark://github-v0/27836
benchmark://github-v0/27953
benchmark://github-v0/27978
benchmark://github-v0/27979
benchmark://github-v0/27981
benchmark://github-v0/27982
benchmark://github-v0/27983
benchmark://github-v0/27984
benchmark://github-v0/27985
benchmark://github-v0/27986
benchmark://github-v0/27987
benchmark://github-v0/27988
benchmark://github-v0/27989
benchmark://github-v0/27990
benchmark://github-v0/27991
benchmark://github-v0/27992
benchmark://github-v0/27993
benchmark://github-v0/27994
benchmark://github-v0/27995
benchmark://github-v0/27996
benchmark://github-v0/27997
benchmark://github-v0/27998
benchmark://github-v0/27999
benchmark://github-v0/28000
benchmark://github-v0/28001
benchmark://github-v0/28002
benchmark://github-v0/28003
benchmark://github-v0/28004
benchmark://github-v0/28005
benchmark://github-v0/28006
benchmark://github-v0/28007
benchmark://github-v0/28008
benchmark://github-v0/28009
benchmark://github-v0/28010
benchmark://github-v0/28011
benchmark://github-v0/28012
benchmark://github-v0/28013
benchmark://github-v0/28014
benchmark://github-v0/28015
benchmark://github-v0/28016
benchmark://github-v0/28017
benchmark://github-v0/28018
benchmark://github-v0/28019
benchmark://github-v0/28020
benchmark://github-v0/28021
benchmark://github-v0/28022
benchmark://github-v0/28023
benchmark://github-v0/28024
benchmark://github-v0/28025
benchmark://github-v0/28026
benchmark://github-v0/28027
benchmark://github-v0/28028
benchmark://github-v0/28029
benchmark://github-v0/28030
benchmark://github-v0/28031
benchmark://github-v0/28032
benchmark://github-v0/28033
benchmark://github-v0/28034
benchmark://github-v0/28035
benchmark://github-v0/28036
benchmark://github-v0/28037
benchmark://github-v0/28038
benchmark://github-v0/28039
benchmark://github-v0/28040
benchmark://github-v0/28041
benchmark://github-v0/28042
benchmark://github-v0/28043
benchmark://github-v0/28044
benchmark://github-v0/28045
benchmark://github-v0/28046
benchmark://github-v0/28047
benchmark://github-v0/28048
benchmark://github-v0/28049
benchmark://github-v0/28050
benchmark://github-v0/28051
benchmark://github-v0/28052
benchmark://github-v0/28053
benchmark://github-v0/28054
benchmark://github-v0/28055
benchmark://github-v0/28056
benchmark://github-v0/28057
benchmark://github-v0/28058
benchmark://github-v0/28059
benchmark://github-v0/28060
benchmark://github-v0/28061
benchmark://github-v0/28062
benchmark://github-v0/28063
benchmark://github-v0/28064
benchmark://github-v0/28065
benchmark://github-v0/28066
benchmark://github-v0/28067
benchmark://github-v0/28068
benchmark://github-v0/28071
benchmark://github-v0/28072
benchmark://github-v0/28086
benchmark://github-v0/28087
benchmark://github-v0/28088
benchmark://github-v0/28091
benchmark://github-v0/28092
benchmark://github-v0/28093
benchmark://github-v0/28094
benchmark://github-v0/28095
benchmark://github-v0/28098
benchmark://github-v0/28099
benchmark://github-v0/28100
benchmark://github-v0/28102
benchmark://github-v0/28103
benchmark://github-v0/28104
benchmark://github-v0/28105
benchmark://github-v0/28106
benchmark://github-v0/28107
benchmark://github-v0/28108
benchmark://github-v0/28110
benchmark://github-v0/28111
benchmark://github-v0/28112
benchmark://github-v0/28113
benchmark://github-v0/28114
benchmark://github-v0/28115
benchmark://github-v0/28116
benchmark://github-v0/28117
benchmark://github-v0/28317
benchmark://github-v0/28324
benchmark://github-v0/28326
benchmark://github-v0/28335
benchmark://github-v0/28338
benchmark://github-v0/28518
benchmark://github-v0/28522
benchmark://github-v0/28533
benchmark://github-v0/28653
benchmark://github-v0/28718
benchmark://github-v0/3016
benchmark://github-v0/30648
benchmark://github-v0/30656
benchmark://github-v0/30901
benchmark://github-v0/30908
benchmark://github-v0/30911
benchmark://github-v0/31037
benchmark://github-v0/3108
benchmark://github-v0/31134
benchmark://github-v0/31135
benchmark://github-v0/31152
benchmark://github-v0/31155
benchmark://github-v0/31156
benchmark://github-v0/31157
benchmark://github-v0/31158
benchmark://github-v0/31196
benchmark://github-v0/31197
benchmark://github-v0/31199
benchmark://github-v0/31203
benchmark://github-v0/31205
benchmark://github-v0/31206
benchmark://github-v0/31207
benchmark://github-v0/31208
benchmark://github-v0/31209
benchmark://github-v0/31210
benchmark://github-v0/31214
benchmark://github-v0/31898
benchmark://github-v0/31899
benchmark://github-v0/3246
benchmark://github-v0/32903
benchmark://github-v0/33401
benchmark://github-v0/33456
benchmark://github-v0/34
benchmark://github-v0/34159
benchmark://github-v0/34227
benchmark://github-v0/34563
benchmark://github-v0/3466
benchmark://github-v0/3482
benchmark://github-v0/35
benchmark://github-v0/35513
benchmark://github-v0/3587
benchmark://github-v0/3628
benchmark://github-v0/3633
benchmark://github-v0/36380
benchmark://github-v0/36381
benchmark://github-v0/3639
benchmark://github-v0/3640
benchmark://github-v0/36476
benchmark://github-v0/36477
benchmark://github-v0/3648
benchmark://github-v0/3650
benchmark://github-v0/36509
benchmark://github-v0/3651
benchmark://github-v0/36514
benchmark://github-v0/36516
benchmark://github-v0/36517
benchmark://github-v0/36518
benchmark://github-v0/36519
benchmark://github-v0/3652
benchmark://github-v0/36524
benchmark://github-v0/36525
benchmark://github-v0/36526
benchmark://github-v0/36527
benchmark://github-v0/36539
benchmark://github-v0/36550
benchmark://github-v0/36903
benchmark://github-v0/37428
benchmark://github-v0/37442
benchmark://github-v0/37518
benchmark://github-v0/37624
benchmark://github-v0/37797
benchmark://github-v0/37999
benchmark://github-v0/38004
benchmark://github-v0/38032
benchmark://github-v0/38317
benchmark://github-v0/38332
benchmark://github-v0/38969
benchmark://github-v0/38983
benchmark://github-v0/38984
benchmark://github-v0/38986
benchmark://github-v0/38987
benchmark://github-v0/38988
benchmark://github-v0/38989
benchmark://github-v0/38990
benchmark://github-v0/38991
benchmark://github-v0/38992
benchmark://github-v0/38993
benchmark://github-v0/38994
benchmark://github-v0/38995
benchmark://github-v0/38996
benchmark://github-v0/38997
benchmark://github-v0/38998
benchmark://github-v0/38999
benchmark://github-v0/39000
benchmark://github-v0/39001
benchmark://github-v0/39002
benchmark://github-v0/39003
benchmark://github-v0/39004
benchmark://github-v0/39005
benchmark://github-v0/39006
benchmark://github-v0/39007
benchmark://github-v0/39008
benchmark://github-v0/39009
benchmark://github-v0/39010
benchmark://github-v0/39011
benchmark://github-v0/39012
benchmark://github-v0/39013
benchmark://github-v0/39014
benchmark://github-v0/39015
benchmark://github-v0/39016
benchmark://github-v0/39017
benchmark://github-v0/39018
benchmark://github-v0/39019
benchmark://github-v0/39020
benchmark://github-v0/39021
benchmark://github-v0/39022
benchmark://github-v0/39023
benchmark://github-v0/39024
benchmark://github-v0/39025
benchmark://github-v0/39026
benchmark://github-v0/39027
benchmark://github-v0/39028
benchmark://github-v0/39029
benchmark://github-v0/39030
benchmark://github-v0/39031
benchmark://github-v0/39032
benchmark://github-v0/39033
benchmark://github-v0/39034
benchmark://github-v0/39035
benchmark://github-v0/39036
benchmark://github-v0/39037
benchmark://github-v0/39038
benchmark://github-v0/39039
benchmark://github-v0/39040
benchmark://github-v0/39041
benchmark://github-v0/39042
benchmark://github-v0/39043
benchmark://github-v0/39044
benchmark://github-v0/39045
benchmark://github-v0/39046
benchmark://github-v0/39047
benchmark://github-v0/39048
benchmark://github-v0/39049
benchmark://github-v0/39050
benchmark://github-v0/39051
benchmark://github-v0/39052
benchmark://github-v0/39053
benchmark://github-v0/39054
benchmark://github-v0/39055
benchmark://github-v0/39056
benchmark://github-v0/39057
benchmark://github-v0/39058
benchmark://github-v0/39059
benchmark://github-v0/39060
benchmark://github-v0/39061
benchmark://github-v0/39062
benchmark://github-v0/39063
benchmark://github-v0/39064
benchmark://github-v0/39065
benchmark://github-v0/39066
benchmark://github-v0/39067
benchmark://github-v0/39068
benchmark://github-v0/39069
benchmark://github-v0/39070
benchmark://github-v0/39071
benchmark://github-v0/39072
benchmark://github-v0/39073
benchmark://github-v0/39074
benchmark://github-v0/39075
benchmark://github-v0/39076
benchmark://github-v0/39077
benchmark://github-v0/39078
benchmark://github-v0/39079
benchmark://github-v0/39080
benchmark://github-v0/39081
benchmark://github-v0/39082
benchmark://github-v0/39083
benchmark://github-v0/39092
benchmark://github-v0/39093
benchmark://github-v0/39095
benchmark://github-v0/39105
benchmark://github-v0/39108
benchmark://github-v0/39109
benchmark://github-v0/39110
benchmark://github-v0/39111
benchmark://github-v0/39112
benchmark://github-v0/39113
benchmark://github-v0/39114
benchmark://github-v0/39116
benchmark://github-v0/39117
benchmark://github-v0/39118
benchmark://github-v0/39119
benchmark://github-v0/39120
benchmark://github-v0/39121
benchmark://github-v0/39122
benchmark://github-v0/39123
benchmark://github-v0/39124
benchmark://github-v0/39125
benchmark://github-v0/39126
benchmark://github-v0/39306
benchmark://github-v0/39325
benchmark://github-v0/39345
benchmark://github-v0/39354
benchmark://github-v0/39465
benchmark://github-v0/39491
benchmark://github-v0/39504
benchmark://github-v0/39516
benchmark://github-v0/39694
benchmark://github-v0/39699
benchmark://github-v0/39700
benchmark://github-v0/39876
benchmark://github-v0/39881
benchmark://github-v0/39908
benchmark://github-v0/4029
benchmark://github-v0/4035
benchmark://github-v0/4041
benchmark://github-v0/41497
benchmark://github-v0/41871
benchmark://github-v0/41875
benchmark://github-v0/41877
benchmark://github-v0/41879
benchmark://github-v0/41963
benchmark://github-v0/42134
benchmark://github-v0/42135
benchmark://github-v0/42137
benchmark://github-v0/42138
benchmark://github-v0/42140
benchmark://github-v0/42141
benchmark://github-v0/42142
benchmark://github-v0/42182
benchmark://github-v0/42185
benchmark://github-v0/42186
benchmark://github-v0/42197
benchmark://github-v0/42201
benchmark://github-v0/42202
benchmark://github-v0/42203
benchmark://github-v0/42204
benchmark://github-v0/42206
benchmark://github-v0/42207
benchmark://github-v0/42922
benchmark://github-v0/42923
benchmark://github-v0/43133
benchmark://github-v0/43803
benchmark://github-v0/43804
benchmark://github-v0/44179
benchmark://github-v0/44194
benchmark://github-v0/44458
benchmark://github-v0/44568
benchmark://github-v0/44597
benchmark://github-v0/44657
benchmark://github-v0/44720
benchmark://github-v0/44721
benchmark://github-v0/44835
benchmark://github-v0/45056
benchmark://github-v0/4565
benchmark://github-v0/46058
benchmark://github-v0/46059
benchmark://github-v0/46085
benchmark://github-v0/46087
benchmark://github-v0/46309
benchmark://github-v0/46310
benchmark://github-v0/46311
benchmark://github-v0/46720
benchmark://github-v0/47031
benchmark://github-v0/47197
benchmark://github-v0/47235
benchmark://github-v0/47272
benchmark://github-v0/47274
benchmark://github-v0/47622
benchmark://github-v0/47623
benchmark://github-v0/47624
benchmark://github-v0/47625
benchmark://github-v0/47627
benchmark://github-v0/47628
benchmark://github-v0/47629
benchmark://github-v0/47630
benchmark://github-v0/47631
benchmark://github-v0/47632
benchmark://github-v0/47633
benchmark://github-v0/47634
benchmark://github-v0/47635
benchmark://github-v0/47636
benchmark://github-v0/47637
benchmark://github-v0/47638
benchmark://github-v0/47639
benchmark://github-v0/47640
benchmark://github-v0/47641
benchmark://github-v0/47642
benchmark://github-v0/47643
benchmark://github-v0/47644
benchmark://github-v0/47645
benchmark://github-v0/47646
benchmark://github-v0/47647
benchmark://github-v0/47648
benchmark://github-v0/47649
benchmark://github-v0/47650
benchmark://github-v0/47651
benchmark://github-v0/47652
benchmark://github-v0/47653
benchmark://github-v0/47654
benchmark://github-v0/47655
benchmark://github-v0/47656
benchmark://github-v0/47657
benchmark://github-v0/47658
benchmark://github-v0/47659
benchmark://github-v0/47660
benchmark://github-v0/47661
benchmark://github-v0/47662
benchmark://github-v0/47663
benchmark://github-v0/47664
benchmark://github-v0/47665
benchmark://github-v0/47666
benchmark://github-v0/47667
benchmark://github-v0/47668
benchmark://github-v0/47669
benchmark://github-v0/47670
benchmark://github-v0/47671
benchmark://github-v0/47672
benchmark://github-v0/47673
benchmark://github-v0/47674
benchmark://github-v0/47675
benchmark://github-v0/47676
benchmark://github-v0/47677
benchmark://github-v0/47678
benchmark://github-v0/47679
benchmark://github-v0/47680
benchmark://github-v0/47681
benchmark://github-v0/47682
benchmark://github-v0/47683
benchmark://github-v0/47684
benchmark://github-v0/47685
benchmark://github-v0/47686
benchmark://github-v0/47687
benchmark://github-v0/47689
benchmark://github-v0/47693
benchmark://github-v0/47696
benchmark://github-v0/47698
benchmark://github-v0/47699
benchmark://github-v0/47700
benchmark://github-v0/47701
benchmark://github-v0/47702
benchmark://github-v0/47703
benchmark://github-v0/47834
benchmark://github-v0/47929
benchmark://github-v0/48054
benchmark://github-v0/48063
benchmark://github-v0/48064
benchmark://github-v0/48065
benchmark://github-v0/48066
benchmark://github-v0/48305
benchmark://github-v0/48431
benchmark://github-v0/49041
benchmark://github-v0/49053
benchmark://github-v0/4927
benchmark://github-v0/49467
benchmark://github-v0/49468
benchmark://github-v0/49619
benchmark://github-v0/49625
benchmark://github-v0/49626
benchmark://github-v0/49633
benchmark://github-v0/49635
benchmark://github-v0/49658
benchmark://github-v0/49659
benchmark://github-v0/49662
benchmark://github-v0/49667
benchmark://github-v0/528
benchmark://github-v0/5461
benchmark://github-v0/575
benchmark://github-v0/580
benchmark://github-v0/5813
benchmark://github-v0/6062
benchmark://github-v0/6063
benchmark://github-v0/6078
benchmark://github-v0/6079
benchmark://github-v0/6080
benchmark://github-v0/6081
benchmark://github-v0/6082
benchmark://github-v0/6083
benchmark://github-v0/6084
benchmark://github-v0/6085
benchmark://github-v0/6086
benchmark://github-v0/6087
benchmark://github-v0/6088
benchmark://github-v0/6089
benchmark://github-v0/6090
benchmark://github-v0/6091
benchmark://github-v0/6092
benchmark://github-v0/6093
benchmark://github-v0/6094
benchmark://github-v0/6095
benchmark://github-v0/6096
benchmark://github-v0/6097
benchmark://github-v0/6098
benchmark://github-v0/6099
benchmark://github-v0/6100
benchmark://github-v0/6101
benchmark://github-v0/6102
benchmark://github-v0/6103
benchmark://github-v0/6104
benchmark://github-v0/6105
benchmark://github-v0/6106
benchmark://github-v0/6107
benchmark://github-v0/6108
benchmark://github-v0/6109
benchmark://github-v0/6110
benchmark://github-v0/6111
benchmark://github-v0/6112
benchmark://github-v0/6113
benchmark://github-v0/6114
benchmark://github-v0/6115
benchmark://github-v0/6116
benchmark://github-v0/6117
benchmark://github-v0/6118
benchmark://github-v0/6119
benchmark://github-v0/6120
benchmark://github-v0/6121
benchmark://github-v0/6122
benchmark://github-v0/6123
benchmark://github-v0/6124
benchmark://github-v0/6125
benchmark://github-v0/6126
benchmark://github-v0/6127
benchmark://github-v0/6128
benchmark://github-v0/6129
benchmark://github-v0/6130
benchmark://github-v0/6131
benchmark://github-v0/6132
benchmark://github-v0/6133
benchmark://github-v0/6134
benchmark://github-v0/6135
benchmark://github-v0/6136
benchmark://github-v0/6137
benchmark://github-v0/6138
benchmark://github-v0/6139
benchmark://github-v0/6140
benchmark://github-v0/6141
benchmark://github-v0/6142
benchmark://github-v0/6143
benchmark://github-v0/6144
benchmark://github-v0/6145
benchmark://github-v0/6146
benchmark://github-v0/6147
benchmark://github-v0/6148
benchmark://github-v0/6149
benchmark://github-v0/6150
benchmark://github-v0/6151
benchmark://github-v0/6152
benchmark://github-v0/6153
benchmark://github-v0/6154
benchmark://github-v0/6155
benchmark://github-v0/6156
benchmark://github-v0/6157
benchmark://github-v0/6158
benchmark://github-v0/6159
benchmark://github-v0/6160
benchmark://github-v0/6161
benchmark://github-v0/6162
benchmark://github-v0/6163
benchmark://github-v0/6164
benchmark://github-v0/6165
benchmark://github-v0/6166
benchmark://github-v0/6167
benchmark://github-v0/6168
benchmark://github-v0/6169
benchmark://github-v0/6170
benchmark://github-v0/6171
benchmark://github-v0/6172
benchmark://github-v0/6173
benchmark://github-v0/6174
benchmark://github-v0/6175
benchmark://github-v0/6176
benchmark://github-v0/6177
benchmark://github-v0/6178
benchmark://github-v0/6179
benchmark://github-v0/6180
benchmark://github-v0/6181
benchmark://github-v0/6182
benchmark://github-v0/6183
benchmark://github-v0/6184
benchmark://github-v0/6185
benchmark://github-v0/6186
benchmark://github-v0/6187
benchmark://github-v0/6188
benchmark://github-v0/6189
benchmark://github-v0/6190
benchmark://github-v0/6191
benchmark://github-v0/6192
benchmark://github-v0/6193
benchmark://github-v0/6194
benchmark://github-v0/6195
benchmark://github-v0/6196
benchmark://github-v0/6197
benchmark://github-v0/6198
benchmark://github-v0/6199
benchmark://github-v0/6200
benchmark://github-v0/6201
benchmark://github-v0/6202
benchmark://github-v0/6203
benchmark://github-v0/6204
benchmark://github-v0/6205
benchmark://github-v0/6211
benchmark://github-v0/6226
benchmark://github-v0/6230
benchmark://github-v0/6231
benchmark://github-v0/6232
benchmark://github-v0/6234
benchmark://github-v0/6235
benchmark://github-v0/6236
benchmark://github-v0/6237
benchmark://github-v0/6238
benchmark://github-v0/6239
benchmark://github-v0/6240
benchmark://github-v0/6241
benchmark://github-v0/6242
benchmark://github-v0/6243
benchmark://github-v0/6244
benchmark://github-v0/6245
benchmark://github-v0/6246
benchmark://github-v0/6247
benchmark://github-v0/6248
benchmark://github-v0/6249
benchmark://github-v0/6250
benchmark://github-v0/6251
benchmark://github-v0/6252
benchmark://github-v0/6253
benchmark://github-v0/6461
benchmark://github-v0/6462
benchmark://github-v0/6630
benchmark://github-v0/6641
benchmark://github-v0/6642
benchmark://github-v0/6643
benchmark://github-v0/6655
benchmark://github-v0/6663
benchmark://github-v0/669
benchmark://github-v0/6767
benchmark://github-v0/6834
benchmark://github-v0/6848
benchmark://github-v0/6849
benchmark://github-v0/6850
benchmark://github-v0/6851
benchmark://github-v0/6975
benchmark://github-v0/7035
benchmark://github-v0/7059
benchmark://github-v0/7062
benchmark://github-v0/7064
benchmark://github-v0/7263
benchmark://github-v0/7264
benchmark://github-v0/8367
benchmark://github-v0/8368
benchmark://github-v0/8373
benchmark://github-v0/9000
benchmark://github-v0/9038
benchmark://github-v0/9044
benchmark://github-v0/9052
benchmark://github-v0/9054
benchmark://github-v0/9116
benchmark://github-v0/9283
benchmark://github-v0/9284
benchmark://github-v0/9285
benchmark://github-v0/9300
benchmark://github-v0/9301
benchmark://github-v0/9302
benchmark://github-v0/9308
benchmark://github-v0/9320
benchmark://github-v0/9334
benchmark://github-v0/9352
benchmark://github-v0/9353
benchmark://github-v0/9355
benchmark://github-v0/9356
benchmark://github-v0/9358
benchmark://github-v0/9360
benchmark://github-v0/9364
benchmark://github-v0/9366
benchmark://github-v0/9367
benchmark://linux-v0/10619
benchmark://linux-v0/11012
benchmark://linux-v0/11478
benchmark://linux-v0/12425
benchmark://linux-v0/1257
benchmark://linux-v0/12869
benchmark://linux-v0/13580
benchmark://linux-v0/1751
benchmark://linux-v0/1935
benchmark://linux-v0/2058
benchmark://linux-v0/4918
benchmark://linux-v0/5338
benchmark://linux-v0/5344
benchmark://linux-v0/5506
benchmark://linux-v0/5610
benchmark://linux-v0/5902
benchmark://linux-v0/5988
benchmark://linux-v0/6584
benchmark://linux-v0/6717
benchmark://linux-v0/728
benchmark://linux-v0/7517
benchmark://linux-v0/7809
benchmark://linux-v0/7945
benchmark://linux-v0/7948
benchmark://linux-v0/8478
benchmark://linux-v0/9673

To Reproduce

Steps to reproduce the behavior:

env = gym.make("llvm-v0")
env.require_datasets(["linux-v0", "github-v0"])
env.reset(benchmark="...")  # One of the benchmarks from the above list

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Ubuntu 20.04
  • Python version: 3.8.5

[validation] Assert in validate_sha_output() causes infinite hang on failure

πŸ› Bug

Failures in the validation script from this assertion cause the script to hang forever. Stack trace:

❌  cBench-v0/rijndael  Failed 1 of 20 validators: [1/1] Benchmark output differs from expected., Expected: E0227 14:31:39.739494155  442433 backup_poller.cc:133]       Run client channel backup poller: {"created":"@1614465099.739425805","description":"pollset_work","file":"src/core/lib/iomgr/ev_epollex_linux.cc","file_line":321,"referenced_errors":[{"created":"@1614465099.739423909","description":"Bad file descriptor","errno":9,"file":"src/core/lib/iomgr/ev_epollex_linux.cc","file_line":952,"os_error":"Bad file descriptor","syscall":"epoll_wait"}]}, , Actual:
121 remaining states to validate ... multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/validate.py", line 22, in _validate_states_worker
    result = env.validate(state)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/compiler_env.py", line 1009, in validate
    semantics_error = validate_semantics(self)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/llvm/datasets.py", line 469, in composed
    errors = [result for result in results if result is not None]
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/llvm/datasets.py", line 469, in <listcomp>
    errors = [result for result in results if result is not None]
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/llvm/datasets.py", line 468, in <genexpr>
    results = (future.result() for future in as_completed(futures))
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/llvm/datasets.py", line 353, in validator_cb
    validate_result(outcome)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/envs/llvm/datasets.py", line 502, in validate_sha_output
    assert re.match(
AssertionError
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "e_greedy.py", line 115, in <module>
    eval_policy(e_greedy_search)
  File "/private/home/cummins/src/CompilerGym/leaderboard/llvm_codesize/e_greedy/../eval_policy.py", line 233, in eval_policy
    app.run(main)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/private/home/cummins/src/CompilerGym/leaderboard/llvm_codesize/e_greedy/../eval_policy.py", line 231, in main
    validate(["argv0", FLAGS.logfile])
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/bin/validate.py", line 261, in main
    for i, result in enumerate(validation_results, start=1):
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.3-py3.8.egg/compiler_gym/validate.py", line 67, in validate_states
    yield from map_func(
  File "/private/home/cummins/.conda/envs/compiler_gym/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
AssertionError

To Reproduce

Write a unit test that mocks a failing SHA output.

Expected behavior

The error is reported as not ValidationResult.okay(), not an assertion.

Environment

Please fill in this checklist:

  • CompilerGym: v0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Ubuntu 20.04
  • Python version: 3.8

Re-enable compiler errors promotions once gRPC dependency builds

I find that promoting unused variable and return warnings to errors very helpful for catching silly mistakes during development:

-Werror=unused-variable -Werror=unused-result

However, the new gRPC dependency version triggers these warnings, so I've had to remove them from the .bazelrc. Next time we bump this dependency, let's see if we can re-enable them.

[validation] -structurizecfg validation failures

πŸ› Bug

Unexpected validation failure of episodes that terminate in -structurizecfg found using random search. All except the first use the cBench-v0/ghostscript benchmark.

To Reproduce

Case 1

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/stringsearch', commandline='opt -reg2mem -slp-vectorizer -loop-instsimplify -lower-matrix-intrinsics -objc-arc-apelim -sink -objc-arc -loop-distribute -callsite-splitting -loop-unroll -lower-guard-intrinsic -rpo-functionattrs -callsite-splitting -mergeicmps -loop-simplifycfg -lower-expect -insert-gcov-profiling -coro-cleanup -loop-load-elim -loop-reduce -rewrite-statepoints-for-gc -adce -constprop -lower-matrix-intrinsics -licm -pgo-memop-opt -add-discriminators -elim-avail-extern -objc-arc-apelim -lower-expect -inject-tli-mappings -load-store-vectorizer -gvn-hoist -callsite-splitting -extract-blocks -strip-debug-declare -deadargelim -lowerinvoke -loop-vectorize -constmerge -barrier -scalarizer -coro-early -simplifycfg -loop-versioning -gvn -called-value-propagation -loop-interchange -libcalls-shrinkwrap -instcombine -coro-early -lowerswitch -scalarizer -loop-guard-widening -loop-deletion -flattencfg -inject-tli-mappings -die -licm -gvn -loop-unswitch -sroa -instsimplify -loop-simplifycfg -loop-extract-single -loop-unroll -infer-address-spaces -extract-blocks -callsite-splitting -aggressive-instcombine -loop-predication -mergereturn -sink -simple-loop-unswitch -rewrite-statepoints-for-gc -objc-arc-apelim -loop-deletion -lowerinvoke -newgvn -jump-threading -post-inline-ee-instrument -inline -slsr -ipconstprop -instnamer -loop-reduce -gvn -always-inline -slp-vectorizer -indvars -redundant-dbg-inst-elim -globaldce -alignment-from-assumptions -infer-address-spaces -tailcallelim -loop-reroll -argpromotion -loop-instsimplify -early-cse-memssa -partially-inline-libcalls -instsimplify -reg2mem -slsr -objc-arc -loop-unroll -licm -gvn -separate-const-offset-from-gep -redundant-dbg-inst-elim -strip-debug-declare -callsite-splitting -dse -argpromotion -ipsccp -barrier -loop-vectorize -loop-idiom -loop-interchange -guard-widening -structurizecfg input.bc -o output.bc', walltime=0.921574592590332, reward=-1.9938650306748467)
env.apply(state)
print(env.validate())

Case 2

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -always-inline -sroa -lcssa -add-discriminators -infer-address-spaces -float2int -inline -flattencfg -slp-vectorizer -loop-guard-widening -partially-inline-libcalls -extract-blocks -constprop -coro-elide -name-anon-globals -float2int -lower-expect -mergefunc -inferattrs -mergefunc -structurizecfg input.bc -o output.bc', walltime=25.72680974006653, reward=0.044068392270459375)
env.apply(state)
print(env.validate())

Case 3

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -div-rem-pairs -loop-simplifycfg -newgvn -coro-elide -loop-guard-widening -memcpyopt -consthoist -licm -loweratomic -mem2reg -globalopt -simple-loop-unswitch -structurizecfg input.bc -o output.bc', walltime=27.48581290245056, reward=0.0007508027199292861)
env.apply(state)
print(env.validate())

Case 4

env = gym.make("llvm-ic-v0")
state = CompilerEnvState(benchmark='benchmark://cBench-v0/ghostscript', commandline='opt -loop-reduce -aggressive-instcombine -bdce -lcssa -lowerswitch -coro-cleanup -sroa -sink -mergereturn -constprop -slsr -pgo-memop-opt -called-value-propagation -adce -loop-unroll -lower-expect -loop-simplify -dse -simplifycfg -structurizecfg input.bc -o output.bc', walltime=25.87833070755005, reward=0.34423505982459973)
env.apply(state)
print(env.validate())

Expected behavior

Validation succeeds.

Environment

Please fill in this checklist:

  • CompilerGym: 0.1.3
  • How you installed CompilerGym (conda, pip, source): source
  • OS: Pop OS 20.04
  • Python version: 3.8

Got the following error: ValueError: Unknown benchmark "file:////home/gfursin/work/susan.bc"

Hi,

Thank you for the project - looks very interesting!

I got stuck with the following example (ctuning/reproduce-milepost-project#11):

import gym
import compiler_gym
env = gym.make("llvm-v0")
env.reset(benchmark="file:////home/gfursin/work/susan.bc")
env.observation["ProGraML"]
env.observation["Inst2vec"]

I generated susan.bc but I get the following error:

ValueError: Unknown benchmark "file:////home/gfursin/work/susan.bc"

Any suggestions how to fix that, please?

Thanks again for your project,
Grigori

[llvm/cBench-v1] //tests/llvm:benchmark_semantics_validation_test is flaky

πŸ› Bug

There are occasional CI failures from the semantics validation tests. Example failure:

_____ test_validate_benchmark_semantics[benchmark://cBench-v1/tiffdither] ______
[gw1] linux -- Python 3.8.8 /opt/hostedtoolcache/Python/3.8.8/x64/bin/python

env = <compiler_gym.envs.llvm.llvm_env.LlvmEnv object at 0x7f35358ea7f0>
validatable_benchmark_name = 'benchmark://cBench-v1/tiffdither'

    def test_validate_benchmark_semantics(env: LlvmEnv, validatable_benchmark_name: str):
        """Run the validation routine on all benchmarks."""
        env.reward_space = "IrInstructionCount"
        env.reset(benchmark=validatable_benchmark_name)
    
        # Run a single step.
        env.step(env.action_space.flags.index("-mem2reg"))
    
        # Validate the environment state.
        result: ValidationResult = env.validate()
>       assert not result.error_details
E       AssertionError: assert not 'Wrong output'
E        +  where 'Wrong output' = ❌  cBench-v1/tiffdither  Wrong output.error_details

tests/llvm/benchmark_semantics_validation_test.py:146: AssertionError

macOS: Homebrew packages can interfere with C++ compilation

πŸ› Bug

When boost or protobuf packages are installed via homebrew they can interfere with the CompilerGym build, causing compile-time or load-time errors.

To Reproduce

Steps to reproduce the behavior:

  1. brew install boost
  2. make distclean
  3. bazel run //compiler_gym/envs/llvm/service

Error message along the lines of:

dyld: lazy symbol binding failed: Symbol not found: __ZN5boost10filesystem6detail38recursive_directory_iterator_constructERNS0_28recursive_directory_iteratorERKNS0_4pathEjPNS_6system10error_codeE
  Referenced from: /private/var/tmp/_bazel_user/path/to/CompilerGym/compiler_gym/envs/llvm/service/service
  Expected in: flat namespace

Workaround

Uninstall boost prior to building CompilerGym:

  1. brew uninstall --ignore-dependencies protobuf boost
  2. make distclean
  3. Run your build command, e.g. make install

This package conflict only matters at build time. Once you are done building CompilerGym, you can now reinstall the brew packages:

brew install protobuf boost

Environment

  • CompilerGym: 0.1.1
  • How you installed CompilerGym (conda, pip, source): source
  • OS: macOS 11.1
  • Python version: 3.8
  • Build command you used (if compiling from source): bazel run //compiler_gym/envs/llvm/service
  • GCC/clang version (if compiling from source): Apple clang version 12.0.0 (clang-1200.0.26.2)
  • Bazel version (if compiling from source): Build label: 3.1.0
  • Versions of any other relevant libraries: boost: stable 1.75.0 (bottled), HEAD

Environment Connection Issue

πŸ› Bug

The port connection breaks after refreshing the environment multiple times.

To Reproduce

Steps to reproduce the behavior:

  1. When executing the environment multiple times in here
  2. Enabled debug flag by export COMPILER_GYM_DEBUG=3

Output:

I0304 21:05:27.817211 341052928 RunServiceImpl.h:45] LLVM service listening on 64067
I0304 21:05:27.817638 341052928 RunServiceImpl.h:56] Wrote /Users/jdguo/.cache/compiler_gym/service-2021-03-04T21:05:27.798781-f3f9/port.txt
I0304 21:05:28.011813 4583357952 connection.py:325] Connection attempt 1 =
I0304 21:05:28.135140 4583357952 connection.py:325] Connection attempt 2 =
I0304 21:05:28.285143 4583357952 connection.py:325] Connection attempt 3 =
I0304 21:05:28.463429 4583357952 connection.py:325] Connection attempt 4 =
I0304 21:05:28.671988 4583357952 connection.py:325] Connection attempt 5 =
I0304 21:05:28.924084 4583357952 connection.py:325] Connection attempt 6 =
I0304 21:05:29.225484 4583357952 connection.py:325] Connection attempt 7 =
I0304 21:05:29.589740 4583357952 connection.py:325] Connection attempt 8 =
I0304 21:05:30.024158 4583357952 connection.py:325] Connection attempt 9 =
I0304 21:05:30.543173 4583357952 connection.py:325] Connection attempt 10 =
I0304 21:05:31.168564 4583357952 connection.py:325] Connection attempt 11 =
W0304 21:05:31.173238 4583357952 connection.py:529] TimeoutError Failed to connect to RPC service after 10.0 seconds(11 attempts made) (attempt 3)
Traceback (most recent call last):
  File "tabular_q.py", line 138, in <module>
    app.run(main)
  File "/Users/jdguo/.local/lib/python3.8/site-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/Users/jdguo/.local/lib/python3.8/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "tabular_q.py", line 122, in main
    train(q_table)
  File "tabular_q.py", line 77, in train
    env = get_env()
  File "tabular_q.py", line 49, in get_env
    return env_from_flags(benchmark_from_flags())
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/util/flags/env_from_flags.py", line 115, in env_from_flags
    env = gym.make(
  File "/Users/jdguo/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 145, in make
    return registry.make(id, **kwargs)
  File "/Users/jdguo/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 90, in make
    env = spec.make(**kwargs)
  File "/Users/jdguo/.local/lib/python3.8/site-packages/gym/envs/registration.py", line 60, in make
    env = cls(**_kwargs)
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/envs/llvm/llvm_env.py", line 75, in __init__
    super().__init__(
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/envs/compiler_env.py", line 213, in __init__
    self.service = service_connection or CompilerGymServiceConnection(
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/service/connection.py", line 463, in __init__
    self._establish_connection()
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/service/connection.py", line 474, in _establish_connection
    self.connection = self._create_connection(self.endpoint, self.opts, self.logger)
  File "/Users/jdguo/.conda/envs/CompilerGym/lib/python3.8/site-packages/compiler_gym/service/connection.py", line 531, in _create_connection
    raise TimeoutError(
TimeoutError: Failed to create connection to compiler_gym-llvm-service after 10.1 seconds (3/5 attempts made)
I0304 21:05:31.204999 76095488 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.226480 4960256 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.231853 193499136 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.237021 232955904 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.242280 119836672 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.247112 265076736 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.252007 68136960 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.254989 70819840 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.259858 96407552 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]
I0304 21:05:31.280346 90673152 LlvmService.cc:106] Step 5 EndSession(benchmark://cBench-v0/dijkstra), [0]`

Expected behavior

Connection shouldn't crash.

Environment

Please fill in this checklist:

  • CompilerGym: up to date with development
  • How you installed CompilerGym (conda, pip, source): pip in conda env
  • OS: Mac
  • Python version: 3.8
  • Build command you used (if compiling from source): not 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
to generate most of this information. You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

Additional context

Manual env fails without helpful error when no benchmarks are loaded.

πŸ› Bug

compiler_gym.bin.manual_env fails with stacktrace if no benchmarks are loaded.

To Reproduce

> python -m compiler_gym.bin.manual_env --env=llvm-autophase-ic-v0 --benchmark=npb-v0/50
Initialized environment in 264.7ms
Benchmark: [0] random >>> random
> 0
Traceback (most recent call last):
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/bin/manual_env.py", line 179, in <module>
    main(sys.argv)
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/bin/manual_env.py", line 175, in main
    run_manual_env(env)
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/bin/manual_env.py", line 60, in run_manual_env
    eager_observation = env.reset(benchmark=benchmark)
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/envs/llvm/llvm_env.py", line 162, in reset
    return super().reset(*args, **kwargs)
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/envs/compiler_env.py", line 466, in reset
    reply = self.service(
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/service/connection.py", line 547, in __call__
    return self.connection(
  File "/Users/hleather/opt/miniconda3/envs/compiler_gym/lib/python3.8/site-packages/compiler_gym-0.1.1-py3.8.egg/compiler_gym/service/connection.py", line 143, in __call__
    raise ValueError(e.details()) from None
ValueError: Unknown benchmark "npb-v0/50"

Expected behavior

Something like:

> python -m compiler_gym.bin.manual_env --env=llvm-autophase-ic-v0 --benchmark=npb-v0/50
Initialized environment in 264.7ms
No benchmarks available see https://facebookresearch.github.io/CompilerGym/getting_started.html#installing-benchmarks
Exiting...

Environment

Please fill in this checklist:

  • CompilerGym:
  • How you installed CompilerGym (conda, pip, source): source
  • OS: MacOs 10.15.7
  • Python version: 3.8.4
  • Build command you used (if compiling from source): make install
  • GCC/clang version (if compiling from source): Apple clang version 12.0.0 (clang-1200.0.31.1)
  • Bazel version (if compiling from source): 3.1.0- (@non-git)
  • Versions of any other relevant libraries:

You may use the PyTorch
N/A

Ship cBench-v0 by default

πŸš€ Feature

Make cBench-v0 install out of the box.

Motivation

It is a bit irritating using the gym the first time to discover that you have to download a dataset. Better to have at least a few benchmarks immediately available.

Pitch

Clearing obstacles out of the path of first time users is bound to be a good idea.

Alternatives

  1. Don't do it.
  2. Wait for the Dataset API to be overhauled.
  3. Download any dataset on demand (but still has problems - e.g. how do you know what names to use; autodownloading huge datasets; etc.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.