Skip to content

[GR-64328] Support the profile-inference-call-count-ee JVM configuration #11342

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion sdk/mx.sdk/mx_sdk_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
self.async_sampler = False
self.safepoint_sampler = False
self.profile_inference_feature_extraction = False
self.profile_inference_call_count = False
self.force_profile_inference = False
self.profile_inference_debug = False
self.analysis_context_sensitivity = None
Expand Down Expand Up @@ -813,6 +814,8 @@ def config_name(self):
config += ["adopted-jdk-pgo"]
if self.profile_inference_feature_extraction is True:
config += ["profile-inference-feature-extraction"]
if self.profile_inference_call_count is True:
config += ["profile-inference-call-count"]
if self.pgo_instrumentation is True and self.force_profile_inference is True:
if self.pgo_exclude_conditional is True:
config += ["profile-inference-pgo"]
Expand Down Expand Up @@ -847,7 +850,7 @@ def _configure_from_name(self, config_name):
r'(?P<future_defaults_all>future-defaults-all-)?(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<layered>layered-)?(?P<graalos>graalos-)?(?P<gc>g1gc-)?' \
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
r'(?P<analysis_context_sensitivity>insens-|allocsens-|1obj-|2obj1h-|3obj2h-|4obj3h-)?(?P<jdk_profiles>jdk-profiles-collect-|adopted-jdk-pgo-)?' \
r'(?P<profile_inference>profile-inference-feature-extraction-|profile-inference-pgo-|profile-inference-debug-)?(?P<sampler>safepoint-sampler-|async-sampler-)?(?P<optimization_level>O0-|O1-|O2-|O3-|Os-)?(default-)?(?P<edition>ce-|ee-)?$'
r'(?P<profile_inference>profile-inference-feature-extraction-|profile-inference-call-count-|profile-inference-pgo-|profile-inference-debug-)?(?P<sampler>safepoint-sampler-|async-sampler-)?(?P<optimization_level>O0-|O1-|O2-|O3-|Os-)?(default-)?(?P<edition>ce-|ee-)?$'

mx.logv(f"== Registering configuration: {config_name}")
match_name = f"{config_name}-" # adding trailing dash to simplify the regex
Expand Down Expand Up @@ -970,6 +973,8 @@ def generate_profiling_package_prefixes():
if profile_inference_config == 'profile-inference-feature-extraction':
self.profile_inference_feature_extraction = True
self.pgo_instrumentation = True # extract code features
elif profile_inference_config == 'profile-inference-call-count':
self.profile_inference_call_count = True
elif profile_inference_config == "profile-inference-pgo":
# We need to run instrumentation as the profile-inference-pgo JVM config requires dynamically collected
# profiles to combine with the ML-inferred branch probabilities.
Expand Down Expand Up @@ -1558,6 +1563,8 @@ def run_stage_image(self):
mx.warn(
"To dump the profile inference features to a specific location, please set the '{}' flag.".format(
dump_file_flag))
elif self.profile_inference_call_count:
ml_args = svm_experimental_options(['-H:+MLCallCountProfileInference'])
elif self.force_profile_inference:
ml_args = svm_experimental_options(['-H:+MLGraphFeaturesExtraction', '-H:+MLProfileInference'])
else:
Expand Down