Skip to content

Commit d50b720

Browse files
committed
Add typos CI, fix typos
1 parent 6314fb7 commit d50b720

39 files changed

+130
-97
lines changed

.github/workflows/ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ jobs:
2020
pipx install ruff
2121
ruff check
2222
23+
typos:
24+
name: Typos
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: crate-ci/typos@master
29+
2330
pylint:
2431
name: Pylint
2532
runs-on: ubuntu-latest

MEMO

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Documentation Notes
77
Things to consider
88
^^^^^^^^^^^^^^^^^^
99

10-
- Depedencies are pointwise for shared loop dimensions
10+
- Dependencies are pointwise for shared loop dimensions
1111
and global over non-shared ones (between dependent and ancestor)
1212

1313
- multiple insns could fight over which iname gets local axis 0

contrib/mem-pattern-explorer/pattern_vis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def tick(self):
7676
class Array:
7777
def __init__(self, ctx, name, shape, strides, elements_per_row=None):
7878
# Each array element stores a tuple:
79-
# (timestamp, subgroup, g0, g1, g2, ) of last acccess
79+
# (timestamp, subgroup, g0, g1, g2, ) of last access
8080

8181
assert len(shape) == len(strides)
8282

doc/misc.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ In the meantime, you can generate code simply by saying::
158158
print(cg_result.host_code())
159159
print(cg_result.device_code())
160160

161-
Additionally, for C-based languages, header defintions are available via::
161+
Additionally, for C-based languages, header definitions are available via::
162162

163163
loopy.generate_header(knl)
164164

@@ -338,8 +338,8 @@ This list is always growing, but here are a few pointers:
338338

339339
Use :func:`loopy.join_inames`.
340340

341-
In what sense does Loopy suport vectorization?
342-
----------------------------------------------
341+
In what sense does Loopy support vectorization?
342+
-----------------------------------------------
343343

344344
There are really two ways in which the OpenCL/CUDA model of computation exposes
345345
vectorization:
@@ -352,7 +352,7 @@ vectorization:
352352
e.g. ``float4``, which support arithmetic with implicit vector semantics
353353
as well as a number of 'intrinsic' functions.
354354

