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

[llvm] Add an IrSha1 observation space. #267

Merged
merged 2 commits into from
May 13, 2021

Conversation

ChrisCummins
Copy link
Contributor

@ChrisCummins ChrisCummins commented May 12, 2021

This adds a new IrSha1 observation space that is a 40-digit SHA1 checksum of the current module state.

>>> env = gym.make("llvm-v0")
>>> env.reset()
>>> env.observation["IrSha1"]
'859b5ee6ee673571b12e8400ca09a0958a7574ec'
>>> env.step(env.action_space.sample())
(None, None, False, {'action_had_no_effect': False, 'new_action_space': False})
>>> env.observation["IrSha1"]
'937fea8de5fb0fa24ea4307cdc65df8fef188b9d'

This checksum is computed on the service side using LLVM's C++ implementation. It is much faster than serializing the IR and computing a checksum using python's hashlib or similar.

This value is not used so remove it.
@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 May 12, 2021
Copy link
Contributor

@hughleat hughleat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This adds a new `IrSha1` observation space that is a 40-digit SHA1
checksum of the current module state.
@ChrisCummins ChrisCummins merged commit 05e56cb into facebookresearch:development May 13, 2021
@ChrisCummins ChrisCummins deleted the llvm-hash branch May 13, 2021 15:04
This was referenced Jun 3, 2021
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.

3 participants