-
Notifications
You must be signed in to change notification settings - Fork 575
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
Implement AOT static PGO #2243
Merged
Merged
Implement AOT static PGO #2243
Conversation
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
Merge branch main into dev/static_pgo
- Add benchmark dhrystone - Add test pgo scripts for benchmarks - Fix benchmark script issues
Explicitly disable static counter allocation for value profiler since it will be allocated by runtime.
x86-32 target was tested with benchmark coremark, dhrystone, sightglass and polybench.
LGTM |
victoryang00
pushed a commit
to victoryang00/wamr-aot-gc-checkpoint-restore
that referenced
this pull request
May 27, 2024
LLVM PGO (Profile-Guided Optimization) allows the compiler to better optimize code for how it actually runs. This PR implements the AOT static PGO, and is tested on Linux x86-64 and x86-32. The basic steps are: 1. Use `wamrc --enable-llvm-pgo -o <aot_file_of_pgo> <wasm_file>` to generate an instrumented aot file. 2. Compile iwasm with `cmake -DWAMR_BUILD_STATIC_PGO=1` and run `iwasm --gen-prof-file=<raw_profile_file> <aot_file_of_pgo>` to generate the raw profile file. 3. Run `llvm-profdata merge -output=<profile_file> <raw_profile_file>` to merge the raw profile file into the profile file. 4. Run `wamrc --use-prof-file=<profile_file> -o <aot_file> <wasm_file>` to generate the optimized aot file. 5. Run the optimized aot_file: `iwasm <aot_file>`. The test scripts are also added for each benchmark, run `test_pgo.sh` under each benchmark's folder to test the AOT static pgo.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LLVM PGO (Profile-Guided Optimization) allows the compiler to better optimize code
for how it actually runs. This PR implements the AOT static PGO, and is tested on
Linux x86-64 and x86-32. The basic steps are:
wamrc --enable-llvm-pgo -o <aot_file_of_pgo> <wasm_file>
to generate an instrumented aot file.
cmake -DWAMR_BUILD_STATIC_PGO=1
and runiwasm --gen-prof-file=<raw_profile_file> <aot_file_of_pgo>
to generate the raw profile file
llvm-profdata merge -output=<profile_file> <raw_profile_file>
to merge the raw profile file into the profile file
wamrc --use-prof-file=<profile_file> -o <aot_file> <wasm_file>
to generate the optimized aot file
iwasm <aot_file>
The test scripts are also added for each benchmark, run
test_pgo.sh
undereach benchmark's folder to test the AOT static pgo.