Route benchmark subprocess through the PAR bootstrap (#143)#143
Merged
Conversation
|
@kaiming-cheng has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107483498. |
Summary: The kernel benchmark subprocess in `benchmark.py` launched the child as bare `sys.executable`. Inside a Buck PAR `sys.executable` is the static-linked `#native-main#` interpreter; re-exec'ing it directly leaves it un-bootstrapped (no `LD_LIBRARY_PATH`/`PYTHONPATH`/`LD_PRELOAD` from the PAR `_bootstrap.sh`), so the benchmark child fails to load bundled shared libraries (e.g. `libevict-thrift-py3-extensions.so`). Every candidate then benchmarks as `inf` and `opt_manager` reports "did not produce an improved kernel". KA already ships the bootstrap hook: `setup_internal_environment()` sets `KERNEL_PROFILER_PYTHON` to the PAR `_bootstrap.sh` (which rebuilds the env from `$0` before exec-ing the native main), but only `ncu_profiler.py` honored it. Route the benchmark child through the same hook, falling back to `sys.executable` when unset (OSS / non-PAR). Reviewed By: stashuk-olek Differential Revision: D107483498
eaacd26 to
850f11b
Compare
|
@wychi has imported this pull request. If you are a Meta employee, you can view this in D107483498. |
This file contains hidden or 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
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.
Summary:
The kernel benchmark subprocess in
benchmark.pylaunched the child as baresys.executable. Inside a Buck PARsys.executableis the static-linked#native-main#interpreter; re-exec'ing it directly leaves it un-bootstrapped (noLD_LIBRARY_PATH/PYTHONPATH/LD_PRELOADfrom the PAR_bootstrap.sh), so the benchmark child fails to load bundled shared libraries (e.g.libevict-thrift-py3-extensions.so). Every candidate then benchmarks asinfandopt_managerreports "did not produce an improved kernel".KA already ships the bootstrap hook:
setup_internal_environment()setsKERNEL_PROFILER_PYTHONto the PAR_bootstrap.sh(which rebuilds the env from$0before exec-ing the native main), but onlyncu_profiler.pyhonored it. Route the benchmark child through the same hook, falling back tosys.executablewhen unset (OSS / non-PAR).Reviewed By: stashuk-olek
Differential Revision: D107483498