1 """Inlining Training config."""
3 import tensorflow
as tf
5 POLICY_DECISION_LABEL
= 'inlining_decision'
6 POLICY_OUTPUT_SPEC
= """
9 "logging_name": "inlining_decision",
11 "name": "StatefulPartitionedCall",
23 # pylint: disable=g-complex-comprehension
24 def get_input_signature():
25 """Returns the list of features for LLVM inlining."""
28 tf
.TensorSpec(dtype
=tf
.int64
, shape
=(), name
=key
) for key
in [
29 'caller_basic_block_count',
30 'caller_conditionally_executed_blocks',
32 'callee_basic_block_count',
33 'callee_conditionally_executed_blocks',
45 'call_argument_setup',
46 'load_relative_intrinsic',
47 'lowered_call_arg_setup',
48 'indirect_call_penalty',
50 'case_cluster_penalty',
52 'unsimplified_common_instructions',
55 'simplified_instructions',
57 'constant_offset_ptr_args',
60 'last_call_to_static_bonus',
63 'nested_inline_cost_estimate',
70 tf
.TensorSpec(dtype
=tf
.float32
, shape
=(), name
=key
)
71 for key
in ['discount', 'reward']
76 tf
.TensorSpec(dtype
=tf
.int32
, shape
=(), name
=key
)
77 for key
in ['step_type']
82 def get_output_signature():
83 return POLICY_DECISION_LABEL
86 def get_output_spec():
87 return POLICY_OUTPUT_SPEC