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

Example unrolling service without bazel #530

Merged
merged 8 commits into from
Dec 30, 2021

Conversation

mostafaelhoushi
Copy link
Contributor

Here I build the loop_unroller tool within the repo's CMake. Do you think it is better to have a separate/isolated build script for 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 Dec 26, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2021

Codecov Report

Merging #530 (fb041c1) into development (8611c25) will decrease coverage by 43.80%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           development     #530       +/-   ##
================================================
- Coverage        87.49%   43.68%   -43.81%     
================================================
  Files              113      113               
  Lines             6411     6407        -4     
================================================
- Hits              5609     2799     -2810     
- Misses             802     3608     +2806     
Impacted Files Coverage Δ
compiler_gym/util/logging.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/flags/seed.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/statistics.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/flags/nproc.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/wrappers/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/capture_output.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/flags/episodes.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/leaderboard/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/flags/output_dir.py 0.00% <0.00%> (-100.00%) ⬇️
compiler_gym/util/flags/learning_rate.py 0.00% <0.00%> (-100.00%) ⬇️
... and 73 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8611c25...fb041c1. Read the comment docs.

Copy link
Contributor

@ChrisCummins ChrisCummins left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @mostafaelhoushi!

I think the approach of adding a new build option for the examples directory makes sense to me. @sogartar, as the author of the CMake build, does that look good to you?

Could you update the CI job to build with -DCOMPILER_GYM_BUILD_EXAMPLES=on?

# In the repo's INSTALL.md, follow the 'Building from source using CMake' instructions with `-DCOMPILER_GYM_BUILD_EXAMPLES=ON` added to the `cmake` command
# Then copy the `loop_unroller` binary
$ cd <path to source directory>/examples
$ cp <path to build directory>/examples/example_unrolling_service/loop_unroller/loop_unroller ./example_unrolling_service/loop_unroller/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ChrisCummins here as a hack I am copying the executable from the build directory to next to the Python file in the source directory.
What should be the proper way of doing this? Creating a py_binary for the Python script in CMake and adding the executable as a dependency? I would prefer a way that would treat the script as a standalone.

Maybe add the path to the executable to the PATH environment variable?

Copy link

@sogartar sogartar Dec 28, 2021

Choose a reason for hiding this comment

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

If you make a py_binary it will create a symlink in the build directory under the same subdirectory as is the source file relative to the top source directory.
Then you run the symlink.
This is generally the correct aporach.

@mostafaelhoushi mostafaelhoushi merged commit c06875e into development Dec 30, 2021
@sogartar
Copy link

@ChrisCummins, I missed your question.
Adding COMPILER_GYM_BUILD_EXAMPLES to the CMake cache is good.

@ChrisCummins ChrisCummins deleted the example_unrolling_service_without_bazel branch January 10, 2022 17:47
This was referenced Jan 19, 2022
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.

5 participants