Skip to content

Commit 95a4050

Browse files
authored
Fix typos discovered by codespell (#424)
1 parent 3a5b206 commit 95a4050

17 files changed

+28
-28
lines changed

compiler_opt/benchmark/filter_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
in their entirety can sometimes be problematic as some subsets of the tests
2020
available in the executable might require certain hardware configurations
2121
such as an X configuration with working graphics drivers, and we would prefer
22-
to avoid those tests. This exectuable goes through an entire test suite
22+
to avoid those tests. This executable goes through an entire test suite
2323
description and returns another test suite description containing only tests
2424
that pass.
2525

compiler_opt/es/blackbox_optimizers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ def hessv_func(x: FloatArray) -> FloatArray:
10801080
"""
10811081
hessv = np.matmul(self.saved_hessian, x)
10821082
# Reminder:
1083-
# If not using sensing-subspace Hessian, also subract diagonal gs(x)*I
1083+
# If not using sensing-subspace Hessian, also subtract diagonal gs(x)*I
10841084
hessv /= np.power(self.precision_parameter, 2)
10851085
hessv *= -1
10861086
return hessv
@@ -1107,7 +1107,7 @@ def hessv_func(x: FloatArray) -> FloatArray:
11071107
np.power(self.precision_parameter, 2))
11081108
hessv /= float(len(self.saved_perturbations))
11091109
# Reminder:
1110-
# If not using sensing-subspace Hessian, also subract diagonal gs(x)*I
1110+
# If not using sensing-subspace Hessian, also subtract diagonal gs(x)*I
11111111
hessv /= np.power(self.precision_parameter, 2)
11121112
hessv *= -1
11131113
return hessv

compiler_opt/rl/compilation_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def enable(self) -> WorkerFuture:
334334
class CompilationResultObserver(metaclass=abc.ABCMeta):
335335
"""Abstract base class used to observe compilation results.
336336
337-
This is indended for users who need to observe compilations while they are in
337+
This is intended for users who need to observe compilations while they are in
338338
the distributed worker pool, rather than after they have been coalesced in
339339
the collection script.
340340
"""

compiler_opt/rl/distributed/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def compute_return_and_advantage(
229229
advantages = self.compute_advantages(rewards, returns, discounts,
230230
value_preds)
231231

232-
# TODO(b/171573175): remove the condition once historgrams are
232+
# TODO(b/171573175): remove the condition once histograms are
233233
# supported on TPUs.
234234
if self._debug_summaries and not self._use_tpu:
235235
tf.compat.v2.summary.histogram(

compiler_opt/rl/distributed/ppo_train_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def train(
6969
agent.initialize()
7070

7171
# Create the policy saver which saves the initial model now, then it
72-
# periodically checkpoints the policy weigths.
72+
# periodically checkpoints the policy weights.
7373
saved_model_dir = os.path.join(root_dir, actor_learner.POLICY_SAVED_MODEL_DIR)
7474
save_model_trigger = triggers.PolicySavedModelTrigger(
7575
saved_model_dir, agent, train_step, interval=1000)

compiler_opt/rl/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def _get_clang_generator(
311311
Returns:
312312
A generator of tuples. Each element of the tuple is created with
313313
clang_session. First argument of the tuple is always an interactive
314-
clang session. The second argumnet is a default clang session if
314+
clang session. The second argument is a default clang session if
315315
interactive_only is False and otherwise the exact same interactive
316316
clang session object as the first argument.
317317
"""
@@ -343,7 +343,7 @@ class MLGOEnvironmentBase:
343343
"""Base implementation for all MLGO environments.
344344
345345
Depending on the RL framework, one may want different implementations of an
346-
enviroment (tf_agents: PyEnvironment, jax: dm-env, etc). This class
346+
environment (tf_agents: PyEnvironment, jax: dm-env, etc). This class
347347
implements the core methods that are needed to then implement any of these
348348
other environments as well.
349349
"""

compiler_opt/rl/imitation_learning/generate_bc_trajectories_lib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def add_feature_list(seq_example: tf.train.SequenceExample,
154154
np.dtype(np.float32),
155155
str,
156156
]):
157-
raise AssertionError((f'Unsupported type for feautre {feature_name}'
157+
raise AssertionError((f'Unsupported type for feature {feature_name}'
158158
f' of type {type(feature_list[0])}. '
159159
'Supported types are np.int64, np.float32, str'))
160160
if isinstance(feature_list[0], np.float32):
@@ -382,7 +382,7 @@ def compile_module(
382382
Returns:
383383
sequence_example: a tf.train.SequenceExample containing the trajectory
384384
from compilation. In addition to the features returned from the env
385-
tbe sequence_example adds the following extra features: action,
385+
the sequence_example adds the following extra features: action,
386386
reward and module_name. action is the action taken at any given step,
387387
reward is the reward specified by reward_key, not necessarily the
388388
reward returned by the environment and module_name is the name of
@@ -933,7 +933,7 @@ def gen_trajectories(
933933
ModuleWorker.select_best-exploration
934934
worker_wait_sec: max number of seconds to wait for a worker to terminate
935935
worker_class_type: the class that will process each module
936-
worker_class_type: allows for overrriding ModuleWorker
936+
worker_class_type: allows for overriding ModuleWorker
937937
worker_manager_class: A pool of workers hosted on the local machines, each
938938
in its own process.
939939
"""

compiler_opt/rl/imitation_learning/weighted_bc_trainer_lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
class TrainingWeights:
5656
"""Class for computing weights for training.
5757
58-
To use, create an instance by specifying the paritions used in
58+
To use, create an instance by specifying the partitions used in
5959
collecting the data with generate_bc_trajectories. Next, run multiple steps
6060
of update_weights with collected profiles from generate_bc_trajectories,
6161
where each step corresponds to one pair of a pollicy profile and a
@@ -120,7 +120,7 @@ def create_new_profile(self,
120120
121121
The regret is measured as the difference between the loss of the data_eval
122122
profiles and of the data_comparator profiles. The reward is the negative
123-
regret normalized by the loss of hte data_comparator profiles.
123+
regret normalized by the loss of the data_comparator profiles.
124124
125125
Args:
126126
data_comparator: baseline profiles to measure improvement against

compiler_opt/rl/inlining/inlining_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def compile_fn(
5353
5454
Args:
5555
command_line: the fully qualified command line.
56-
tf_policy_path: path to TF policy direcoty on local disk.
56+
tf_policy_path: path to TF policy directory on local disk.
5757
reward_only: whether only return native size.
5858
5959
Returns:

compiler_opt/rl/policy_saver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _split_tensor_name(name: str) -> Tuple[str, int]:
4848
def _get_non_identity_op(tensor):
4949
"""Get the true output op aliased by Identity `tensor`.
5050
51-
Output signature tensors are in a Function that refrences the true call
51+
Output signature tensors are in a Function that references the true call
5252
in the base SavedModel metagraph. Traverse the function upwards until
5353
we find this true output op and tensor and return that.
5454

0 commit comments

Comments
 (0)