355-
Loopy suports both. The first one, SIMT, is accessible by tagging inames with,
355+
Loopy supports both. The first one, SIMT, is accessible by tagging inames with,
356356
e.g., ``l.0```. Accessing the second one requires using both execution- and
357357
data-reshaping capabilities in loopy. To start with, you need an array that
358358
has an axis with the length of the desired vector. If that's not yet available,

loopy/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -563,18 +563,18 @@ def make_copy_kernel(new_dim_tags, old_dim_tags=None):
563563

564564
indices = ["i%d" % i for i in range(rank)]
565565
shape = ["n%d" % i for i in range(rank)]
566-
commad_indices = ", ".join(indices)
566+
command_indices = ", ".join(indices)
567567
bounds = " and ".join(
568568
f"0<={ind}<{shape_i}"
569569
for ind, shape_i in zip(indices, shape))
570570

571571
set_str = "{{[{}]: {} }}".format(
572-
commad_indices,
572+
command_indices,
573573
bounds
574574
)
575575
result = make_kernel(set_str,
576576
"output[%s] = input[%s]"
577-
% (commad_indices, commad_indices),
577+
% (command_indices, command_indices),
578578
lang_version=MOST_RECENT_LANGUAGE_VERSION,
579579
default_offset=auto)
580580

loopy/check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ def satisfy_dep_reqs_in_order(dep_reqs_to_vars, edges, order):
11231123
# for each *pred*, we will calculate all the direct/indirect
11241124
# instructions that can be reached.
11251125
seen_successors = set()
1126-
# first let us start with direct sucessors
1126+
# first let us start with direct successors
11271127
to_check = edges[pred].copy()
11281128
while to_check:
11291129
successor = to_check.pop()
@@ -1219,7 +1219,7 @@ def check_variable_access_ordered(kernel):
12191219
"""Checks that between each write to a variable and all other accesses to
12201220
the variable there is either:
12211221
1222-
* a direct/indirect depdendency edge, or
1222+
* a direct/indirect dependency edge, or
12231223
* an explicit statement that no ordering is necessary (expressed
12241224
through a bi-directional :attr:`loopy.InstructionBase.no_sync_with`)
12251225
"""

loopy/frontend/fortran/translator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_type(self, name, none_ok=False):
200200
return None
201201

202202
raise TranslationError(
203-
"no type for '%s' found in 'implict none' routine"
203+
"no type for '%s' found in 'implicit none' routine"
204204
% name) from None
205205

206206
return self.implicit_types.get(name[0], np.dtype(np.int32))
@@ -426,7 +426,7 @@ def map_Implicit(self, node):
426426
scope.implicit_types = None
427427

428428
for stmt, specs in node.items:
429-
if scope.implict_types is None:
429+
if scope.implict_types is None: # spellchecker: disable-line
430430
raise TranslationError("implicit decl not allowed after "
431431
"'implicit none'")
432432
tp = self.dtype_from_stmt(stmt)

loopy/isl_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def simplify_pw_aff(pw_aff, context=None):
186186
continue
187187

188188
if aff_i.gist(dom_j).is_equal(aff_j):
189-
# aff_i is sufficient to conver aff_j, eliminate aff_j
189+
# aff_i is sufficient to cover aff_j, eliminate aff_j
190190
new_pieces = pieces[:]
191191
if i < j:
192192
new_pieces.pop(j)

loopy/kernel/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class LoopKernel(Taggable):
164164
.. attribute:: loop_priority
165165
166166
A frozenset of priority constraints to the kernel. Each such constraint
167-
is a tuple of inames. Inames occuring in such a tuple will be scheduled
167+
is a tuple of inames. Inames occurring in such a tuple will be scheduled
168168
earlier than any iname following in the tuple. This applies only to inames
169169
with non-parallel implementation tags.
170170
@@ -515,7 +515,7 @@ def get_leaf_domain_indices(self, inames):
515515
for iname in inames:
516516
home_domain_index = hdm[iname]
517517
if home_domain_index in domain_indices:
518-
# nothin' new
518+
# nothing new
519519
continue
520520

521521
domain_path_to_root = [home_domain_index] + ppd[home_domain_index]

loopy/kernel/creation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ def add_inferred_inames(knl):
18841884
# {{{ apply single-writer heuristic
18851885

18861886
@for_each_kernel
1887-
def apply_single_writer_depencency_heuristic(kernel, warn_if_used=True,
1887+
def apply_single_writer_dependency_heuristic(kernel, warn_if_used=True,
18881888
error_if_used=False):
18891889
logger.debug("%s: default deps" % kernel.name)
18901890

@@ -2023,7 +2023,7 @@ class SliceToInameReplacer(IdentityMapper):
20232023
.. attribute:: subarray_ref_bounds
20242024
20252025
A :class:`list` (one entry for each :class:`SubArrayRef` to be created)
2026-
of :class:`dict` instances to store the slices enountered in the
2026+
of :class:`dict` instances to store the slices encountered in the
20272027
expressions as a mapping from ``iname`` to a tuple of ``(start, stop,
20282028
step)``, which describes the boxy (i.e. affine) constraints imposed on
20292029
the ``iname`` by the corresponding slice notation its intended to
@@ -2574,7 +2574,7 @@ def make_function(domains, instructions, kernel_data=None, **kwargs):
25742574
knl = guess_arg_shape_if_requested(knl, default_order)
25752575
knl = apply_default_order_to_args(knl, default_order)
25762576
knl = resolve_dependencies(knl)
2577-
knl = apply_single_writer_depencency_heuristic(knl, warn_if_used=False)
2577+
knl = apply_single_writer_dependency_heuristic(knl, warn_if_used=False)
25782578

25792579
# -------------------------------------------------------------------------
25802580
# Ordering dependency:

loopy/kernel/function_interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def is_type_specialized(self):
672672

673673
class CallableKernel(InKernelCallable):
674674
"""
675-
Records informations about a callee kernel. Also provides interface through
675+
Records information about a callee kernel. Also provides interface through
676676
member methods to make the callee kernel compatible to be called from a
677677
caller kernel.
678678

loopy/kernel/instruction.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ class CallInstruction(MultiAssignmentBase):
934934
935935
A tuple of `:class:loopy.Optional`. If an entry is not empty, it
936936
contains the type that will be assigned to the new temporary variable
937-
created from the assigment.
937+
created from the assignment.
938938
939939
.. automethod:: __init__
940940
"""
@@ -1099,7 +1099,7 @@ def is_array_call(assignees, expression):
10991099
Returns *True* is the instruction is an array call.
11001100
11011101
An array call is a function call applied to array type objects. If any of
1102-
the arguemnts or assignees to the function is an array,
1102+
the arguments or assignees to the function is an array,
11031103
:meth:`is_array_call` will return *True*.
11041104
"""
11051105
from pymbolic.primitives import Call, Subscript
@@ -1460,7 +1460,7 @@ class BarrierInstruction(_DataObliviousInstruction):
14601460
.. attribute:: mem_kind
14611461
14621462
A string, ``"global"`` or ``"local"``. Chooses which memory type to
1463-
sychronize, for targets that require this (e.g. OpenCL)
1463+
synchronize, for targets that require this (e.g. OpenCL)
14641464
14651465
The textual syntax in a :mod:`loopy` kernel is::
14661466

loopy/kernel/tools.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def find_all_insn_inames(kernel):
263263
if insn.within_inames_is_final:
264264
continue
265265

266-
# {{{ depdency-based propagation
266+
# {{{ dependency-based propagation
267267

268268
inames_old = insn_id_to_inames[insn.id]
269269
inames_new = inames_old | guess_iname_deps_based_on_var_use(
@@ -513,8 +513,8 @@ def get_dot_dependency_graph(kernel, callables_table, iname_cluster=True,
513513
"""
514514

515515
# make sure all automatically added stuff shows up
516-
from loopy.kernel.creation import apply_single_writer_depencency_heuristic
517-
kernel = apply_single_writer_depencency_heuristic(kernel, warn_if_used=False)
516+
from loopy.kernel.creation import apply_single_writer_dependency_heuristic
517+
kernel = apply_single_writer_dependency_heuristic(kernel, warn_if_used=False)
518518

519519
if iname_cluster and not kernel.linearization:
520520
try:
@@ -1252,9 +1252,9 @@ def find_recursive_dependencies(kernel, insn_ids):
12521252

12531253
for insn_id in queue:
12541254
insn = kernel.id_to_insn[insn_id]
1255-
additionals = insn.depends_on - result
1256-
result.update(additionals)
1257-
new_queue.extend(additionals)
1255+
additional = insn.depends_on - result
1256+
result.update(additional)
1257+
new_queue.extend(additional)
12581258

12591259
queue = new_queue
12601260

@@ -1735,7 +1735,7 @@ def get_global_barrier_order(kernel):
17351735

17361736
@memoize_on_first_arg
17371737
def find_most_recent_global_barrier(kernel, insn_id):
1738-
"""Return the id of the latest occuring global barrier which the
1738+
"""Return the id of the latest occurring global barrier which the
17391739
given instruction (indirectly or directly) depends on, or *None* if this
17401740
instruction does not depend on a global barrier.
17411741
@@ -1995,7 +1995,7 @@ def infer_args_are_input_output(kernel):
19951995
elif isinstance(arg, (ConstantArg, ImageArg, ValueArg)):
19961996
pass
19971997
else:
1998-
raise NotImplementedError("Unkonwn argument type %s." % type(arg))
1998+
raise NotImplementedError("Unknown argument type %s." % type(arg))
19991999

20002000
if not (arg.is_input or arg.is_output):
20012001
raise LoopyError("Kernel argument must be either input or output."

loopy/match.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Matching functionality for instruction ids and subsitution
1+
"""Matching functionality for instruction ids and substitution
22
rule invocations stacks."""
33

44

loopy/options.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Options(ImmutableRecord):
118118
119119
.. attribute:: cl_exec_manage_array_events
120120
121-
Within the PyOpenCL executor, respect and udpate
121+
Within the PyOpenCL executor, respect and update
122122
:attr:`pyopencl.array.Array.events`.
123123
124124
Defaults to *True*.
@@ -156,7 +156,7 @@ class Options(ImmutableRecord):
156156
157157
Allow re-ordering of floating point arithmetic. Re-ordering may
158158
give different results as floating point arithmetic is not
159-
associative in addition and mulitplication. Default is *True*.
159+
associative in addition and multiplication. Default is *True*.
160160
Note that the implementation of this option is currently incomplete.
161161
162162
.. attribute:: build_options

loopy/preprocess.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,8 @@ def preprocess_program(t_unit: TranslationUnit) -> TranslationUnit:
825825
from loopy.transform.subst import expand_subst
826826
t_unit = expand_subst(t_unit)
827827

828-
from loopy.kernel.creation import apply_single_writer_depencency_heuristic
829-
t_unit = apply_single_writer_depencency_heuristic(t_unit)
828+
from loopy.kernel.creation import apply_single_writer_dependency_heuristic
829+
t_unit = apply_single_writer_dependency_heuristic(t_unit)
830830

831831
# Ordering restrictions:
832832
#

loopy/schedule/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ def get_insns_in_topologically_sorted_order(
718718
for dep in insn.depends_on:
719719
rev_dep_map[dep].add(insn.id)
720720

721-
# For breaking ties, we compare the features of an intruction
721+
# For breaking ties, we compare the features of an instruction
722722
# so that instructions with the same set of features are lumped
723723
# together. This helps in :method:`schedule_as_many_run_insns_as_possible`
724724
# which bails after 5 insns that don't have the same feature.
@@ -1196,7 +1196,7 @@ def insn_sort_key(insn_id):
11961196
print(
11971197
"%(warn)swarning:%(reset_all)s '%(iname)s', "
11981198
"which the schedule is "
1199-
"currently stuck inside of, seems mis-nested. "
1199+
"currently stuck inside of, seems misnested. "
12001200
"'%(subdep)s' must occur " "before '%(dep)s', "
12011201
"but '%(subdep)s must be outside "
12021202
"'%(iname)s', whereas '%(dep)s' must be back "
@@ -1404,7 +1404,7 @@ def insn_sort_key(insn_id):
14041404
get_priority_tiers(wanted, sched_state.kernel.loop_priority))
14051405

14061406
# Update the loop priority set, because some constraints may have
1407-
# have been contradictary.
1407+
# have been contradictory.
14081408
loop_priority_set = set().union(*[set(t) for t in priority_tiers])
14091409

14101410
priority_tiers.append(

loopy/statistics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ class Op(ImmutableRecord):
629629
work-group executes on a single compute unit with all work-items within
630630
the work-group sharing local memory. A sub-group is an
631631
implementation-dependent grouping of work-items within a work-group,
632-
analagous to an NVIDIA CUDA warp.
632+
analogous to an NVIDIA CUDA warp.
633633
634634
.. attribute:: kernel_name
635635
@@ -723,7 +723,7 @@ class MemAccess(ImmutableRecord):
723723
work-group executes on a single compute unit with all work-items within
724724
the work-group sharing local memory. A sub-group is an
725725
implementation-dependent grouping of work-items within a work-group,
726-
analagous to an NVIDIA CUDA warp.
726+
analogous to an NVIDIA CUDA warp.
727727
728728
.. attribute:: kernel_name
729729
@@ -1109,7 +1109,7 @@ def _get_lid_and_gid_strides(knl, array, index):
11091109

11101110
# create lid_strides and gid_strides dicts
11111111

1112-
# strides are coefficents in flattened index, i.e., we want
1112+
# strides are coefficients in flattened index, i.e., we want
11131113
# lid_strides = {0:l0, 1:l1, 2:l2, ...} and
11141114
# gid_strides = {0:g0, 1:g1, 2:g2, ...},
11151115
# where l0, l1, l2, g0, g1, and g2 come from flattened index
@@ -1723,7 +1723,7 @@ def get_op_map(program, count_redundant_work=False,
17231723
:arg subgroup_size: (currently unused) An :class:`int`, :class:`str`
17241724
``"guess"``, or *None* that specifies the sub-group size. An OpenCL
17251725
sub-group is an implementation-dependent grouping of work-items within
1726-
a work-group, analagous to an NVIDIA CUDA warp. subgroup_size is used,
1726+
a work-group, analogous to an NVIDIA CUDA warp. subgroup_size is used,
17271727
e.g., when counting a :class:`MemAccess` whose count_granularity
17281728
specifies that it should only be counted once per sub-group. If set to
17291729
*None* an attempt to find the sub-group size using the device will be
@@ -1921,7 +1921,7 @@ def get_mem_access_map(program, count_redundant_work=False,
19211921
:arg subgroup_size: An :class:`int`, :class:`str` ``"guess"``, or
19221922
*None* that specifies the sub-group size. An OpenCL sub-group is an
19231923
implementation-dependent grouping of work-items within a work-group,
1924-
analagous to an NVIDIA CUDA warp. subgroup_size is used, e.g., when
1924+
analogous to an NVIDIA CUDA warp. subgroup_size is used, e.g., when
19251925
counting a :class:`MemAccess` whose count_granularity specifies that it
19261926
should only be counted once per sub-group. If set to *None* an attempt
19271927
to find the sub-group size using the device will be made, if this fails
@@ -2085,7 +2085,7 @@ def get_synchronization_map(program, subgroup_size=None, entrypoint=None):
20852085
:arg subgroup_size: (currently unused) An :class:`int`, :class:`str`
20862086
``"guess"``, or *None* that specifies the sub-group size. An OpenCL
20872087
sub-group is an implementation-dependent grouping of work-items within
2088-
a work-group, analagous to an NVIDIA CUDA warp. subgroup_size is used,
2088+
a work-group, analogous to an NVIDIA CUDA warp. subgroup_size is used,
20892089
e.g., when counting a :class:`MemAccess` whose count_granularity
20902090
specifies that it should only be counted once per sub-group. If set to
20912091
*None* an attempt to find the sub-group size using the device will be

loopy/symbolic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ class TaggedVariable(LoopyExpressionBase, p.Variable, Taggable):
683683
A :class:`frozenset` of subclasses of :class:`pytools.tag.Tag` used to
684684
provide metadata on this object. Legacy string tags are converted to
685685
:class:`~loopy.LegacyStringInstructionTag` or, if they used to carry
686-
a functional meaning, the tag carrying that same fucntional meaning
686+
a functional meaning, the tag carrying that same functional meaning
687687
(e.g. :class:`~loopy.UseStreamingStoreTag`).
688688
689689
Inherits from :class:`pymbolic.primitives.Variable`
@@ -737,7 +737,7 @@ class Reduction(LoopyExpressionBase):
737737
.. attribute:: allow_simultaneous
738738
739739
A :class:`bool`. If not *True*, an iname is allowed to be used
740-
in precisely one reduction, to avoid mis-nesting errors.
740+
in precisely one reduction, to avoid misnesting errors.
741741
"""
742742

743743
init_arg_names = ("operation", "inames", "expr", "allow_simultaneous")

0 commit comments

Comments
 (0)