Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release v0.1.7 #164

Merged
merged 49 commits into from
Apr 2, 2021
Merged

Release v0.1.7 #164

merged 49 commits into from
Apr 2, 2021

Conversation

ChrisCummins
Copy link
Contributor

@ChrisCummins ChrisCummins commented Mar 31, 2021

This release introduces public leaderboards to track the performance of
user-submitted algorithms on compiler optimization tasks.

  • Added a new compiler_gym.leaderboard package which contains utilities for
    preparing leaderboard submissions
    (#161).
  • Added a LLVM instruction count leaderboard and seeded it with a random search
    baseline (#117).
  • Added support for Python 3.9, extending the set of supported python versions to
    3.6, 3.7, 3.8, and 3.9
    (#160).
  • [llvm] Added a new InstCount observation space that contains the counts of
    each type of instruction
    (#159).

Build dependencies update notice

This release updates the required versions for a handful of build dependencies.
If you are building from source and upgrading from an older version of CompilerGym,
your build environment will need to be updated. The easiest way to do that is to
remove your existing conda environment using conda remove --name compiler_gym --all
and to repeat the steps in building from source.

ChrisCummins and others added 30 commits March 23, 2021 19:50
This adds new observation spaces that expose the -instcount pass
values. The -instcount pass counts the number of instructions of each
type in a program, along with the total number of instructions, total
number of blocks, and total number of functions.

There are four new observation spaces: `InstCount`, which returns the
feature vector as a numpy array, `InstCountDict`, which returns the
values as a dictionary of named features, and `InstCountNorm` and
`InstCountNormDict`, which are the same as above but the counts are
instead normalized to the total number of instructions in the program.

Example usage:

    >>> import gym
    >>> import compiler_gym
    >>> env = gym.make("llvm-v0")
    >>> env.observation_space = "InstCountDict"
    >>> env.reset("cBench-v0/crc32")
    {'TotalInstsCount': 196, 'TotalBlocksCount': 29,
    'TotalFuncsCount': 13, 'RetCount': 5, 'BrCount': 24,
    'SwitchCount': 0, 'IndirectBrCount': 0, 'InvokeCount': 0,
    'ResumeCount': 0, 'UnreachableCount': 0, 'CleanupRetCount': 0,
    'CatchRetCount': 0, 'CatchSwitchCount': 0, 'CallBrCount': 0,
    'FNegCount': 0, 'AddCount': 5, 'FAddCount': 0, 'SubCount': 0,
    'FSubCount': 0, 'MulCount': 0, 'FMulCount': 0, 'UDivCount': 0,
    'SDivCount': 0, 'FDivCount': 0, 'URemCount': 0, 'SRemCount': 0,
    'FRemCount': 0, 'ShlCount': 0, 'LShrCount': 3, 'AShrCount': 0,
    'AndCount': 3, 'OrCount': 1, 'XorCount': 8, 'AllocaCount': 24,
    'LoadCount': 51, 'StoreCount': 38, 'GetElementPtrCount': 5,
    'FenceCount': 0, 'AtomicCmpXchgCount': 0, 'AtomicRMWCount': 0,
    'TruncCount': 1, 'ZExtCount': 5, 'SExtCount': 0, 'FPToUICount': 0,
    'FPToSICount': 0, 'UIToFPCount': 0, 'SIToFPCount': 0,
    'FPTruncCount': 0, 'FPExtCount': 0, 'PtrToIntCount': 0,
    'IntToPtrCount': 0, 'BitCastCount': 0, 'AddrSpaceCastCount': 0,
    'CleanupPadCount': 0, 'CatchPadCount': 0, 'ICmpCount': 10,
    'FCmpCount': 0, 'PHICount': 0, 'CallCount': 13, 'SelectCount': 0,
    'UserOp1Count': 0, 'UserOp2Count': 0, 'VAArgCount': 0,
    'ExtractElementCount': 0, 'InsertElementCount': 0,
    'ShuffleVectorCount': 0, 'ExtractValueCount': 0,
    'InsertValueCount': 0, 'LandingPadCount': 0, 'FreezeCount': 0}

The InstCount observation spaces are quick to compute and
lightweight. They have similar computational complexity as Autophase.

Fixes #149.
[llvm] Add an InstCount observation space.
This is required to build grpcio 1.36.0.

Issue #162.
This to enable compiling Pillow from source on Python 3.9.

Issue #162.
This is to fix compilation of Pillow using Python 3.9.

Issue #162.
This adds <!-- omit from toc --> annotations to some of the minor
subheadings to keep the table of contents as simple as possible.

This uses the "Markdown All in One" plugin for VSCode to automatically
keep the table of contents up to date:

https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one#table-of-contents
It makes it harder to copy and paste the commands.
ChrisCummins and others added 9 commits March 31, 2021 14:18
This adds a compiler_gym.leaderboard module that contains the LLVM
codesize leaderboard helper code. New API docs provide improved
explanation of how to use it.

Issue #158.
This is to break the duplicate flag error from
//tests/benchmarks:parallelization_load_test.
Re-order the file so that leaderboard submissions appear directly
below pull requests. Then provide more details about the submission
review process.
Be clear that this leaderboard evaluates performance at reducing the
instruction count of LLVM-IR, not the binary codesize.
[leaderboard] Move leaderboard utility modules into compiler_gym namespace
This adds a pure random policy that selects actions randomly until a
fixed number of steps (the "patience" of the search) have been
evaluated without an improvement to reward. The search stops after a
predetermined amount of search time has elapsed.

The patience value was selected by running a random 200 searches on
programs from the `blas-v0` dataset and selecting the value that
produced the best average reward.
@ChrisCummins ChrisCummins added this to the v0.1.7 milestone Mar 31, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 31, 2021
@ChrisCummins ChrisCummins changed the title WIP: Release v0.1.7 Release v0.1.7 Mar 31, 2021
This release introduces public leaderboards to track the performance
of user-submitted algorithms on compiler optimization tasks.

- Added a new `compiler_gym.leaderboard` package which contains
utilities for preparing leaderboard submissions.

- Added a LLVM instruction count leaderboard and seeded it with a
random search baseline.

- Added support for Python 3.9, extending the set of supported python
versions to 3.6, 3.7, 3.8, and 3.9.

- [llvm] Added a new `InstCount` observation space that contains the
counts of each type of instruction.

Build dependencies update notice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you are building from source and upgrading from an older version of
CompilerGym, your build environment will need to be updated. The
easiest way to do that is to remove your existing conda environment
using `conda remove --name compiler_gym --all` and to repeat the steps
in "building from source" in the README.
@ChrisCummins ChrisCummins marked this pull request as ready for review April 1, 2021 11:45
CI test jobs have flakiness because of exceeded timeouts.
@ChrisCummins ChrisCummins merged commit c728073 into stable Apr 2, 2021
@ChrisCummins ChrisCummins deleted the release-v0.1.7 branch April 2, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants