Closed ChrisCummins closed 2 years ago
Merging #575 (27cf83f) into development (d70408f) will increase coverage by
0.06%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## development #575 +/- ##
===============================================
+ Coverage 88.15% 88.22% +0.06%
===============================================
Files 114 114
Lines 6705 6708 +3
===============================================
+ Hits 5911 5918 +7
+ Misses 794 790 -4
Impacted Files | Coverage Δ | |
---|---|---|
compiler_gym/envs/llvm/llvm_benchmark.py | 93.43% <ø> (ø) |
|
compiler_gym/envs/llvm/llvm_env.py | 88.18% <ø> (+0.90%) |
:arrow_up: |
compiler_gym/envs/compiler_env.py | 91.33% <100.00%> (+0.81%) |
:arrow_up: |
...loop_tool/service/loop_tool_compilation_session.py | 89.79% <0.00%> (-0.69%) |
:arrow_down: |
compiler_gym/service/connection.py | 79.01% <0.00%> (+0.32%) |
:arrow_up: |
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 d70408f...27cf83f. Read the comment docs.
The
ObjectTextSize
observation space currently does the equivalent of:This fine for the "basic" case, but it is totally inflexible. What if the user wants to pass in a "-D" define flag? Compile for a different architecture? Control the optimizations applied to the backend?
To address these, this PR adds a mechanism by which users can pass in a custom compilation command (e.g.
$CC -target foobar -Oz $IN
) which the environment can run to then compute the .text section size.Summary of changes:
Pull out the "RealizedBenchmarkDynamicConfig" class into its own header and rename it "BenchmarkDynamicConfig" for consistency.
Add a new
getTextSizeInBytes()
overload that takes a "BenchmarkDynamicConfig" as input and runs the build command to produce a binary.Expose the above function through a new set of binary text size observation spaces:
TextSizeBytes
,TextSizeO0
,TextSizeO3
,TextSizeOz
. Long term, these should be merged with "ObjectTextSize" spaces, but this will change the semantics of the ObjextTextSize space so keep them separate for now.As a side note, the relationship between the cost functions and Benchmark class are a total mess, the whole thing is due an overhaul. However, that is beyond the scope of this PR. This PR attempts only to bolt on some new functionality needed to support cross-compiling.