Skip to content

Commit eb7be14

Browse files
authored
Fix some typos (#141)
1 parent 12485ba commit eb7be14

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

helion/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def torch_dtype_to_tl(torch_dtype: torch.dtype) -> object:
6262

6363
@functools.cache
6464
def min_dot_size(
65-
device: torch.device, lhs: torch.dtype, rhs: torch.torch.dtype
65+
device: torch.device, lhs: torch.dtype, rhs: torch.dtype
6666
) -> tuple[int, int, int]:
6767
if device.type != "cuda":
6868
# TODO(jansel): support non-cuda properly

helion/_compiler/compile_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _TLS(Protocol):
4444
class CompileEnvironment:
4545
"""
4646
Global state for the duration of a compilation.
47-
There is a 1:1 mapping between this an BoundKernel,
47+
There is a 1:1 mapping between this and a BoundKernel,
4848
and a single CompileEnvironment will be used for multiple Configs.
4949
No config or codegen specific state should be stored here.
5050
"""

helion/_logging/_internal.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020

2121
@dataclass
22-
class LogRegistery:
22+
class LogRegistry:
2323
"""
24-
This registery holds mappings for logging
24+
This registry holds mappings for logging
2525
"""
2626

2727
# alias -> list of logs
@@ -31,25 +31,25 @@ class LogRegistery:
3131
log_levels: dict[str, int] = field(default_factory=dict)
3232

3333

34-
_LOG_REGISTERY = LogRegistery({"all": ["helion"]})
34+
_LOG_REGISTRY = LogRegistry({"all": ["helion"]})
3535

3636

3737
def parse_log_value(value: str) -> None:
3838
"""
39-
Given a string like "foo.bar,+baz.fizz" this function parses this string and converts
40-
it to mapping of {"foo.bar": logging.INFO, "baz.fizz": logging.DEBUG}
41-
and updates the registery with this mapping
39+
Given a string like "foo.bar,+baz.fizz" this function parses the string and converts
40+
it to a mapping of {"foo.bar": logging.INFO, "baz.fizz": logging.DEBUG}
41+
and updates the registry with this mapping
4242
"""
4343
entries = [e.strip() for e in value.split(",") if e.strip()]
4444
for entry in entries:
4545
log_level = logging.DEBUG if entry.startswith("+") else logging.INFO
4646
alias = entry.lstrip("+")
4747

48-
if alias in _LOG_REGISTERY.alias_map:
49-
for log in _LOG_REGISTERY.alias_map[alias]:
50-
_LOG_REGISTERY.log_levels[log] = log_level
48+
if alias in _LOG_REGISTRY.alias_map:
49+
for log in _LOG_REGISTRY.alias_map[alias]:
50+
_LOG_REGISTRY.log_levels[log] = log_level
5151
else:
52-
_LOG_REGISTERY.log_levels[alias] = log_level
52+
_LOG_REGISTRY.log_levels[alias] = log_level
5353

5454

5555
def init_logs_from_string(value: str) -> None:
@@ -58,7 +58,7 @@ def init_logs_from_string(value: str) -> None:
5858
"""
5959
parse_log_value(value)
6060

61-
for logger_name, level in _LOG_REGISTERY.log_levels.items():
61+
for logger_name, level in _LOG_REGISTRY.log_levels.items():
6262
logger = logging.getLogger(logger_name)
6363
logger.setLevel(level)
6464

helion/autotuner/base_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def _mark_complete(self) -> bool:
466466
"""
467467
Mark the precompile future as complete and kill the process if needed.
468468
469-
:return True if the precompilation was successful, False otherwise.
469+
:return: True if the precompilation was successful, False otherwise.
470470
"""
471471
self.end_time = time.time()
472472
process = self.process

helion/autotuner/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
class LambdaLogger:
1111
"""
12-
A self-contained logger that does not propagates to the root logger and
12+
A self-contained logger that does not propagate to the root logger and
1313
prints each record to stderr in the form:
1414
1515
[<elapsed>s] <message>
1616
1717
where *elapsed* is the whole-second wall-clock time since the logger
1818
instance was created.
1919
20-
Takes lambas as arguments, which are called when the log is emitted.
20+
Takes lambdas as arguments, which are called when the log is emitted.
2121
"""
2222

2323
_count: itertools.count[int] = itertools.count()

test/test_logging.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ def test_log_set(self):
1717
from helion._logging._internal import init_logs_from_string
1818

1919
init_logs_from_string("foo.bar,+fuzz.baz")
20-
self.assertTrue(
21-
helion._logging._internal._LOG_REGISTERY.log_levels["foo.bar"], logging.INFO
20+
self.assertEqual(
21+
helion._logging._internal._LOG_REGISTRY.log_levels["foo.bar"],
22+
logging.INFO,
2223
)
23-
self.assertTrue(
24-
helion._logging._internal._LOG_REGISTERY.log_levels["fuzz.baz"],
24+
self.assertEqual(
25+
helion._logging._internal._LOG_REGISTRY.log_levels["fuzz.baz"],
2526
logging.DEBUG,
2627
)
2728

0 commit comments

Comments
 (0)