Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ jobs:
- name: Run pre-commit
run: |
source .venv/bin/activate
# TODO(rchen152): Delete this when warnings do not cause failures
sed -i '/search-path/d' pyproject.toml
pre-commit run --all-files
2 changes: 2 additions & 0 deletions helion/_compiler/compile_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def create_unbacked_symint(self, hint: int = 8192) -> torch.SymInt:
sym = self.shape_env.create_unbacked_symint(source=source)
# TODO(jansel): this is a hack to get us past some == 1 checks
# we should probably have a better way to handle this
# type: ignore [unsupported-operation]
self.shape_env.var_to_val[sym._sympy_()] = sympy.sympify(hint)
return sym

Expand Down Expand Up @@ -639,6 +640,7 @@ def _to_sympy(x: int | torch.SymInt | sympy.Expr) -> sympy.Expr:
return sympy.Integer(x)
if isinstance(x, sympy.Expr):
return x
# type: ignore [missing-attribute]
return sympy.sympify(x)


Expand Down
1 change: 1 addition & 0 deletions helion/_compiler/device_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ def _format_constexpr_value(self, value: object) -> str:

# Handle sympy expressions (sanitize by replacing triton_helpers functions)
if isinstance(value, sympy.Expr):
# type: ignore [missing-attribute]
sanitized = value.replace(
lambda node: isinstance(node, sympy.Function)
and getattr(node.func, "__name__", "")
Expand Down
1 change: 1 addition & 0 deletions helion/_compiler/inductor_lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def _unpack_symint(x: torch.SymInt | int) -> sympy.Expr:
if isinstance(x, torch.SymInt):
return x._sympy_()
if isinstance(x, int):
# type: ignore [bad-return]
return sympy.sympify(x)
raise TypeError(f"Expected SymInt or int, got {type(x)}")

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ source = "vcs"
project-includes = ["helion", "benchmarks", "docs", "examples"]
project-excludes = ["test"]
python-version = "3.10"
search-path = ["../pytorch"]

[tool.codespell]
ignore-words = "scripts/dictionary.txt"
Loading