Skip to content

Commit 54c932d

Browse files
committed
Revert "Update the config files with some new flags and ensure that the"
This reverts commit addecb5.
1 parent cf4b36c commit 54c932d

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

compiler_opt/rl/inlining/env.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
class InliningForSizeTask(env.MLGOTask):
2929
"""Implementation of the inlining-for-size MLGOTask."""
3030

31-
def __init__(self, llvm_size_path: str, default_reward_key: str = 'default'):
31+
def __init__(self, llvm_size_path: str):
3232
super().__init__()
3333
self._llvm_size_path = llvm_size_path
34-
self._default_reward_key = default_reward_key
3534

3635
def get_cmdline(self, clang_path: str, base_args: list[str],
3736
interactive_base_path: str | None,
@@ -63,7 +62,7 @@ def get_module_scores(self, working_dir: str) -> dict[str, float]:
6362
raise RuntimeError(f'Wrong llvm-size output {output}')
6463
tmp = tmp[1].split('\t')
6564
native_size = int(tmp[0])
66-
return {self._default_reward_key: native_size}
65+
return {'default': native_size}
6766

6867

6968
@gin.configurable

compiler_opt/rl/inlining/gin_configs/common.gin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env.InliningForSizeTask.llvm_size_path=%llvm_size_path
1515
env.get_inlining_env.clang_path=%clang_path
1616

1717
problem_config.flags_to_add.add_flags=()
18-
problem_config.flags_to_delete.delete_flags=('-split-dwarf-file','-split-dwarf-output','--crel','-fskip-odr-check-in-gmf','--warning-suppression-mappings')
18+
problem_config.flags_to_delete.delete_flags=('-split-dwarf-file','-split-dwarf-output',)
1919
# For AFDO profile reinjection set:
2020
# problem_config.flags_to_replace.replace_flags={'-fprofile-sample-use':'/path/to/gwp.afdo','-fprofile-remapping-file':'/path/to/prof_remap.txt'}
2121
problem_config.flags_to_replace.replace_flags={}

compiler_opt/rl/inlining/gin_configs/imitation_learning.gin

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ generate_bc_trajectories_lib.ModuleWorker.partitions=[
1414
285.0, 376.0, 452.0, 512.0, 571.0, 627.5, 720.0, 809.5, 1304.0, 1832.0,
1515
2467.0, 3344.0, 4545.0, 6459.0, 9845.0, 17953.0, 29430.5, 85533.5,
1616
124361.0]
17-
18-
reward_key='default'
19-
generate_bc_trajectories_lib.ModuleWorker.reward_key=%reward_key
20-
env.InliningForSizeTask.reward_key=%reward_key
17+
generate_bc_trajectories_lib.ModuleWorker.reward_key='default'
2118

2219
generate_bc_trajectories_lib.gen_trajectories.data_path=''
2320
generate_bc_trajectories_lib.gen_trajectories.delete_flags=('-split-dwarf-file', '-split-dwarf-output')

compiler_opt/rl/inlining/imitation_learning_config.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding=utf-8
21
# Copyright 2020 Google LLC
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +14,6 @@
1514
"""Module for collect data of inlining-for-size."""
1615

1716
import gin
18-
from typing import Type
1917

2018
import numpy as np
2119
import tensorflow as tf
@@ -65,9 +63,10 @@ def get_input_signature():
6563
time_step_spec, action_spec = config.get_inlining_signature_spec()
6664
observation_spec = time_step_spec.observation
6765
observation_spec.update({
68-
key: tf.TensorSpec(dtype=tf.int64, shape=(), name=key)
69-
for key in ('is_callee_avail_external', 'is_caller_avail_external',
70-
'inlining_default')
66+
key: tf.TensorSpec(dtype=tf.int64, shape=(), name=key) for key in (
67+
'is_callee_avail_external',
68+
'is_caller_avail_external',
69+
)
7170
})
7271

7372
time_step_spec = time_step.time_step_spec(observation_spec,
@@ -77,7 +76,7 @@ def get_input_signature():
7776

7877

7978
@gin.register
80-
def get_task_type() -> Type[env.InliningForSizeTask]:
79+
def get_task_type() -> type[env.InliningForSizeTask]:
8180
"""Returns the task type for the trajectory collection."""
8281
return env.InliningForSizeTask
8382

0 commit comments

Comments
 (0)