Skip to content

Commit

Permalink
Use actual corpus in es_trainer_lib
Browse files Browse the repository at this point in the history
This patch makes es_trainer_lib load an actual corpus from the provided
path rather than creating a dummy test corpus. Additionally, we also
begin passing the replace_compilation_flags parameter, which is
necessary for rewriting the paths to PGO profiles.
  • Loading branch information
boomanaiden154 committed Dec 18, 2024
1 parent 902809e commit f8f6e0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler_opt/es/es_trainer_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
@gin.configurable
def train(additional_compilation_flags=(),
delete_compilation_flags=(),
replace_compilation_flags=(),
worker_class=None):
"""Train with ES."""

Expand Down Expand Up @@ -113,11 +114,11 @@ def train(additional_compilation_flags=(),
logging.info("Parameter dimension: %s", initial_parameters.shape)
logging.info("Initial parameters: %s", initial_parameters)

cps = corpus.create_corpus_for_testing(
cps = corpus.Corpus(
location=_TRAIN_CORPORA.value,
elements=[corpus.ModuleSpec(name="smth", size=1)],
additional_flags=additional_compilation_flags,
delete_flags=delete_compilation_flags)
delete_flags=delete_compilation_flags,
replace_flags=replace_compilation_flags)

# Construct policy saver
saved_policy = policy_utils.create_actor_policy(greedy=True)
Expand Down

0 comments on commit f8f6e0b

Please sign in to comment.