feat(torchwave): Standalone Triton port of masked_select_jagged and its test (#18860) - #18860
Conversation
✅ Deploy Preview for meta-velox canceled.
|
|
@oerling has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114379433. |
Selective Build Plan
Selective build plan |
…ubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
16e0abf to
aafd44e
Compare
CI Failure Analysis
🟡 Presto Fuzzer — FUZZER Failure View logsFuzzer crash: Instance 1 (seed Instances 2, 3, and 4 (seeds Correlation with PR changes:
Known issues:
Reproduce locally: ./velox_expression_fuzzer_test \
--seed 409347951 \
--enable_variadic_signatures \
--velox_fuzzer_enable_complex_types \
--velox_fuzzer_enable_decimal_type \
--lazy_vector_generation_ratio 0.2 \
--common_dictionary_wraps_generation_ratio=0.3 \
--velox_fuzzer_enable_column_reuse \
--velox_fuzzer_enable_expression_reuse \
--max_expression_trees_per_step 2 \
--retry_with_try \
--special_forms="and,or,cast,coalesce" \
--enable_dereference \
--duration_sec 300Note: Per #18793, this crash has not been reproducible locally so far. Recommended fix: No action needed on this PR. This is a pre-existing flaky failure unrelated to the PR changes. Consider re-running the workflow. |
…ubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
aafd44e to
755d069
Compare
…ubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
…ubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
755d069 to
2a0c14c
Compare
…ts test (facebookincubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
2a0c14c to
1a439c5
Compare
…ts test (facebookincubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
1a439c5 to
1c2214f
Compare
…ts test (facebookincubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
1c2214f to
4d6cead
Compare
…ts test (facebookincubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
4d6cead to
05c4aa0
Compare
…ts test (facebookincubator#18860) Summary: Explore Triton as a torchwave codegen target by porting the `tw.masked_select_jagged` op to standalone Triton kernels. This does NOT touch torchwave proper (no WaveGraph, no op registration); it adds a new self-contained package under `torchwave_meta/tests/triton/`. Two variants parallel the two CUDA forms in `minimal_viable_ai/torchwave_meta/Select.cuh`: - multikernel: staged launches (per-chunk count -> scan of partials -> write exclusive prefix -> scatter -> new segment lengths), mirroring torchwave's multi-kernel execution mode. - cg: a single persistent kernel carrying the same three stages across device-wide atomic barriers -- the Triton analogue of the CUDA `opBarrier` / grid.sync (`num_programs` kept co-resident so the spin-barrier cannot deadlock; programs grid-stride the chunks). The standalone test parallels the CUDA gtest `minimal_viable_ai/torchwave_meta/tests/KernelTest.cu` (SelectKernelTest): same input generation, the same per-segment CPU reference, and the same sizes; it validates the Triton kernels against the CPU reference and also covers the grouped mixed-dtype path. Authored with Claude. Reviewed By: Yuhta Differential Revision: D114379433
646a7a8
into
facebookincubator:main
Summary:
Explore Triton as a torchwave codegen target by porting the
tw.masked_select_jaggedop to standalone Triton kernels. This does NOTtouch torchwave proper (no WaveGraph, no op registration); it adds a new
self-contained package under
torchwave_meta/tests/triton/.Two variants parallel the two CUDA forms in
minimal_viable_ai/torchwave_meta/Select.cuh:write exclusive prefix -> scatter -> new segment lengths), mirroring
torchwave's multi-kernel execution mode.
device-wide atomic barriers -- the Triton analogue of the CUDA
opBarrier/ grid.sync (num_programskept co-resident so thespin-barrier cannot deadlock; programs grid-stride the chunks).
The standalone test parallels the CUDA gtest
minimal_viable_ai/torchwave_meta/tests/KernelTest.cu(SelectKernelTest):same input generation, the same per-segment CPU reference, and the same
sizes; it validates the Triton kernels against the CPU reference and also
covers the grouped mixed-dtype path.
Authored with Claude.
Reviewed By: Yuhta
Differential Revision: D114379433