Skip to content

Move the triton pin #1585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 12, 2022
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: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PIP ?= python -m pip
# versions used in CI
# Also update the "Install nightly binaries" section of the README when updating these
PYTORCH_VERSION ?= dev20221011
TRITON_VERSION ?= d3c925db8a81ca74f14680876b9311e7d079c5a1
TRITON_VERSION ?= af76c989eb4799b015f8b288ccd8421558772e56


default: develop
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ the command below, you will need CUDA 11.7.

```shell
pip install --pre torch==1.14.0.dev20221011+cu117 --extra-index-url https://download.pytorch.org/whl/nightly/cu117
pip install -U "git+https://github.com/openai/triton@998fd5f9afe166247f441999c605dfe624ca9331#subdirectory=python"
pip install -U "git+https://github.com/openai/triton@af76c989eb4799b015f8b288ccd8421558772e56#subdirectory=python"
pip install -U "git+https://github.com/pytorch/torchdynamo"
```

Expand Down
8 changes: 0 additions & 8 deletions torchinductor/codegen/triton.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,6 @@ def load(self, name: str, index: sympy.Expr):
line = f"tl.load({var} + ({index}), {mask}{ep}{other})"
if V.graph.get_dtype(name) in (torch.float16, torch.bfloat16):
line += ".to(tl.float32)"
"""
elif V.graph.get_dtype(name) == torch.bool:
# This is a fix for https://github.com/pytorch/torchdynamo/issues/1450
# The root cause of the problem is a one-element bool tensor was stored as
# tensor([255], device='cuda:0', dtype=torch.uint8) in the forward pass output,
# which confuses the backward pass when it calls sum on the bool tensor.
line = f"({line} != 0)"
"""

if (
self.inside_reduction
Expand Down
10 changes: 0 additions & 10 deletions torchinductor/lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -3183,16 +3183,6 @@ def sum_(x, axis=None, keepdims=False, *, dtype=None):
) and dtype is None:
dtype = torch.int64

# This is a temp fix for https://github.com/pytorch/torchdynamo/issues/1450
# The root cause of the problem is a one-element bool tensor was stored as
# tensor([255], device='cuda:0', dtype=torch.uint8) in the forward pass output,
# which confuses the backward pass when it calls sum on the bool tensor.
# A better place to fix is in triton.py (see the comment there), but it is
# blocked by a trition issue on bool comparison, causing opinfo tests like
# test_comprehensive_gt_cuda_bool to fail.
if is_boolean_dtype(x.get_dtype()):
x = to_dtype(to_dtype(x, dtype), torch.bool)

fn = make_reduction("sum", override_return_dtype=dtype)
return fn(x, axis, keepdims, dtype=dtype)

Expand Down
3 changes: 2 additions & 1 deletion torchinductor/triton_ops/autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def launcher({', '.join(def_args)}, grid, stream):
# set_device(current_device()) # TODO(jansel): is this needed?
grid_0, grid_1, grid_2 = grid(grid_meta)
bin.c_wrapper(grid_0, grid_1, grid_2, bin.num_warps, bin.shared,
stream, bin.cu_function, {', '.join(call_args)})
stream, bin.cu_function, None, None, None,
{', '.join(call_args)})
""".lstrip(),
scope,
)
Expand Down