Skip to content

Commit

Permalink
Use actual corpus in es_trainer_lib (#403)
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 authored Dec 19, 2024
1 parent e6f12d5 commit 822656a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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(
location=_TRAIN_CORPORA.value,
elements=[corpus.ModuleSpec(name="smth", size=1)],
cps = corpus.Corpus(
data_path=_TRAIN_CORPORA.value,
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 822656a

Please sign in to comment.