Prepare Jiterator code template for multiple outputs#77902
Prepare Jiterator code template for multiple outputs#77902SherlockNoMad wants to merge 1 commit intomasterfrom
Conversation
🔗 Helpful links
❌ 2 New FailuresAs of commit 0c0b0ae (more details on the Dr. CI page): Expand to see more
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
|
try revert pytorchbot command |
|
Hey @SherlockNoMad. |
|
cc @0x00b1, who was asking about multiple output jiterated kernels |
Summary: Part 1: make existing jiterator code strings work with multiple outputs code template Pull Request resolved: #77902 Approved by: https://github.com/ngimel Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/82682aab0bb3ca8e5310a8ab0a5f31c840578ff3 Reviewed By: seemethere Differential Revision: D36537756 Pulled By: SherlockNoMad fbshipit-source-id: 999b935047c7139af2a7cbc03686a58e4082514e
Part 2 for #77902 Further prepare python jiterator for supporting multiple outputs Pull Request resolved: #77921 Approved by: https://github.com/ngimel
Summary: Part 2 for #77902 Further prepare python jiterator for supporting multiple outputs Pull Request resolved: #77921 Approved by: https://github.com/ngimel Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/c0abd834829ddaf015590dbd0c16b131e292cf36 Reviewed By: seemethere Differential Revision: D36603024 Pulled By: seemethere fbshipit-source-id: 190e409f0cb68d675da3b676a6fa658c0e32c107
This PR is part3. Part1: #77902 Part2: #77921 Python Jiterator now supports returning multiple outputs ``` fn = torch.cuda.jiterator._create_multi_output_jit_fn( """ template <typename T> T binary_2outputs(T i0, T i1, T& out0, T& out1) { out0 = i0 + i1; out1 = i0 - i1; } """, num_outputs=2) x = torch.rand(3, device='cuda') y = torch.rand(3, device='cuda') out0, out1 = fn(x, y) torch.allclose(out0, x+y) torch.allclose(out1, x-y) ``` Pull Request resolved: #78139 Approved by: https://github.com/ngimel
Part 2 for #77902 Further prepare python jiterator for supporting multiple outputs Pull Request resolved: #77921 Approved by: https://github.com/ngimel
Summary: This PR is part3. Part1: #77902 Part2: #77921 Python Jiterator now supports returning multiple outputs ``` fn = torch.cuda.jiterator._create_multi_output_jit_fn( """ template <typename T> T binary_2outputs(T i0, T i1, T& out0, T& out1) { out0 = i0 + i1; out1 = i0 - i1; } """, num_outputs=2) x = torch.rand(3, device='cuda') y = torch.rand(3, device='cuda') out0, out1 = fn(x, y) torch.allclose(out0, x+y) torch.allclose(out1, x-y) ``` Pull Request resolved: #78139 Approved by: https://github.com/ngimel Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/6db8440f35831a903a1084aec1a3803af0e1dd10 Reviewed By: mehtanirav Differential Revision: D36668751 Pulled By: SherlockNoMad fbshipit-source-id: 756ad6da1682030d6db8cad390a3a72ef3b44444
Part 1: make existing jiterator code strings work with multiple outputs code template