-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add support for IR2Vec #615
Closed
ChrisCummins
wants to merge
15
commits into
facebookresearch:development
from
anilavakundu:feature/ir2vec
Closed
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
709d8a7
[llvm] Update housekeeping rules comment.
ChrisCummins 13d2afc
Remove unnecessary copts flag.
ChrisCummins a6f7fd9
Add workspace definition for IR2Vec.
ChrisCummins d2c6d50
[llvm] Add IR2Vec header include.
ChrisCummins abb535e
Adding IR2Vec observation space
anilavakundu 0b8d69e
[llvm] Add seed embeddings for ir2vec.
ChrisCummins 044c22e
Fix comment positioning.
ChrisCummins 416df38
[llvm] Add ir2vec embeddings to package dependencies.
ChrisCummins 91a02ca
Adding IR2Vec observation space
anilavakundu 02451fa
Adding IR2Vec Symbolic embedding observation space
anilavakundu b06df0e
Adding Function level observation spaces for IR2Vec
anilavakundu fb13cfd
Clean ups
anilavakundu 2167292
More clean ups
anilavakundu 1553e1f
Clean ups and fix for embedding range
anilavakundu 2253e90
Reverting Program level embeddings to ScalarRange with proper limits
anilavakundu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
# | ||
# IR2Vec. https://github.com/IITH-Compilers/IR2Vec | ||
|
||
filegroup( | ||
name = "embeddings", | ||
srcs = ["seedEmbeddingVocab-300-llvm10.txt"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
cg_add_all_subdirs() | ||
|
||
cg_filegroup( | ||
NAME "embeddings" | ||
FILES | ||
"${CMAKE_CURRENT_LIST_DIR}/seedEmbeddingVocab-300-llvm10.txt" | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this. This code says that values are in the range [0,∞], but when I run your code I see plenty of negative values:
What are the bounds for embedding values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that ScalarRange wasn't a good fit for the shape of the embeddings as the range is not really bounded. I switched this to be of a Sequence type and fixed the length of the sequence type to be of 300 for both max & min. Can you please check the new code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the shape of the two non-function-level spaces? Is it a single 300 dimension vector? Or a list of 300 dimension vectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a single 300 dimension vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKay, it should be an
int64_list
then. You can copy the Autophase space and adjust the dimensionality and limits:CompilerGym/compiler_gym/envs/llvm/service/ObservationSpaces.cc
Lines 81 to 94 in 1553e1f
If there is no lower bound, remove this line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean a
double_list
? The values for the embeddings are floating-point numbersThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, of course, sorry :)