diff --git a/_downloads/662999063954282841dc90b8945f85ce/tutorials_jupyter.zip b/_downloads/662999063954282841dc90b8945f85ce/tutorials_jupyter.zip index 4da79a8d8..20136fe3c 100644 Binary files a/_downloads/662999063954282841dc90b8945f85ce/tutorials_jupyter.zip and b/_downloads/662999063954282841dc90b8945f85ce/tutorials_jupyter.zip differ diff --git a/_downloads/763344228ae6bc253ed1a6cf586aa30d/tutorials_python.zip b/_downloads/763344228ae6bc253ed1a6cf586aa30d/tutorials_python.zip index 211129d2e..094cf074b 100644 Binary files a/_downloads/763344228ae6bc253ed1a6cf586aa30d/tutorials_python.zip and b/_downloads/763344228ae6bc253ed1a6cf586aa30d/tutorials_python.zip differ diff --git a/_downloads/b51b68bc1c6b1a5e509f67800b6235af/03-matrix-multiplication.ipynb b/_downloads/b51b68bc1c6b1a5e509f67800b6235af/03-matrix-multiplication.ipynb index 84c1c8fa4..9c857f938 100644 --- a/_downloads/b51b68bc1c6b1a5e509f67800b6235af/03-matrix-multiplication.ipynb +++ b/_downloads/b51b68bc1c6b1a5e509f67800b6235af/03-matrix-multiplication.ipynb @@ -83,7 +83,7 @@ }, "outputs": [], "source": [ - "src = \"\"\"\n#define MAX_GROUP_SIZE 8\n\n__global__ void dot(TYPE* A, TYPE* B, TYPE* C, \n int M, int N, int K, \n int lda, int ldb, int ldc) {\n int pid = get_program_id(0);\n int grid_m = (M + MB - 1) / MB;\n int grid_n = (N + NB - 1) / NB;\n int width = MAX_GROUP_SIZE * grid_n;\n int group_id = pid / width;\n int group_size = min(grid_m - group_id * MAX_GROUP_SIZE, MAX_GROUP_SIZE);\n int pid_m = group_id * MAX_GROUP_SIZE + (pid % group_size);\n int pid_n = (pid % width) / (group_size);\n int rm[MB] = pid_m * MB + 0 ... MB;\n int rn[NB] = pid_n * NB + 0 ... NB;\n int rk[KB] = 0 ... KB;\n TYPE *pa[MB, KB] = A + (rk [newaxis, :] * 1 + rm[:, newaxis] * lda);\n TYPE *pb[KB, NB] = B + (rk[:, newaxis] * ldb + rn [newaxis, :] * 1);\n float acc[MB, NB] = 0;\n for (int k = K; k > 0; k -= KB) {\n acc += (*pa) @ (*pb);\n pa += KB * 1;\n pb += KB * ldb;\n }\n rm = pid_m * MB + 0 ... MB;\n rn = pid_n * NB + 0 ... NB;\n TYPE *pc[MB, NB] = C + (rm[:, newaxis] * ldc + rn[newaxis, :]);\n *? (rm[:, newaxis] < M && rn [newaxis, :] < N) pc = acc;\n}\n\"\"\"\n\n\ndef make_kernel(device, dtype):\n key = (device, dtype)\n cache = make_kernel.cache\n if key not in cache:\n defines = {'TYPE': dtype}\n cache[key] = triton.kernel(src, device=device, defines=defines, autotune_vals=autotune_configs, autotune_key=autotune_key)\n return cache[key]\n\n\nmake_kernel.cache = dict()" + "src = \"\"\"\n#define MAX_GROUP_SIZE 8\n\n__global__ void dot(TYPE* A, TYPE* B, TYPE* C, \n int M, int N, int K, \n int lda, int ldb, int ldc) {\n int pid = get_program_id(0);\n int grid_m = (M + MB - 1) / MB;\n int grid_n = (N + NB - 1) / NB;\n int width = MAX_GROUP_SIZE * grid_n;\n int group_id = pid / width;\n int group_size = min(grid_m - group_id * MAX_GROUP_SIZE, MAX_GROUP_SIZE);\n int pid_m = group_id * MAX_GROUP_SIZE + (pid % group_size);\n int pid_n = (pid % width) / (group_size);\n int rm[MB] = pid_m * MB + 0 ... MB;\n int rn[NB] = pid_n * NB + 0 ... NB;\n int rk[KB] = 0 ... KB;\n TYPE *pa[MB, KB] = A + (rk [newaxis, :] * 1 + rm[:, newaxis] * lda);\n TYPE *pb[KB, NB] = B + (rk[:, newaxis] * ldb + rn [newaxis, :] * 1);\n float acc[MB, NB] = 0;\n for (int k = K; k > 0; k -= KB) {\n acc += (*pa) @ (*pb);\n pa += KB * 1;\n pb += KB * ldb;\n }\n rm = pid_m * MB + 0 ... MB;\n rn = pid_n * NB + 0 ... NB;\n TYPE *pc[MB, NB] = C + (rm[:, newaxis] * ldc + rn[newaxis, :]);\n *? (rm[:, newaxis] < M && rn [newaxis, :] < N) pc = acc;\n}\n\"\"\"\n\n\ndef make_kernel(device, dtype):\n key = (device, dtype)\n cache = make_kernel.cache\n if key not in cache:\n defines = {'TYPE': dtype}\n cache[key] = triton.kernel(\n src,\n device=device,\n defines=defines,\n autotune_configs=autotune_configs,\n autotune_key=autotune_key,\n )\n return cache[key]\n\n\nmake_kernel.cache = dict()" ] }, { @@ -126,7 +126,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Benchmark\n\n### Installing The CUTLASS Bindings\n\nThe cuBLAS library (used by :code:`torch.matmul`) uses handwritten assembly-level optimizations that cannot be replicated using publicly available tools.\nFor this reason, we will instead compare the performance of our kernel against `CUTLASS `_ , a highly optimized CUDA library for matrix multiplication written by NVIDIA themselves._\nTo install CUTLASS, you need a recent version of cmake:\n\n .. code-block:: bash\n\n cd /path/to/cutlass/\n git clone https://github.com/NVIDIA/cutlass.git\n cd cutlass\n mkdir build\n cd build\n wget https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-Linux-x86_64.tar.gz\n tar xzvf *.tar.gz\n\nYou can then install CUTLASS as follows for V100\n\n .. code-block:: bash\n\n ./cmake-3.19.4-Linux-x86_64/bin/cmake ../ -DCUTLASS_NVCC_ARCHS_ENABLED=70 -DCUTLASS_LIBRARY_KERNELS=cutlass_tensorop_f16_s884gemm_f16_*_align8\n make -j8 install\n\nOr as follows for A100:\n\n .. code-block:: bash\n\n ./cmake-3.19.4-Linux-x86_64/bin/cmake ../ -DCUTLASS_NVCC_ARCHS_ENABLED=80 -DCUTLASS_LIBRARY_KERNELS=cutlass_tensorop_f16_s16816gemm_*align8\n make -j8 install\n\nWhere you can change CUTLASS_LIBRARY_KERNELS as you desire. Here, we are only interested in FP16 tensor core performance.\nTriton comes with some basic Python bindings for benchmarking CUTLASS. These will be compiled when the environment variables :code:`CUTLASS_INCLUDE_DIR` and :code:`CUTLASS_LIBRARY_DIR` are set during the installation process.\nTo re-install Triton with the updated CUTLASS bindings, run the following command:\n\n.. code-block:: bash\n\n export CUTLASS_INCLUDE_DIR=/tmp/cutlass/build/install/include/\n export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/a\n pip uninstall -y triton\n pip install -e \"git+https://github.com/ptillet/triton.git#egg=triton&subdirectory=python\"\n\nWhich we can test as follows:\n\n" + "## Benchmark\n\n### Installing The CUTLASS Bindings\n\nThe cuBLAS library (used by :code:`torch.matmul`) uses handwritten assembly-level optimizations that cannot be replicated using publicly available tools.\nFor this reason, we will instead compare the performance of our kernel against `CUTLASS `_ , a highly optimized CUDA library for matrix multiplication written by NVIDIA themselves._\nTo install CUTLASS, you need a recent version of cmake:\n\n .. code-block:: bash\n\n cd /path/to/cutlass/\n git clone https://github.com/NVIDIA/cutlass.git\n cd cutlass\n mkdir build\n cd build\n wget https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-Linux-x86_64.tar.gz\n tar xzvf *.tar.gz\n\nYou can then install CUTLASS as follows for V100\n\n .. code-block:: bash\n\n ./cmake-3.19.4-Linux-x86_64/bin/cmake ../ -DCUTLASS_NVCC_ARCHS_ENABLED=70 -DCUTLASS_LIBRARY_KERNELS=cutlass_tensorop_f16_s884gemm_f16_*_align8\n make -j8 install\n\nOr as follows for A100:\n\n .. code-block:: bash\n\n ./cmake-3.19.4-Linux-x86_64/bin/cmake ../ -DCUTLASS_NVCC_ARCHS_ENABLED=80 -DCUTLASS_LIBRARY_KERNELS=cutlass_tensorop_f16_s16816gemm_*align8\n make -j8 install\n\nWhere you can change CUTLASS_LIBRARY_KERNELS as you desire. Here, we are only interested in FP16 tensor core performance.\nTriton comes with some basic Python bindings for benchmarking CUTLASS. These will be compiled when the environment variables :code:`CUTLASS_INCLUDE_DIR` and :code:`CUTLASS_LIBRARY_DIR` are set during the installation process.\nTo re-install Triton with the updated CUTLASS bindings, run the following command:\n\n.. code-block:: bash\n\n export CUTLASS_INCLUDE_DIR=/tmp/cutlass/build/install/include/\n export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/\n pip uninstall -y triton\n pip install -e \"git+https://github.com/ptillet/triton.git#egg=triton&subdirectory=python\"\n\nWhich we can test as follows:\n\n" ] }, { @@ -155,7 +155,7 @@ }, "outputs": [], "source": [ - "@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot\n x_vals=[256 * i for i in range(2, 33)], # different possible values for `x_name`\n y_name='provider', # argument name whose value corresponds to a different line in the plot\n y_vals=['torch', 'triton', 'cutlass'], # possible keys for `y_name`\n y_lines=[\"Torch\", \"Triton\", 'CUTLASS'], # label name for the lines\n ylabel=\"TFLOPS\", # label name for the y-axis\n plot_name=\"matmul-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={}\n )\n)\ndef benchmark(M, N, K, provider):\n a = torch.randn((M, K), device='cuda', dtype=torch.float16)\n b = torch.randn((K, N), device='cuda', dtype=torch.float16)\n if provider == 'torch':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.matmul(a, b))\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: dot(a, b))\n if provider == 'cutlass':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: triton.testing.cutlass_matmul(a, b))\n perf = lambda ms: 2 * M * N * K * 1e-12 / (ms * 1e-3)\n return perf(ms), perf(max_ms), perf(min_ms)\n\n\nbenchmark.run(show_plots=True)" + "@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot\n x_vals=[256 * i for i in range(2, 33)], # different possible values for `x_name`\n y_name='provider', # argument name whose value corresponds to a different line in the plot\n y_vals=['cublas', 'triton', 'cutlass'], # possible keys for `y_name`\n y_lines=[\"cuBLAS\", \"Triton\", 'CUTLASS'], # label name for the lines\n ylabel=\"TFLOPS\", # label name for the y-axis\n plot_name=\"matmul-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={}\n )\n)\ndef benchmark(M, N, K, provider):\n a = torch.randn((M, K), device='cuda', dtype=torch.float16)\n b = torch.randn((K, N), device='cuda', dtype=torch.float16)\n if provider == 'cublas':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.matmul(a, b))\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: dot(a, b))\n if provider == 'cutlass':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: triton.testing.cutlass_matmul(a, b))\n perf = lambda ms: 2 * M * N * K * 1e-12 / (ms * 1e-3)\n return perf(ms), perf(max_ms), perf(min_ms)\n\n\nbenchmark.run(show_plots=True)" ] }, { diff --git a/_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py b/_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py index b6cd299bd..10534e874 100644 --- a/_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py +++ b/_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py @@ -229,7 +229,13 @@ def make_kernel(device, dtype): cache = make_kernel.cache if key not in cache: defines = {'TYPE': dtype} - cache[key] = triton.kernel(src, device=device, defines=defines, autotune_vals=autotune_configs, autotune_key=autotune_key) + cache[key] = triton.kernel( + src, + device=device, + defines=defines, + autotune_configs=autotune_configs, + autotune_key=autotune_key, + ) return cache[key] @@ -319,7 +325,7 @@ print(torch.allclose(c_0, c_1, rtol=1e-3, atol=1e-3)) # .. code-block:: bash # # export CUTLASS_INCLUDE_DIR=/tmp/cutlass/build/install/include/ -# export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/a +# export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/ # pip uninstall -y triton # pip install -e "git+https://github.com/ptillet/triton.git#egg=triton&subdirectory=python" # @@ -343,8 +349,8 @@ print(torch.allclose(c_0, c_2, rtol=1e-3, atol=1e-3)) x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot x_vals=[256 * i for i in range(2, 33)], # different possible values for `x_name` y_name='provider', # argument name whose value corresponds to a different line in the plot - y_vals=['torch', 'triton', 'cutlass'], # possible keys for `y_name` - y_lines=["Torch", "Triton", 'CUTLASS'], # label name for the lines + y_vals=['cublas', 'triton', 'cutlass'], # possible keys for `y_name` + y_lines=["cuBLAS", "Triton", 'CUTLASS'], # label name for the lines ylabel="TFLOPS", # label name for the y-axis plot_name="matmul-performance", # name for the plot. Used also as a file name for saving the plot. args={} @@ -353,7 +359,7 @@ print(torch.allclose(c_0, c_2, rtol=1e-3, atol=1e-3)) def benchmark(M, N, K, provider): a = torch.randn((M, K), device='cuda', dtype=torch.float16) b = torch.randn((K, N), device='cuda', dtype=torch.float16) - if provider == 'torch': + if provider == 'cublas': ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.matmul(a, b)) if provider == 'triton': ms, min_ms, max_ms = triton.testing.do_bench(lambda: dot(a, b)) diff --git a/_images/cuda-parallel-matmul1.png b/_images/cuda-parallel-matmul1.png new file mode 100644 index 000000000..8050ad150 Binary files /dev/null and b/_images/cuda-parallel-matmul1.png differ diff --git a/_images/halide-iteration1.png b/_images/halide-iteration1.png new file mode 100644 index 000000000..073634677 Binary files /dev/null and b/_images/halide-iteration1.png differ diff --git a/_images/polyhedral-iteration1.png b/_images/polyhedral-iteration1.png new file mode 100644 index 000000000..02f9c2593 Binary files /dev/null and b/_images/polyhedral-iteration1.png differ diff --git a/_images/sphx_glr_01-vector-add_001.png b/_images/sphx_glr_01-vector-add_001.png index 204fbfff1..2340461b9 100644 Binary files a/_images/sphx_glr_01-vector-add_001.png and b/_images/sphx_glr_01-vector-add_001.png differ diff --git a/_images/sphx_glr_01-vector-add_thumb.png b/_images/sphx_glr_01-vector-add_thumb.png index 586c494a4..948c5257f 100644 Binary files a/_images/sphx_glr_01-vector-add_thumb.png and b/_images/sphx_glr_01-vector-add_thumb.png differ diff --git a/_images/sphx_glr_02-fused-softmax_001.png b/_images/sphx_glr_02-fused-softmax_001.png index 9313407ed..5e553afde 100644 Binary files a/_images/sphx_glr_02-fused-softmax_001.png and b/_images/sphx_glr_02-fused-softmax_001.png differ diff --git a/_images/sphx_glr_02-fused-softmax_thumb.png b/_images/sphx_glr_02-fused-softmax_thumb.png index cbd75d992..749e73a36 100644 Binary files a/_images/sphx_glr_02-fused-softmax_thumb.png and b/_images/sphx_glr_02-fused-softmax_thumb.png differ diff --git a/_images/sphx_glr_03-matrix-multiplication_001.png b/_images/sphx_glr_03-matrix-multiplication_001.png index 969f51c3d..af681b138 100644 Binary files a/_images/sphx_glr_03-matrix-multiplication_001.png and b/_images/sphx_glr_03-matrix-multiplication_001.png differ diff --git a/_images/sphx_glr_03-matrix-multiplication_thumb.png b/_images/sphx_glr_03-matrix-multiplication_thumb.png index fdc08a9b9..fe0c86955 100644 Binary files a/_images/sphx_glr_03-matrix-multiplication_thumb.png and b/_images/sphx_glr_03-matrix-multiplication_thumb.png differ diff --git a/_images/triton-parallel-matmul1.png b/_images/triton-parallel-matmul1.png new file mode 100644 index 000000000..7b11ba2af Binary files /dev/null and b/_images/triton-parallel-matmul1.png differ diff --git a/_sources/getting-started/tutorials/01-vector-add.rst.txt b/_sources/getting-started/tutorials/01-vector-add.rst.txt index 10aa1afb9..7dabc45b2 100644 --- a/_sources/getting-started/tutorials/01-vector-add.rst.txt +++ b/_sources/getting-started/tutorials/01-vector-add.rst.txt @@ -258,7 +258,7 @@ We can now run the decorated function above. Pass `show_plots=True` to see the p .. image:: /getting-started/tutorials/images/sphx_glr_01-vector-add_001.png - :alt: vector-add-performance + :alt: 01 vector add :class: sphx-glr-single-img @@ -268,7 +268,7 @@ We can now run the decorated function above. Pass `show_plots=True` to see the p .. rst-class:: sphx-glr-timing - **Total running time of the script:** ( 0 minutes 7.756 seconds) + **Total running time of the script:** ( 0 minutes 9.497 seconds) .. _sphx_glr_download_getting-started_tutorials_01-vector-add.py: diff --git a/_sources/getting-started/tutorials/02-fused-softmax.rst.txt b/_sources/getting-started/tutorials/02-fused-softmax.rst.txt index 5babdbd8c..741021730 100644 --- a/_sources/getting-started/tutorials/02-fused-softmax.rst.txt +++ b/_sources/getting-started/tutorials/02-fused-softmax.rst.txt @@ -295,7 +295,7 @@ We will then compare its performance against (1) :code:`torch.softmax` and (2) t .. image:: /getting-started/tutorials/images/sphx_glr_02-fused-softmax_001.png - :alt: softmax-performance + :alt: 02 fused softmax :class: sphx-glr-single-img @@ -314,7 +314,7 @@ In the above plot, we can see that: .. rst-class:: sphx-glr-timing - **Total running time of the script:** ( 0 minutes 19.933 seconds) + **Total running time of the script:** ( 0 minutes 25.654 seconds) .. _sphx_glr_download_getting-started_tutorials_02-fused-softmax.py: diff --git a/_sources/getting-started/tutorials/03-matrix-multiplication.rst.txt b/_sources/getting-started/tutorials/03-matrix-multiplication.rst.txt index d4b2f6e84..bafb7a479 100644 --- a/_sources/getting-started/tutorials/03-matrix-multiplication.rst.txt +++ b/_sources/getting-started/tutorials/03-matrix-multiplication.rst.txt @@ -238,7 +238,7 @@ Here, we want to re-tune our kernel only when the shape of input matrices change We can now create an auto-tuned kernel by passing the `autotune_configs` and `autotune_key` lists to the constructor of the :code:`triton.kernel` class. -.. GENERATED FROM PYTHON SOURCE LINES 193-238 +.. GENERATED FROM PYTHON SOURCE LINES 193-244 .. code-block:: default @@ -281,7 +281,13 @@ We can now create an auto-tuned kernel by passing the `autotune_configs` and `au cache = make_kernel.cache if key not in cache: defines = {'TYPE': dtype} - cache[key] = triton.kernel(src, device=device, defines=defines, autotune_vals=autotune_configs, autotune_key=autotune_key) + cache[key] = triton.kernel( + src, + device=device, + defines=defines, + autotune_configs=autotune_configs, + autotune_key=autotune_key, + ) return cache[key] @@ -294,7 +300,7 @@ We can now create an auto-tuned kernel by passing the `autotune_configs` and `au -.. GENERATED FROM PYTHON SOURCE LINES 239-244 +.. GENERATED FROM PYTHON SOURCE LINES 245-250 Autograd Function ~~~~~~~~~~~~~~~~~~ @@ -302,7 +308,7 @@ Autograd Function Now we are ready to expose our auto-tuned kernel as a `torch.autograd.Function`. To do so, we just need to define a `forward` function that takes a two tensors as input and returns a tensor as output. -.. GENERATED FROM PYTHON SOURCE LINES 244-265 +.. GENERATED FROM PYTHON SOURCE LINES 250-271 .. code-block:: default @@ -334,7 +340,7 @@ To do so, we just need to define a `forward` function that takes a two tensors a -.. GENERATED FROM PYTHON SOURCE LINES 266-271 +.. GENERATED FROM PYTHON SOURCE LINES 272-277 Unit Test ----------- @@ -342,7 +348,7 @@ Unit Test We can test our custom matrix multiplication operation against cuBLAS (i.e., :code:`torch.matmul`). Note that we need to modify the :code`atol` and :code:`rtol` parameters of `torch.allclose` to account for the fact that we are comparing FP16 tensors. -.. GENERATED FROM PYTHON SOURCE LINES 271-280 +.. GENERATED FROM PYTHON SOURCE LINES 277-286 .. code-block:: default @@ -386,7 +392,7 @@ Note that we need to modify the :code`atol` and :code:`rtol` parameters of `torc -.. GENERATED FROM PYTHON SOURCE LINES 281-327 +.. GENERATED FROM PYTHON SOURCE LINES 287-333 Benchmark -------------- @@ -429,13 +435,13 @@ To re-install Triton with the updated CUTLASS bindings, run the following comman .. code-block:: bash export CUTLASS_INCLUDE_DIR=/tmp/cutlass/build/install/include/ - export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/a + export CUTLASS_LIBRARY_DIR=/tmp/cutlass/build/install/lib/ pip uninstall -y triton pip install -e "git+https://github.com/ptillet/triton.git#egg=triton&subdirectory=python" Which we can test as follows: -.. GENERATED FROM PYTHON SOURCE LINES 327-333 +.. GENERATED FROM PYTHON SOURCE LINES 333-339 .. code-block:: default @@ -468,7 +474,7 @@ Which we can test as follows: -.. GENERATED FROM PYTHON SOURCE LINES 334-339 +.. GENERATED FROM PYTHON SOURCE LINES 340-345 Note that this wrapper for CUTLASS was written for benchmarking purposes and is probably not production-ready. @@ -476,7 +482,7 @@ Square Matrix Performance ~~~~~~~~~~~~~~~~~~~~~~~~~~ We can now compare the performance of our kernel against CUTLASS. Here we focus on square matrices, but feel free to arrange the script as you wish to compare any other matrix shape.# -.. GENERATED FROM PYTHON SOURCE LINES 339-368 +.. GENERATED FROM PYTHON SOURCE LINES 345-374 .. code-block:: default @@ -487,8 +493,8 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot x_vals=[256 * i for i in range(2, 33)], # different possible values for `x_name` y_name='provider', # argument name whose value corresponds to a different line in the plot - y_vals=['torch', 'triton', 'cutlass'], # possible keys for `y_name` - y_lines=["Torch", "Triton", 'CUTLASS'], # label name for the lines + y_vals=['cublas', 'triton', 'cutlass'], # possible keys for `y_name` + y_lines=["cuBLAS", "Triton", 'CUTLASS'], # label name for the lines ylabel="TFLOPS", # label name for the y-axis plot_name="matmul-performance", # name for the plot. Used also as a file name for saving the plot. args={} @@ -497,7 +503,7 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus def benchmark(M, N, K, provider): a = torch.randn((M, K), device='cuda', dtype=torch.float16) b = torch.randn((K, N), device='cuda', dtype=torch.float16) - if provider == 'torch': + if provider == 'cublas': ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.matmul(a, b)) if provider == 'triton': ms, min_ms, max_ms = triton.testing.do_bench(lambda: dot(a, b)) @@ -513,21 +519,21 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus .. image:: /getting-started/tutorials/images/sphx_glr_03-matrix-multiplication_001.png - :alt: matmul-performance + :alt: 03 matrix multiplication :class: sphx-glr-single-img -.. GENERATED FROM PYTHON SOURCE LINES 369-369 +.. GENERATED FROM PYTHON SOURCE LINES 375-375 As we can see, the performance of our kernel is pretty good. It is in fact faster than CUTLASS, and therefore probably comparable to the absolute best CUDA code an expert could write. .. rst-class:: sphx-glr-timing - **Total running time of the script:** ( 1 minutes 6.502 seconds) + **Total running time of the script:** ( 1 minutes 5.861 seconds) .. _sphx_glr_download_getting-started_tutorials_03-matrix-multiplication.py: diff --git a/_sources/getting-started/tutorials/sg_execution_times.rst.txt b/_sources/getting-started/tutorials/sg_execution_times.rst.txt index 4481e1ce0..3cb78b184 100644 --- a/_sources/getting-started/tutorials/sg_execution_times.rst.txt +++ b/_sources/getting-started/tutorials/sg_execution_times.rst.txt @@ -5,12 +5,12 @@ Computation times ================= -**01:34.190** total execution time for **getting-started_tutorials** files: +**00:25.654** total execution time for **getting-started_tutorials** files: +---------------------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_getting-started_tutorials_03-matrix-multiplication.py` (``03-matrix-multiplication.py``) | 01:06.502 | 0.0 MB | +| :ref:`sphx_glr_getting-started_tutorials_02-fused-softmax.py` (``02-fused-softmax.py``) | 00:25.654 | 0.0 MB | +---------------------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_getting-started_tutorials_02-fused-softmax.py` (``02-fused-softmax.py``) | 00:19.933 | 0.0 MB | +| :ref:`sphx_glr_getting-started_tutorials_01-vector-add.py` (``01-vector-add.py``) | 00:00.000 | 0.0 MB | +---------------------------------------------------------------------------------------------------------+-----------+--------+ -| :ref:`sphx_glr_getting-started_tutorials_01-vector-add.py` (``01-vector-add.py``) | 00:07.756 | 0.0 MB | +| :ref:`sphx_glr_getting-started_tutorials_03-matrix-multiplication.py` (``03-matrix-multiplication.py``) | 00:00.000 | 0.0 MB | +---------------------------------------------------------------------------------------------------------+-----------+--------+ diff --git a/_sources/programming-guide/introduction.rst.txt b/_sources/programming-guide/introduction.rst.txt new file mode 100644 index 000000000..85f30939f --- /dev/null +++ b/_sources/programming-guide/introduction.rst.txt @@ -0,0 +1,69 @@ +============== +Introduction +============== + +-------------- +Motivations +-------------- + +Over the past decade, Deep Neural Networks (DNNs) have emerged as an important class of Machine Learning (ML) models, capable of achieving state-of-the-art performance across many domains ranging from natural language processing [1]_ to computer vision [2]_ to computational neuroscience [3]_. The strength of these models lies in their hierarchical structure, composed of a sequence of parametric (e.g., convolutional) and non-parametric (e.g., rectified linearity) *layers*. This pattern, though notoriously computationally expensive, also generates a large amount of highly parallelizable work particularly well suited for multi- and many- core processors. + +As a consequence, Graphics Processing Units (GPUs) have become a cheap and accessible resource for exploring and/or deploying novel research ideas in the field. This trend has been accelerated by the release of several frameworks for General-Purpose GPU (GPGPU) computing, such as CUDA and OpenCL, which have made the development of high-performance programs easier. Yet, GPUs remain incredibly challenging to optimize for locality and parallelism, especially for computations that cannot be efficiently implemented using a combination of pre-existing optimized primitives. To make matters worse, GPU architectures are also rapidly evolving and specializing, as evidenced by the addition of tensor cores to NVIDIA (and more recently AMD) micro-architectures. + +This tension between the computational opportunities offered by DNNs and the practical difficulty of GPU programming has created substantial academic and industrial interest for Domain-Specific Languages (DSLs) and compilers. Regrettably, these systems -- whether they be based on polyhedral machinery (*e.g.*, Tiramisu [4]_, Tensor Comprehensions [5]_) or scheduling languages (*e.g.*, Halide [6]_, TVM [7]_) -- remain less flexible and (for the same algorithm) markedly slower than the best handwritten compute kernels available in libraries like `cuBLAS `_, `cuDNN `_ or `TensorRT `_. + +The main premise of this project is the following: programming paradigms based on blocked algorithms [8]_ can facilitate the construction of high-performance compute kernels for neural networks. We specifically revisit traditional "Single Program, Multiple Data" (SPMD [9]_) execution models for GPUs, and propose a variant in which programs -- rather than threads -- are blocked. For example, in the case of matrix multiplication, CUDA and Triton differ as follows: + +.. table:: + :widths: 50 50 + + +-----------------------------------------------------+-----------------------------------------------------+ + | CUDA Programming Model | Triton Programming Model | + | | | + | (Scalar Program, Blocked Threads) | (Blocked Program, Scalar Threads) | + +=====================================================+=====================================================+ + | | | + |.. code-block:: C |.. code-block:: C | + | | :force: | + | | | + | #pragma parallel | #pragma parallel | + | for(int m = 0; i < M; m++) | for(int m = 0; m < M; m += MB) | + | #pragma parallel | #pragma parallel | + | for(int n = 0; j < N; n++){ | for(int n = 0; n < N; n += NB){ | + | float acc = 0; | float acc[MB, NB] = 0; | + | for(int k = 0; k < K;k ++) | for(int k = 0; k < K; k += KB) | + | acc += A[i, k]* B[k, j]; | acc += A[m:m+MB, k:k+KB] | + | | @ B[k:k+KB, n:n+NB]; | + | C[i, j] = acc; | C[m:m+MB, n:n+NB] = acc; | + | } | } | + | | | + +-----------------------------------------------------+-----------------------------------------------------+ + | |pic1| | |pic2| | + +-----------------------------------------------------+-----------------------------------------------------+ + + +.. |pic1| image:: cuda-parallel-matmul.png + +.. |pic2| image:: triton-parallel-matmul.png + +A key benefit of this approach is that it leads to block-structured iteration spaces that offer programmers more flexibility than existing DSLs when implementing sparse operations, all while allowing compilers to aggressively optimize programs for data locality and parallelism. + +-------------- +Challenges +-------------- + +The main challenge posed by our proposed paradigm is that of work scheduling, i.e., how the work done by each program instance should be partitioned for efficient execution on modern GPUs. To address this issue, the Triton compiler makes heavy use of *block-level data-flow analysis*, a technique for scheduling iteration blocks statically based on the control- and data-flow structure of the target program. The resulting system actually works surprisingly well: our compiler manages to apply a broad range of interesting optimization automatically (e.g., automatic coalescing, thread swizzling, pre-fetching, automatic vectorization, tensor core-aware instruction selection, shared memory allocation/synchronization, asynchronous copy scheduling). Of course doing all this is not trivial; one of the purposes of this guide is to give you a sense of how it works. + +-------------- +References +-------------- + +.. [1] Sutskever et al., "Sequence to Sequence Learning with Neural Networks", NIPS 2014 +.. [2] Redmon et al., "You Only Look Once: Unified, Real-Time Object Detection", CVPR 2016 +.. [3] Lee et al., "Superhuman Accuracy on the SNEMI3D Connectomics Challenge", ArXiV 2017 +.. [4] Baghdadi et al., "Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code", CGO 2021 +.. [5] Vasilache et al., "Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions", ArXiV 2018 +.. [6] Ragan-Kelley et al., "Halide: A Language and Compiler for Optimizing Parallelism, Locality, and Recomputation in Image Processing Pipelines", PLDI 2013 +.. [7] Chen et al., "TVM: An Automated End-to-End Optimizing Compiler for Deep Learning", OSDI 2018 +.. [8] Lam et al., "The Cache Performance and Optimizations of Blocked Algorithms", ASPLOS 1991 +.. [9] Auguin et al., "Opsila: an advanced SIMD for numerical analysis and signal processing", EUROMICRO 1983 \ No newline at end of file diff --git a/_sources/programming-guide/related-work.rst.txt b/_sources/programming-guide/related-work.rst.txt new file mode 100644 index 000000000..2222f70ae --- /dev/null +++ b/_sources/programming-guide/related-work.rst.txt @@ -0,0 +1,209 @@ +============== +Related Work +============== + +At first sight, Triton may seem like just yet another DSL for DNNs. The purpose of this section is to contextualize Triton and highlights its differences with the two leading approaches in this domain: polyhedral compilation and scheduling languages. + +----------------------- +Polyhedral Compilation +----------------------- + +Traditional compilers typically rely on intermediate representations, such as LLVM-IR [1]_, that encode control flow information using (un)conditional branches. This relatively low-level format makes it difficult to statically analyze the runtime behavior (e.g., cache misses) of input programs, and to automatically optimize loops accordingly through the use of tiling [2]_, fusion [3]_ and interchange [4]_. To solve this issue, polyhedral compilers [5]_ rely on program representations that have statically predictable control flow, thereby enabling aggressive compile-time program transformations for data locality and parallelism. Though this strategy has been adopted by many languages and compilers for DNNs such as Tiramisu [6]_, Tensor Comprehensions [7]_, Diesel [8]_ and the Affine dialect in MLIR [9]_, it also comes with a number of limitations that will be described later. + ++++++++++++++++++++++++ +Program Representation ++++++++++++++++++++++++ + +Polyhedral compilation is a vast area of research. In this section we only outline the most basic aspects of this topic, but readers interested in the solid mathematical foundations underneath may refer to the ample litterature on linear and integer programming. + +.. table:: + :widths: 50 50 + + +-----------------------------------------------------+-----------------------------------------------------+ + | | | + |.. code-block:: C | |pic1| | + | | | + | for(int i = 0; i < 3; i++) | | + | for(int j = i; j < 5; j++) | | + | A[i][j] = 0; | | + +-----------------------------------------------------+-----------------------------------------------------+ + +.. |pic1| image:: polyhedral-iteration.png + :width: 300 + +Polyhedral compilers focus on a class of programs commonly known as **Static Control Parts** (SCoP), *i.e.*, maximal sets of consecutive statements in which conditionals and loop bounds are affine functions of surrounding loop indices and global invariant parameters. As shown above, programs in this format always lead to iteration domains that are bounded by affine inequalities, i.e., polyhedral. These polyhedra can also be defined algebraically; for the above example: + +.. math:: + + \mathcal{P} = \{ i, j \in \mathbb{Z}^2 + ~|~ + \begin{pmatrix} + 1 & 0 \\ + -1 & 0 \\ + -1 & 1 \\ + 0 & -1 \\ + \end{pmatrix} + \begin{pmatrix} + i \\ + j + \end{pmatrix} + + + \begin{pmatrix} + 0 \\ + 2 \\ + 0 \\ + 4 + \end{pmatrix} + \geq + 0 + \} + + +Each point :math:`(i, j)` in :math:`\mathcal{P}` represents a *polyhedral statement*, that is a program statement which (1) does not induce control-flow side effects (e.g., :code:`for`, :code:`if`, :code:`break`) and (2) contains only affine functions of loop indices and global parameters in array accesses. To facilitate alias analysis, array accesses are also mathematically abstracted, using so-called *access function*. In other words, :code:`A[i][j]` is simply :code:`A[f(i,j)]` where the access function :math:`f` is defined by: + +.. math:: + + f(i, j) = \begin{pmatrix} + 1 & 0\\ + 0 & 1\\ + \end{pmatrix} + \begin{pmatrix} + i\\ + j + \end{pmatrix} + = + (i, j) + + +Note that the iteration domains of an SCoP does not specify the order in which its statements shall execute. In fact, this iteration domain may be traversed in many different possible legal orders, i.e. *schedules*. Formally, a schedule is defined as a p-dimensional affine transformation :math:`\Theta` of loop indices :math:`\mathbf{x}` and global invariant parameters :math:`\mathbf{g}`: + +.. math:: + \Theta_S(\mathbf{x}) = T_S \begin{pmatrix} + \vec{x}\\ + \vec{g}\\ + 1 + \end{pmatrix} + \qquad + T_S \in \mathbb{Z} ^{p \times (\text{dim}(\mathbf{x}) + \text{dim}(\mathbf{g}) + 1)} + + +Where :math:`\Theta_S(\mathbf{x})` is a p-dimensional vector representing the slowest to fastest growing indices (from left to right) when traversing the loop nest surrounding :math:`S`. For the code shown above, the original schedule defined by the loop nest in C can be retrieved by using: + +.. math:: + \Theta_S(\mathbf{x}) = \begin{pmatrix} + 1 & 0 \\ + 0 & 1 \\ + \end{pmatrix} + \begin{pmatrix} + i & j + \end{pmatrix}^T + = + \begin{pmatrix} + i & j + \end{pmatrix}^T + + +where :math:`i` and :math:`j` are respectively the slowest and fastest growing loop indices in the nest. If :math:`T_S` is a vector (resp. tensor), then :math:`\Theta_S` is a said to be one-dimensional (resp. multi-dimensional). + ++++++++++++ +Advantages ++++++++++++ + +Programs amenable to polyhedral compilation can be aggressively transformed and optimized. Most of these transformations actually boil down to the production of schedules and iteration domains that enable loop transformations promoting parallelism and spatial/temporal data locality (e.g., fusion, interchange, tiling, parallelization). + +Polyhedral compilers can also automatically go through complex verification processes to ensure that the semantics of their input program is preserved throughout this optimization phase. Note that polyhedral optimizers are not incompatible with more standard optimization techniques. In fact, it is not uncommon for these systems to be implemented as a set of LLVM passes that can be run ahead of more traditional compilation techniques [10]_. + +All in all, polyhedral machinery is extremely powerful, when applicable. It has been shown to support most common loop transformations, and has indeed achieved performance comparable to state-of-the-art GPU libraries for dense matrix multiplication [8]_. Additionally, it is also fully automatic and doesn't require any hint from programmers apart from source-code in a C-like format. + +++++++++++++ +Limitations +++++++++++++ + +Unfortunately, polyhedral compilers suffer from two major limitations that have prevented its adoption as a universal method for code generation in neural networks. + +First, the set of possible program transformations $\Omega = \{ \Theta_S ~|~ S \in \text{program} \}$ is large, and grows with the number of statements in the program as well as with the size of their iteration domain. Verifying the legality of each transformation can also require the resolution of complex integer linear programs, making polyhedral compilation very computationally expensive. To make matters worse, hardware properties (e.g., cache size, number of SMs) and contextual characteristics (e.g., input tensor shapes) also have to be taken into account by this framework, leading to expensive auto-tuning procedures [11]_. + +Second, the polyhedral framework is not very generally applicable; SCoPs are relatively common [12]_ but require loop bounds and array subscripts to be affine functions of loop indices, which typically only occurs in regular, dense computations. For this reason, this framework still has to be successfully applied to sparse -- or even structured-sparse -- neural networks, whose importance has been rapidly rising over the past few years. + +On the other hand, blocked program representations advocated by this dissertation are less restricted in scope and can achieve close to peak performance using standard dataflow analysis. + +----------------------- +Scheduling Languages +----------------------- + +Separation of concerns \cite{dijkstra82} is a well-known design principle in computer science: programs should be decomposed into modular layers of abstraction that separate the semantics of their algorithms from the details of their implementation. Systems like Halide and TVM push this philosophy one step further, and enforce this separation at the grammatical level through the use of a **scheduling language**. The benefits of this methodology are particularly visible in the case of matrix multiplication, where, as one can see below, the definition of the algorithm (Line 1-7) is completely disjoint from its implementation (Line 8-16), meaning that both can be maintained, optimized and distributed independently. + +.. code-block:: python + :linenos: + + // algorithm + Var x("x"), y("y"); + Func matmul("matmul"); + RDom k(0, matrix_size); + RVar ki; + matmul(x, y) = 0.0f; + matmul(x, y) += A(k, y) * B(x, k); + // schedule + Var xi("xi"), xo("xo"), yo("yo"), yi("yo"), yii("yii"), xii("xii"); + matmul.vectorize(x, 8); + matmul.update(0) + .split(x, x, xi, block_size).split(xi, xi, xii, 8) + .split(y, y, yi, block_size).split(yi, yi, yii, 4) + .split(k, k, ki, block_size) + .reorder(xii, yii, xi, ki, yi, k, x, y) + .parallel(y).vectorize(xii).unroll(xi).unroll(yii); + + +The resulting code may however not be completely portable, as schedules can sometimes rely on execution models (e.g., SPMD) or hardware intrinsics (e.g., matrix-multiply-accumulate) that are not widely available. This issue can be mitigated by auto-scheduling mechanisms [13]_. + ++++++++++++ +Advantages ++++++++++++ + +The main advantage of this approach is that it allows programmers to write an algorithm *only once*, and focus on performance optimization separately. It makes it possible to manually specify optimizations that a polyhedral compiler wouldn't be able to figure out automatically using static data-flow analysis. + +Scheduling languages are, without a doubt, one of the most popular approaches for neural network code generation. The most popular system for this purpose is probably TVM, which provides good performance across a wide range of platforms as well as built-in automatic scheduling mechanisms. + +++++++++++++ +Limitations +++++++++++++ + +This ease-of-development comes at a cost. First of all, existing systems that follow this paradigm tend to be noticeably slower than Triton on modern hardware when applicable (e.g., V100/A100 tensor cores w/ equal tile sizes). I do believe that this is not a fundamental issue of scheduling languages -- in the sense that it could probably be solved with more efforts -- but it could mean that these systems are harder to engineer. More importantly, existing scheduling languages generate loops whose bounds and increments cannot depend on surrounding loop indice without at least imposing severe constraints on possible schedules -- if not breaking the system entirely. This is problematic for sparse com-putations, whose iteration spaces may be irregular. + +.. table:: + :widths: 50 50 + + +-----------------------------------------------------+-----------------------------------------------------+ + | | | + |.. code-block:: C | |pic2| | + | | | + | for(int i = 0; i < 4; i++) | | + | for(int j = 0; j < 4; j++) | | + | float acc = 0; | | + | for(int k = 0; k < K[i]; k++) | | + | acc += A[i][col[i,k]]*B[k][j] | | + | C[i][j] = acc; | | + +-----------------------------------------------------+-----------------------------------------------------+ + +.. |pic2| image:: halide-iteration.png + :width: 300 + +On the other hand, the block-based program representation that we advocate for through this work allows for block-structured iteration spaces and allows programmers to manually handle load-balancing as they wish. + +-------------- +References +-------------- + +.. [1] Lattner et al., "LLVM: a compilation framework for lifelong program analysis transformation" +.. [2] Wolfe, "More Iteration Space Tiling", SC 1989 +.. [3] Darte, "On the Complexity of Loop Fusion", PACT 1999 +.. [4] Allen et al., "Automatic Loop Interchange", SIGPLAN Notices 1984 +.. [5] Ancourt et al., "Scanning Polyhedra with DO Loops", PPoPP 1991 +.. [6] Baghdadi et al., "Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code", CGO 2021 +.. [7] Vasilache et al., "Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions", ArXiV 2018 +.. [8] Elango et al. "Diesel: DSL for Linear Algebra and Neural Net Computations on GPUs", MAPL 2018 +.. [9] Lattner et al., "MLIR Primer: A Compiler Infrastructure for the End of Moore’s Law", Arxiv 2019 +.. [10] Grosser et al., "Polly - Performing Polyhedral Optimizations on a Low-Level Intermediate Representation", Parallel Processing Letters 2012 +.. [11] Sato et al., "An Autotuning Framework for Scalable Execution of Tiled Code via Iterative Polyhedral Compilation", TACO 2019 +.. [12] Girbal et al., "Semi-Automatic Composition of Loop Transformations for Deep Parallelism and Memory Hierarchies", International Journal of Parallel Programming 2006 +.. [13] Mullapudi et al., "Automatically scheduling halide image processing pipelines", TOG 2016 \ No newline at end of file diff --git a/_sources/programming-guide/triton-c.rst.txt b/_sources/programming-guide/triton-c.rst.txt new file mode 100644 index 000000000..789bdb268 --- /dev/null +++ b/_sources/programming-guide/triton-c.rst.txt @@ -0,0 +1,83 @@ +======================= +The Triton-C Language +======================= + +In the introduction, we stressed the importance of blocked algorithms and described their core principles in pseudo-code. To facilitate their implementation on modern GPU hardware, we present Triton-C, a single-threaded imperative kernel language in which block variables are first-class citizen. This language may be used either directly by developers familiar with C, or as an intermediate language for existing (and future) transcompilers. In this chapter, we describe its differences with C, its Numpy-like semantics and its "Single-Program, Multiple-Data" (SPMD) programming model. + +------------------- +Differences with C +------------------- + +The syntax of Triton-C is based on that of ANSI C, but was modified and extended to accomodate the semantics and programming model described in the next two subsections. These changes fall into the following categories: + ++++++++++++ +Extensions ++++++++++++ + +**Variable declarations**: Triton adds special-purpose syntax for multi-dimensional array declarations (e.g., :code:`int block[16, 16]`), which purposely differs from that of nested arrays (i.e., arrays of pointers) found in ANSI C (e.g., :code:`int block[16][16]`). Block dimensions must be constant but can also be made parametric with the use of pre-processor macros. One-dimensional blocks of integers may be initialized using ellipses (e.g., :code:`int range[16] = 0 ... 16`). + +**Primitive types**: Triton-C supports the following primitive data-types: :code:`bool`, :code:`uint8`, :code:`uint16`, :code:`uint32`, :code:`uint64`, :code:`int8`, :code:`int16`, :code:`int32`, :code:`int64`, :code:`half`, :code:`float`, :code:`double`. + +**Operators and built-in function**: The usual C operators were extended to support element-wise array operations (:code:`+`, :code:`-`, :code:`&&`, :code:`*`, etc.) and complex array operations(:code:`@` for matrix multiplication). Additionally, some built-in functions were added for concurrency (:code:`get_program_id`, :code:`atomic_add`). + +**Slicing and broadcasting**: Multi-dimensional blocks can be broadcast along any particular dimension using numpy-like slicing syntax (e.g., :code:`int array[8, 8] = range[:, newaxis]` for stacking columns). Note that, as of now, slicing blocks to retrieve sub-blocks (or scalars) is forbidden as it is incompatible with the automatic parallelization methods used by our JIT. Reductions can be achieved using a syntax similar to slicing (e.g., :code:`array[+]` for summing an array, or :code:`array[:, max]` for row-wise maximum). Currently supported reduction operators are :code:`+`, :code:`min`, :code:`max`. + +**Masked pointer dereferencement**: Block-level operations in Triton-C are "atomic", in the sense that they execute either completely or not at all. Basic element-wise control-flow for block-level operations can nonetheless be achieved using ternary operators and the *masked pointer dereferencement* operator exemplified below: + +.. code-block:: C + + // create mask + bool mask[16, 16] = ...; + // conditional addition + float x[16, 16] = mask ? a + b : 0; + // conditional load + float y[16] 16] = mask ? *ptr : 0; + // conditional store + *?(mask)ptr = y; + \end{lstlisting} + + ++++++++++++++ +Restrictions ++++++++++++++ + +The Triton project is still in its infancy. As such, there are quite a few features of ANSI C that are not supported: + +**Non-kernel functions**: Right now, all function definitions must be kernels, i.e. be preceded with the :code:`__global__` attribute. We are aware that this is a severe limitations, and the reason why it exists is because our automatic parallelization engine would not be capable of handling array parameter arguments. + +**Non-primitive types**: Non-primitive types defined with :code:`struct` and :code:`union` are currently not supported, again because it is unclear at this point how these constructs would hook into our block-level data-flow analysis passes. + +**While loops**: We just haven't had time to implement those yet. + +---------------- +Semantics +---------------- + +The existence of built-in **blocked** types, variable and operations in Triton-C offers two main benefits. First, it simplifies the structure of blocked programs by hiding important details pertaining to concurrent programming such as memory coalescing, cache management and specialized tensor instrinsics. Second, it opens the door for compilers to perform these optimizations automatically. However, it also means that programs have some kind of *block-level semantics* that does not exist in C. Though some aspects of it (e.g., the :code:`@` operator) are pretty intuitive, one in particular might be puzzling to some GPU programmers: broadcasting semantics. + ++++++++++++++++++++++++ +Broadcasting Semantics ++++++++++++++++++++++++ + + +Block variables in Triton are strongly typed, meaning that certain instructions statically require their operands to satisfy strict shape constraints. For example, a scalar may not be added to an array unless it is first appropriately broadcast. *Broadcasting semantics* (first introduced in `Numpy `_) provides two formal rules for performing these conversions automatically in the case of binary operators: (1) the shape of the lowest-dimension operand is left-padded with ones until both operands have the same dimensionality; and (2) the content of both operands is replicated as many times as needed until their shape is identical. An error is emitted if this cannot be done. + +.. code-block:: C + + int a[16], b[32, 16], c[16, 1]; + // a is first reshaped to [1, 16] + // and then broadcast to [32, 16] + int x_1[32, 16] = a[newaxis, :] + b; + // Same as above but implicitly + int x_2[32, 16] = a + b; + // a is first reshaped to [1, 16] + // a is broadcast to [16, 16] + // c is broadcast to [16, 16] + int y[16, 16] = a + c; + +------------------ +Programming Model +------------------ + +As discussed in the `CUDA documentation `_, The execution of CUDA code on GPUs is supported by an `SPMD `_ programming model in which each kernel instance is associated with an identifiable *thread-block*, itself decomposed into *warps* of 32 *threads*. The Triton programming model is similar, but each kernel is *single-threaded* -- though automatically parallelized -- and associated with a global :code:`program id` which varies from instance to instance. This approach leads to simpler kernels in which CUDA-like concurrency primitives (shared memory synchronization, inter-thread communication, etc.) do not exist. The global program ids associated with each kernel instance can be queried using the :code:`get_program_id(axis)` built-in function where :code:`0 <= axis <= 2`. This is, for example, useful to create e.g., blocks of pointers as shown in the tutorials. + diff --git a/getting-started/tutorials/01-vector-add.html b/getting-started/tutorials/01-vector-add.html index 69d8da73e..bc05e825a 100644 --- a/getting-started/tutorials/01-vector-add.html +++ b/getting-started/tutorials/01-vector-add.html @@ -362,8 +362,8 @@ for different problem sizes.

benchmark.run(show_plots=True)
 
-vector-add-performance -

Total running time of the script: ( 0 minutes 7.756 seconds)

+01 vector add +

Total running time of the script: ( 0 minutes 9.497 seconds)

-softmax-performance +02 fused softmax

In the above plot, we can see that:

    @@ -405,7 +405,7 @@ This means that – when temporary data is too large to fit entirely in the GPU Note that our Triton kernel is not only faster than PyTorch’s CUDA kernel, it is also easier to read, understand and maintain.

-

Total running time of the script: ( 0 minutes 19.933 seconds)

+

Total running time of the script: ( 0 minutes 25.654 seconds)

+
+ +
+ +
+

+ © Copyright 2020, Philippe Tillet. + +

+
+ + + + Built with Sphinx using a + + theme + + provided by Read the Docs. + +
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/programming-guide/related-work.html b/programming-guide/related-work.html new file mode 100644 index 000000000..6472bc5bb --- /dev/null +++ b/programming-guide/related-work.html @@ -0,0 +1,425 @@ + + + + + + + + + + Related Work — Triton documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + + +
+ +
+
+ +
+ +
+

+ © Copyright 2020, Philippe Tillet. + +

+
+ + + + Built with Sphinx using a + + theme + + provided by Read the Docs. + +
+
+
+ +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/programming-guide/triton-c.html b/programming-guide/triton-c.html new file mode 100644 index 000000000..1efd4e578 --- /dev/null +++ b/programming-guide/triton-c.html @@ -0,0 +1,271 @@ + + + + + + + + + + The Triton-C Language — Triton documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ +
+

The Triton-C Language

+

In the introduction, we stressed the importance of blocked algorithms and described their core principles in pseudo-code. To facilitate their implementation on modern GPU hardware, we present Triton-C, a single-threaded imperative kernel language in which block variables are first-class citizen. This language may be used either directly by developers familiar with C, or as an intermediate language for existing (and future) transcompilers. In this chapter, we describe its differences with C, its Numpy-like semantics and its “Single-Program, Multiple-Data” (SPMD) programming model.

+
+

Differences with C

+

The syntax of Triton-C is based on that of ANSI C, but was modified and extended to accomodate the semantics and programming model described in the next two subsections. These changes fall into the following categories:

+
+

Extensions

+

Variable declarations: Triton adds special-purpose syntax for multi-dimensional array declarations (e.g., int block[16, 16]), which purposely differs from that of nested arrays (i.e., arrays of pointers) found in ANSI C (e.g., int block[16][16]). Block dimensions must be constant but can also be made parametric with the use of pre-processor macros. One-dimensional blocks of integers may be initialized using ellipses (e.g., int range[16] = 0 ... 16).

+

Primitive types: Triton-C supports the following primitive data-types: bool, uint8, uint16, uint32, uint64, int8, int16, int32, int64, half, float, double.

+

Operators and built-in function: The usual C operators were extended to support element-wise array operations (+, -, &&, *, etc.) and complex array operations(@ for matrix multiplication). Additionally, some built-in functions were added for concurrency (get_program_id, atomic_add).

+

Slicing and broadcasting: Multi-dimensional blocks can be broadcast along any particular dimension using numpy-like slicing syntax (e.g., int array[8, 8] = range[:, newaxis] for stacking columns). Note that, as of now, slicing blocks to retrieve sub-blocks (or scalars) is forbidden as it is incompatible with the automatic parallelization methods used by our JIT. Reductions can be achieved using a syntax similar to slicing (e.g., array[+] for summing an array, or array[:, max] for row-wise maximum). Currently supported reduction operators are +, min, max.

+

Masked pointer dereferencement: Block-level operations in Triton-C are “atomic”, in the sense that they execute either completely or not at all. Basic element-wise control-flow for block-level operations can nonetheless be achieved using ternary operators and the masked pointer dereferencement operator exemplified below:

+
// create mask
+bool mask[16, 16] = ...;
+// conditional addition
+float x[16, 16] = mask ? a + b : 0;
+// conditional load
+float y[16] 16] = mask ? *ptr : 0;
+// conditional store
+*?(mask)ptr = y;
+\end{lstlisting}
+
+
+
+
+

Restrictions

+

The Triton project is still in its infancy. As such, there are quite a few features of ANSI C that are not supported:

+

Non-kernel functions: Right now, all function definitions must be kernels, i.e. be preceded with the __global__ attribute. We are aware that this is a severe limitations, and the reason why it exists is because our automatic parallelization engine would not be capable of handling array parameter arguments.

+

Non-primitive types: Non-primitive types defined with struct and union are currently not supported, again because it is unclear at this point how these constructs would hook into our block-level data-flow analysis passes.

+

While loops: We just haven’t had time to implement those yet.

+
+
+
+

Semantics

+

The existence of built-in blocked types, variable and operations in Triton-C offers two main benefits. First, it simplifies the structure of blocked programs by hiding important details pertaining to concurrent programming such as memory coalescing, cache management and specialized tensor instrinsics. Second, it opens the door for compilers to perform these optimizations automatically. However, it also means that programs have some kind of block-level semantics that does not exist in C. Though some aspects of it (e.g., the @ operator) are pretty intuitive, one in particular might be puzzling to some GPU programmers: broadcasting semantics.

+
+

Broadcasting Semantics

+

Block variables in Triton are strongly typed, meaning that certain instructions statically require their operands to satisfy strict shape constraints. For example, a scalar may not be added to an array unless it is first appropriately broadcast. Broadcasting semantics (first introduced in Numpy) provides two formal rules for performing these conversions automatically in the case of binary operators: (1) the shape of the lowest-dimension operand is left-padded with ones until both operands have the same dimensionality; and (2) the content of both operands is replicated as many times as needed until their shape is identical. An error is emitted if this cannot be done.

+
int a[16], b[32, 16], c[16, 1];
+// a is first reshaped to [1, 16]
+// and then broadcast to [32, 16]
+int x_1[32, 16] = a[newaxis, :] + b;
+// Same as above but implicitly
+int x_2[32, 16] = a + b;
+// a is first reshaped to [1, 16]
+// a is broadcast to [16, 16]
+// c is broadcast to [16, 16]
+int y[16, 16] = a + c;
+
+
+
+
+
+

Programming Model

+

As discussed in the CUDA documentation, The execution of CUDA code on GPUs is supported by an SPMD programming model in which each kernel instance is associated with an identifiable thread-block, itself decomposed into warps of 32 threads. The Triton programming model is similar, but each kernel is single-threaded – though automatically parallelized – and associated with a global program id which varies from instance to instance. This approach leads to simpler kernels in which CUDA-like concurrency primitives (shared memory synchronization, inter-thread communication, etc.) do not exist. The global program ids associated with each kernel instance can be queried using the get_program_id(axis) built-in function where 0 <= axis <= 2. This is, for example, useful to create e.g., blocks of pointers as shown in the tutorials.

+
+
+ + +
+ +
+
+ +
+ +
+

+ © Copyright 2020, Philippe Tillet. + +

+
+ + + + Built with Sphinx using a + + theme + + provided by Read the Docs. + +
+
+
+ +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js index 574642880..1e786c829 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["getting-started/installation","getting-started/tutorials/01-vector-add","getting-started/tutorials/02-fused-softmax","getting-started/tutorials/03-matrix-multiplication","getting-started/tutorials/index","getting-started/tutorials/sg_execution_times","index","programming-guide/chapter-1/introduction","programming-guide/chapter-2/related-work","programming-guide/chapter-3/triton-c","programming-guide/chapter-4/triton-ir"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["getting-started/installation.rst","getting-started/tutorials/01-vector-add.rst","getting-started/tutorials/02-fused-softmax.rst","getting-started/tutorials/03-matrix-multiplication.rst","getting-started/tutorials/index.rst","getting-started/tutorials/sg_execution_times.rst","index.rst","programming-guide/chapter-1/introduction.rst","programming-guide/chapter-2/related-work.rst","programming-guide/chapter-3/triton-c.rst","programming-guide/chapter-4/triton-ir.rst"],objects:{},objnames:{},objtypes:{},terms:{"0000":3,"1024":1,"10mn":2,"1250":3,"128":3,"182":3,"1823":2,"184":3,"185":3,"186":3,"188":3,"190":[3,5],"191":3,"192":3,"193":3,"194":3,"195":3,"196":3,"198":3,"1983":7,"1984":8,"1989":8,"199":3,"1991":[7,8],"1999":[8,10],"200":3,"2001":10,"2004":8,"2006":8,"2012":8,"2013":[7,10],"2014":7,"2016":[7,8],"2017":7,"2018":[7,8],"2019":[1,8],"202":3,"2021":[7,8],"2048":2,"2141":1,"220":3,"245":3,"2500":3,"256":[2,3],"2mn":2,"3076":1,"3713":1,"3750":3,"3mn":2,"4096":2,"4940":1,"5000":3,"502":[3,5],"512":3,"6250":3,"6724":1,"7500":3,"756":[1,5],"768":3,"781":2,"7mn":2,"8750":3,"896":3,"933":[2,5],"9733":1,"98432":1,"abstract":[7,8,10],"break":8,"byte":2,"case":[2,3,7,8,9,10],"class":[1,2,3,7,8,9],"export":3,"final":10,"float":[1,2,3,7,8,9],"function":[1,2,8,9],"import":[1,2,3,7,8,9],"int":[1,2,3,7,8,9],"return":[1,2,3,10],"short":3,"static":[7,8,9,10],"super":3,"switch":3,"true":[1,2,3],"typeof":3,"var":8,"void":[1,2,3],"while":[0,7,9],For:[1,3,7,8,9,10],One:[3,9],SMs:8,T_S:8,The:[1,2,6,7,8],These:[3,8,9,10],Used:[1,2,3],__expf:2,__global__:[1,2,3,9],_add:1,_align8:3,_dot:3,_softmax:2,_src:[1,2],a100:[3,8],abl:[3,8],about:[1,2,3,6],abov:[1,2,3,8,9],abs:1,absolut:3,academ:7,acc:[3,7,8],acceler:7,access:[1,7,8,10],accomod:[3,9],accordingli:8,account:[3,8],accumul:8,accuraci:7,achiev:[1,7,8,9],across:[7,8],activ:3,actual:[3,7,8],add:[1,5,9,10],added:[9,10],addit:[2,3,4,5,7,9,10],addition:[8,9],address:[2,7],adequ:10,adopt:8,advanc:7,advantag:1,advoc:8,affect:3,affin:8,after:[3,10],again:9,against:[1,2,3,6,10],aggreg:10,aggress:[2,7,8,10],agnost:[7,8],ahead:8,aim:6,algebra:8,algorithm:[3,7,8,9,10],alia:8,alias:10,align8:3,align:10,all:[2,3,4,7,8,9,10],allclos:[2,3],allen1984:8,allen:8,alloc:[1,7],allow:[1,2,7,8,10],almost:2,along:[1,9,10],also:[1,2,3,7,8,9,10],alwai:8,amd:7,amen:8,amount:[2,7],ampl:8,analysi:[7,8,9],analyz:8,ancourt1991:8,ancourt:8,ani:[2,3,8,9],anoth:[2,8,10],ansi:9,anywai:10,apart:8,api:[0,1],appli:[1,2,3,7,8],applic:[8,10],approach:[7,8,9],appropri:9,approxim:2,architectur:[3,7],area:8,arg:[1,2,3],argument:[1,2,3,9,10],arithmet:10,around:2,arrai:[1,8,9,10],arrang:3,art:[7,8],arxiv:[7,8],ask:2,aspect:[8,9],asplo:7,assembl:3,assert:[1,2,3],assign:10,associ:9,assum:2,ast:10,asynchron:7,atol:3,atom:[9,10],atomic_add:9,attribut:[1,9,10],auguin1983:7,auguin:7,auto:[2,8,10],autograd:[1,2],autom:7,automat:[2,3,7,8,9],autotun:[3,8],autotune_config:3,autotune_kei:3,autotune_v:3,avail:[3,7,8],awar:[7,9],axi:[1,2,3,9],back:[1,2,3],backend:10,backward:1,baghdadi2021:[7,8],baghdadi:[7,8],balanc:8,bandwidth:2,base:[7,8,9,10],basic:[1,3,4,8,9],becaus:[2,9],becom:7,been:[7,8],befor:[3,10],begin:8,behavior:8,being:10,believ:8,below:[1,4,8,9,10],bench:0,benchmark:0,benefit:[2,7,8,9,10],best:[1,3,7],better:[3,10],between:[1,7],bin:3,binari:9,bit:[2,10],block:[1,2,3,7,8,9],block_siz:8,blockidx:1,bodi:10,boil:8,bool:[1,2,9],both:[8,9],bound:[1,2,8],branch:[8,10],braun13:10,braun:10,broad:7,broadcast:10,build:[0,3],built:[1,3,8,9],c_0:3,c_1:3,c_2:3,cach:[1,2,7,8,9,10],call:[3,8,10],callabl:1,can:[0,1,2,3,7,8,9,10],cannot:[3,7,8,9],capabl:[2,6,7,9],carri:10,carter99:10,carter:10,cast:3,categori:9,cdiv:[1,3],ceil:1,center:10,certain:9,cfg:10,cgo:[7,8],chang:[3,9],chapter:[6,9,10],characterist:8,cheap:7,check:[1,2,6],chen2018:7,chen:7,chip:2,choic:6,chunk:1,cite:8,citizen:[1,9],click:[1,2,3],clone:[0,3],close:[8,10],cmake:[0,3],cmp:10,coalesc:[7,9],code:[1,2,3,4,7,8,9,10],codegen:0,coher:10,col:8,column:[2,3,9],com:[0,3,8],combin:7,come:[1,2,3,8],command:[0,3],comment:1,common:8,commonli:8,commun:9,compar:[2,3,6,8],compil:[0,1,2,3,6,7,9,10],complet:[8,9],complex:[8,9,10],compos:[7,10],composit:8,comprehens:[7,8],comput:[6,7,8],computation:[7,8],concern:8,concis:1,concurr:9,cond:[1,10],condit:[1,8,9,10],config:3,connectom:7,consecut:8,consequ:7,consid:2,consist:[2,10],constant:[9,10],constraint:[1,2,8,9],construct:[3,7,9,10],constructor:3,contain:[8,10],content:9,context:1,contextu:8,contigu:[1,3],contrari:1,control:[1,7,8,9],convers:9,convolut:7,coordin:1,copi:[1,7],core:[3,7,8,9],correct:1,correspond:[1,2,3,10],cost:8,could:[2,3,8,10],cours:[1,7],creat:[1,3,7,9,10],crucial:10,csv:1,ctx:[1,2,3],cubla:[3,7],cuda:[1,2,3,7,9],cudnn:7,current:[3,9],custom:[1,2,3,6],cutlass_include_dir:3,cutlass_library_dir:3,cutlass_library_kernel:3,cutlass_matmul:3,cutlass_tensorop_f16_s16816gemm_:3,cutlass_tensorop_f16_s884gemm_f16_:3,cvpr:7,dart:8,darte1999:8,data:[1,2,3,7,8,9,10],data_ptr:[1,2,3],dataflow:8,dblock:1,dcutlass_library_kernel:3,dcutlass_nvcc_archs_en:3,decad:7,declar:[1,9,10],decompos:[8,9],decor:1,decreas:3,deep:[3,7,8],def:[1,2,3],defin:[1,2,3,8,9,10],definit:[8,9,10],denom:2,denomin:2,dens:8,depend:8,deploi:7,dereferenc:[1,9],describ:[8,9,10],design:8,desir:[3,10],detail:[1,8,9],detect:7,develop:[7,8,9],devic:[1,2,3],dfg:10,dialect:8,dict:[1,2,3],diesel:8,differ:[1,2,3,7,8],difficult:8,difficulti:[3,7],dijkstra82:8,dim:8,dimens:[3,9,10],dimension:[3,8,9,10],dir:0,direct:0,directli:[0,9,10],discuss:9,disjoint:8,disk:1,dissert:8,distribut:8,diverg:10,divis:1,dnn:[6,7,8],do_bench:[1,2,3],document:[9,10],doe:[1,2,8,9],doesn:8,doing:[7,10],domain:[7,8],don:2,done:[0,3,7,9,10],door:9,dot:[3,10],doubl:9,doubli:3,doubt:8,down:8,download:[0,1,2,3,4],dram:2,driver:0,dsl:[6,7,8,10],dtype:[1,2,3],dure:3,each:[1,2,3,7,8,9,10],eas:8,easi:[1,3],easier:[1,2,7],education:2,effect:8,effici:[3,7,10],effort:8,egg:3,either:[9,10],elango2018:8,elango:8,element:[1,2,9,10],element_s:2,elementwis:2,ellips:9,emerg:7,emit:9,empti:[3,10],empty_lik:[1,2],enabl:8,encod:8,end:[7,8,9,10],enforc:8,engin:[8,9],ensur:8,entir:[2,8],environ:[3,6,10],equal:8,error:9,especi:7,etc:[3,9],euromicro:7,even:8,eventu:10,evidenc:7,evolv:7,exampl:[1,2,3,4,7,8,9,10],execut:[1,5,7,8,9,10],exemplifi:9,exist:[1,7,8,9],exp:2,expect:[1,2],expens:[7,8],expert:3,explor:7,exponenti:2,expos:[3,10],express:[7,8],extend:[3,9,10],extens:[1,10],extrem:8,f32_infin:2,facilit:[7,8,9],fact:[3,8],fairli:3,fall:[3,9],false_valu:10,familiar:9,far:2,fast:[2,7,8],faster:[2,3],fastest:8,featur:9,feel:3,fetch:7,few:[1,8,9],field:7,figur:8,file:[1,2,3,5],find:3,first:[1,6,8,9],fit:2,flexibl:7,float16:3,float32:[1,2,3],flow:[1,7,8,9],focu:[3,8],follow:[0,2,3,6,7,8,9,10],forbidden:9,forc:3,form:10,formal:[8,9],format:8,former:10,forward:[1,2,3,10],found:[0,9,10],foundat:8,fp16:3,framework:[7,8],free:3,from:[1,2,3,7,8,9,10],full:[1,2,3,10],fulli:8,func:8,fundament:8,further:8,fuse:[3,4,5],fusion:[2,8],futur:[3,9,10],galleri:[1,2,3,4],gbp:[1,2],gener:[1,2,3,4,7,8,10],geq:8,get:[1,2,3,5],get_program_id:[1,2,3,9],getelementptr:10,girbal2006:8,girbal:8,git:[0,3],github:[0,3],give:7,given:[2,3],global:[8,9,10],good:[1,3,8],gpgpu:7,gpu:[2,6,7,8,9,10],grammat:8,graph:10,graphic:7,greater:2,grid:[1,2,3],grid_m:3,grid_n:3,grosser2012:8,grosser:8,group:3,group_id:3,group_siz:3,grow:8,guard:[2,10],guess:2,guid:7,had:9,half:[3,9],halid:[7,8],hand:8,handl:[2,3,8,9,10],handwritten:[3,7],happen:3,hard:3,harder:8,hardwar:[3,6,8,9],has:[1,2,7,8],have:[2,7,8,9],haven:9,header:10,heavi:7,helper:2,henc:[3,10],here:[0,1,2,3],heurist:2,hide:9,hierarch:7,hierarchi:8,high:[3,7,8,10],higher:10,highest:10,highli:[3,7],highlight:[1,8],hint:[8,10],hit:3,hook:9,how:[1,2,3,6,7,9],howev:[3,8,9,10],http:[0,3],i32:10,idea:7,ident:[2,9],identifi:9,ids:9,idx:10,imag:[7,8],imper:[6,9],implement:[1,2,3,7,8,9,10],implicitli:[3,9,10],importantli:8,impos:8,improv:3,includ:[3,10],incompat:[3,8,9],increas:1,incred:7,increment:8,inde:8,independ:[8,10],index:2,indic:[2,8,10],individu:10,induc:8,industri:7,inequ:8,infanc:9,inform:8,infrastructur:8,initi:[3,9],inlin:10,inner:3,input:[1,2,3,8,10],instal:6,instanc:[2,3,7,9,10],instead:[1,2,3],instrins:9,instruct:[6,7,9],int16:9,int32:[3,9],int64:[3,9],int8:9,integ:[8,9,10],integr:0,inter:9,interchang:8,interdepend:10,interest:[0,3,7,8],intermedi:[0,6,8,9],intern:[0,2,8],interpret:10,intra:10,intrins:8,introduc:[3,9,10],introduct:[6,9],intuit:9,invari:8,ipynb:[1,2,3],irregular:[2,8],is_contigu:3,issu:[7,8],iter:[3,7,8],its:[2,8,9,10],itself:[9,10],jit:[9,10],journal:8,jrk2013:7,jupyt:[1,2,3,4],just:[1,2,3,8,9],kei:[1,2,3,7],kellei:7,kernel:[6,7,9],kick:3,kind:9,kitwar:3,known:[8,10],label:[1,2,3],lam1991:7,lam:7,lambda:[1,2,3],languag:[1,6,7],larg:[2,7,8],larger:2,later:8,latest:0,lattner2004:8,lattner2019:8,lattner:8,launch:[1,2,3],law:8,layer:[7,8],lda:3,ldb:3,ldc:3,lead:[7,8,9],learn:[1,2,3,6,7,8],least:8,lee2017:7,lee:7,left:[8,9],legal:8,less:[2,7,8],let:2,letter:8,level:[3,7,8,9],lib:3,librari:[3,7,8],lies:7,lifelong:8,like:[1,7,8,9],limit:[2,9],line:[1,2,3,8,10],linear:[7,8],linkag:10,linker:10,linux:3,list:[3,10],literatur:10,litteratur:8,live:3,llvm:[0,8,10],load:[1,2,8,9,10],local:[7,8],locat:3,logarithm:1,longer:2,look:[2,6,7],loop:[3,8,9,10],lot:10,low:8,lowest:9,lstlist:9,machin:[7,8],machineri:[7,8],macro:[1,9],made:[7,9],mai:[0,1,8,9,10],main:[3,7,8,9],maintain:[1,2,8],major:[3,8],make:[0,1,2,3,7,8,10],make_add_kernel:1,make_kernel:[2,3],manag:[7,9],mani:[1,7,8,9,10],manual:[2,8],manual_se:[1,2],mapl:[1,8],markedli:7,mask:9,masked_load:10,masked_stor:10,match:3,mathbb:8,mathbf:8,mathcal:8,mathemat:8,matmul:[3,8],matric:[2,3],matrix:[2,4,5,7,8,9,10],matrix_s:8,matter:[1,3,7,8],max:[1,2,9],max_group_s:3,max_m:[1,2,3],maxim:[6,8],maximum:[1,9],mean:[2,3,8,9,10],mechan:[2,8],memori:[1,2,3,7,8,9,10],mention:[2,3],merg:10,metadata:10,method:[1,8,9],methodolog:8,micro:[7,10],might:9,min:[2,3,9],min_m:[1,2,3],minut:[0,1,2,3],miscellan:10,miss:8,mitig:8,mixtur:3,mkdir:[0,3],mlir:8,model:[1,7,8],modern:[3,6,7,8,9],modifi:[1,3,9],modular:8,moor:8,more:[1,2,6,7,8,10],most:[3,8],move:2,much:10,mullapudi2016:8,mullapudi:8,multi:[3,7,8,9,10],multipl:[1,4,5,7,8,9,10],multipli:8,must:[2,3,9,10],naiv:[2,3],naive_softmax:2,name:[1,2,3,10],nativ:1,natur:[2,7],necessari:[2,10],need:[1,2,3,9,10],nelement:2,nest:[3,8,9],net:8,network:[7,8],neural:[7,8],neurosci:7,newaxi:[3,9],next:[2,3,9,10],next_power_of_2:2,nightli:0,nip:7,non:[7,9,10],none:[2,10],nonetheless:9,normal:2,note:[0,1,2,3,8,9,10],notebook:[1,2,3,4],notic:8,notori:[3,7],novel:7,now:[1,2,3,9],num:2,num_warp:[2,3],number:[1,2,8,10],numer:[2,7],numpi:9,nvidia:[3,7,10],object:[1,3,7],obvious:2,occur:8,offer:[7,9],offici:0,offset:[1,3],often:3,omega:8,onc:[2,7,8,10],one:[2,4,7,8,9,10],ones:[9,10],onli:[1,2,3,7,8,10],open:9,opencl:7,oper:[1,2,3,4,7,9,10],operand:[3,9],opportun:7,ops:1,opsila:7,opt:[1,2,3],optim:[7,8,9,10],order:[3,4,8],origin:8,osdi:7,other:[1,3,6,8,10],our:[1,2,3,7,9,10],out:[1,2,3,6,8,10],outlin:[8,10],outperform:[2,3],output:[1,2,3],over:[7,8],overach:1,pact:[8,10],pad:[2,9,10],paper:1,paradigm:[7,8],parallel:[1,2,3,6,7,8,9],paralleliz:7,paramet:[1,3,8,9,10],parametr:[7,9,10],parenthes:3,pars:10,parser:0,part:[3,8],partial:[2,10],particular:9,particularli:[7,8,10],partit:7,pass:[1,3,8,9],past:[1,7,8],path:[1,3,10],pattern:7,peak:8,per:2,perf:3,perf_report:[1,2,3],perform:[1,2,7,8,9,10],pertain:9,phase:8,philosophi:8,pid:[1,3],pid_m:3,pid_n:3,piec:3,pip:[0,3],pipelin:[7,8],platform:[6,8],pldi:7,plot:[0,1,2,3],plot_nam:[1,2,3],pmatrix:8,point:[8,9],pointer:[1,9],polli:8,polyhedr:7,polyhedra:8,popular:8,portabl:[1,7,8],pose:7,possibl:[1,2,3,8],potenti:10,power:[2,8],ppopp:8,practic:[1,2,3,7],pragma:7,pre:[0,1,7,9],preced:9,predic:[2,10],predict:[2,8],prefer:[1,2],premis:7,prepar:10,preprocessor:10,present:9,preserv:[8,10],pressur:3,pretti:[1,3,9],prevent:8,previou:[2,10],primer:8,primit:[1,7,9],principl:[8,9],print:[1,2,3],probabl:[3,8],problem:1,problemat:[8,10],procedur:8,process:[1,3,7,8],processor:[1,7,9],product:[3,6,8],program:[1,2,3,7],program_id:3,program_id_m:3,program_id_n:3,programm:[7,8,9],project:[7,9],prologu:3,promot:[3,8],properli:2,properti:8,propos:7,proprietari:3,provid:[1,2,3,6,8,9,10],pseudo:[3,9],pssa:10,ptillet:[0,3],ptr:[1,9],publicli:3,purpos:[3,7,8,9,10],push:8,put:3,putat:8,puzzl:9,pytest:0,python:[1,2,3,4],pytorch:[1,2],qquad:8,queri:9,quit:[2,9],ragan:7,rand:[1,3],randn:[2,3],rang:[1,2,3,7,8,9],rapidli:[7,8],rate:3,rather:[3,7],raw:[1,10],rdom:8,read:[2,3,4],reader:8,readi:3,readonli:10,real:7,reason:[3,8,9],reblock:10,recent:[3,7,10],recommend:4,recomput:7,rectifi:7,redmon2016:7,redmon:7,reduc:10,reduct:[2,3,9,10],refer:1,regist:3,regrett:7,regular:8,rel:[1,8],relat:6,releas:[0,3,7],reli:8,remain:7,remateri:3,reorder:8,replic:[3,9,10],repres:8,represent:[0,6],requir:[2,8,9],research:[7,8],reshap:[9,10],resolut:8,resolv:10,resourc:7,resp:8,respect:8,restrict:8,result:[0,1,2,7,8,10],ret:2,retriev:[1,8,9],reus:3,revisit:7,right:[8,9],rise:8,role:10,roughli:3,round:2,row:[2,3,9],rtol:3,rule:9,run:[0,1,2,3,6,8],runtim:[0,8],rvar:8,said:8,same:[7,9,10],satisfi:9,sato2019:8,sato:8,save:[1,2,3],save_path:1,scalabl:8,scalar:[7,9,10],scan:8,schedul:7,scienc:8,scop:8,scope:8,script:[1,2,3],second:[1,2,3,8,9],section:[3,8],see:[1,2,3,8],seem:[1,8],select:[7,10],semant:[8,10],semi:8,sens:[1,7,8,9],separ:8,sequenc:[7,10],serial:10,set:[1,3,8,10],sever:[7,8,9],shall:8,shape:[1,2,3,8,9,10],share:[2,7,9,10],shortcut:1,should:[1,3,7,8],show:3,show_plot:[1,2,3],shown:[1,8,9,10],side:8,sight:8,signal:7,signifi:10,significantli:2,sigplan:8,simd:7,similar:[1,2,9,10],simpl:[1,2,10],simpler:[9,10],simplest:4,simpli:[3,8],simplifi:[9,10],sinc:[3,10],singl:[1,7,9,10],size:[1,3,8,10],slice:9,slower:[7,8],slowest:8,smaller:2,smallest:2,snemi3d:7,softmax:[4,5],solid:8,solut:3,solv:[8,10],some:[3,9],sometim:8,sourc:[1,2,3,4,8],space:[7,8],spars:[7,8],spatial:8,speak:3,spec:2,special:[7,9,10],specif:[3,7],specifi:[3,8,10],speed:2,sphinx:[1,2,3,4],split:8,spmd:[1,7,8,9],src:3,ssa:10,stabil:2,stack:9,standard:[1,8],start:4,started_tutori:5,state:[7,8],statement:8,staticmethod:[1,2,3],step:8,still:[8,9],store:[1,2,9],stoutchinin01:10,stoutchinin:10,straight:10,straightforward:3,strategi:8,strength:7,stress:9,strict:9,stride:[2,3],stride_a_0:3,stride_b_0:3,stride_c_0:3,stride_xm:2,stride_ym:2,string:[1,3],strongli:9,struct:9,structur:[7,8,9],sub:9,subdirectori:3,subscript:8,subsect:9,substanti:7,successfulli:8,suffer:8,suit:7,suitabl:10,sum:[1,2,9],superhuman:7,support:[0,8,9,10],sure:[1,2],surprisingli:7,surround:8,sutskev:7,sutskever2014:7,swizzl:7,symbol:10,synchron:[7,9],syntax:[1,2,9,10],system:[3,7,8],taco:8,take:[0,1,3,6],taken:8,tar:3,target:7,techniqu:[7,8],tempor:8,temporari:2,tend:8,tension:7,tensor:[1,3,7,8,9],tensorrt:7,termin:10,ternari:[1,9],test:0,text:8,tflop:3,than:[2,3,7,8],thei:[1,3,7,8,9,10],them:1,themselv:3,theoret:2,therebi:8,therefor:[3,10],theta:8,theta_:8,thi:[0,1,2,3,7,8,9,10],thing:1,think:2,those:[0,1,9],though:[2,7,8,9],thread:[7,9],three:1,through:[3,4,8,10],throughout:8,throughput:6,tile:[2,3,8],time:[1,2,3,7,8,9,10],tiramisu:[7,8],tmp:[0,3],tog:8,togeth:3,too:2,tool:3,topic:8,total:[1,2,3,5],tradit:[7,8,10],transcompil:9,transfer:2,transform:[1,8,10],travers:8,tree:10,trend:7,trick:2,trigger:3,triton:[0,1,2,3,4,7,8],trivial:7,true_addr:10,true_valu:10,ts1:10,tsn:10,tune:[2,8],tuner:[3,10],tupl:1,tutori:[0,1,2,3,6,9],tutorials_jupyt:4,tutorials_python:4,tvm:[7,8],twice:2,two:[1,2,3,8,9],type:[1,3,9],typic:[3,8],uint16:9,uint32:9,uint64:9,uint8:9,unclear:9,uncommon:8,underneath:8,understand:2,unfortun:[3,8],unifi:7,uninstal:3,union:9,unit:[0,7,10],univers:8,unless:9,unlik:3,unnecessari:10,unrol:8,until:9,updat:[3,8],usag:[0,2],use:[0,1,2,3,7,8,9,10],used:[1,3,9,10],useful:[9,10],uses:[3,10],using:[1,3,7,8,9,10],usual:[9,10],util:1,v100:[3,8],val_fals:1,val_tru:1,valid:1,valu:[1,2,3,10],valuabl:2,vari:9,variabl:[3,9,10],variant:7,variou:4,vasilach:[7,8],vasilache2018:[7,8],vast:8,vec:8,vector:[2,4,5,7,8,10],vendor:3,veri:[2,8],verif:8,verifi:[2,8],version:[3,10],via:8,violat:10,visibl:[8,10],vision:7,wai:[2,3,10],want:[0,1,2,3],warp:[2,9,10],wast:2,well:[7,8],were:[9,10],wget:3,what:1,when:[1,2,3,7,8,10],where:[2,3,8,9,10],whether:[1,7],which:[1,2,3,7,8,9],whose:[1,2,3,8,10],why:9,wide:8,width:3,wise:[1,2,9,10],wish:[3,8],within:10,without:[1,8],wolf:8,wolfe1989:8,won:2,word:[1,8],work:[2,6,7],workload:3,wors:[7,8],would:[2,9,10],wouldn:8,wrapper:3,write:[1,2,3,4,6,8],written:3,wrote:2,x86_64:3,x_1:9,x_2:9,x_log:1,x_max:2,x_name:[1,2,3],x_val:[1,2,3],xii:8,xzvf:3,y_line:[1,2,3],y_name:[1,2,3],y_ref:2,y_tri:2,y_val:[1,2,3],year:8,yet:[7,8,9],yii:8,ylabel:[1,2,3],you:[0,1,2,3,4,7],your:[0,6],yourself:[2,3],zero:3,zip:4},titles:["Installation","Vector Addition","Fused Softmax","Matrix Multiplication","Tutorials","Computation times","Welcome to Triton\u2019s documentation!","Introduction","Related Work","The Triton-C Language","The Triton-IR Intermediate Representation"],titleterms:{"final":3,"function":[3,10],The:[3,9,10],addit:1,advantag:8,analysi:10,arithmet:3,auto:3,autograd:3,basic:10,benchmark:[1,2,3],binari:0,bind:[1,2,3],block:10,broadcast:9,cach:3,challeng:7,compil:8,comput:[1,2,3,5],control:10,cutlass:3,dataflow:10,differ:9,distribut:0,document:6,extens:9,flow:10,from:0,fuse:2,get:6,guid:6,instal:[0,3],instruct:10,intermedi:10,introduct:7,kernel:[1,2,3],languag:[8,9],level:10,limit:8,matrix:3,model:9,modul:10,motiv:[2,3,7],multipl:3,optim:3,packag:0,perform:3,pointer:3,polyhedr:8,program:[6,8,9,10],python:0,refer:[7,8,10],relat:8,represent:[8,10],restrict:9,result:3,schedul:8,semant:9,softmax:2,sourc:0,squar:3,start:6,structur:10,test:[1,2,3],time:5,torch:[1,2,3],triton:[6,9,10],tune:3,tutori:4,type:10,unit:[1,2,3],vector:1,welcom:6,work:8}}) \ No newline at end of file +Search.setIndex({docnames:["getting-started/installation","getting-started/tutorials/01-vector-add","getting-started/tutorials/02-fused-softmax","getting-started/tutorials/03-matrix-multiplication","getting-started/tutorials/index","getting-started/tutorials/sg_execution_times","index","programming-guide/chapter-1/introduction","programming-guide/chapter-2/related-work","programming-guide/chapter-3/triton-c","programming-guide/chapter-4/triton-ir","programming-guide/introduction","programming-guide/related-work","programming-guide/triton-c"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["getting-started/installation.rst","getting-started/tutorials/01-vector-add.rst","getting-started/tutorials/02-fused-softmax.rst","getting-started/tutorials/03-matrix-multiplication.rst","getting-started/tutorials/index.rst","getting-started/tutorials/sg_execution_times.rst","index.rst","programming-guide/chapter-1/introduction.rst","programming-guide/chapter-2/related-work.rst","programming-guide/chapter-3/triton-c.rst","programming-guide/chapter-4/triton-ir.rst","programming-guide/introduction.rst","programming-guide/related-work.rst","programming-guide/triton-c.rst"],objects:{},objnames:{},objtypes:{},terms:{"000":5,"0000":3,"1024":1,"10mn":2,"1250":3,"128":3,"182":3,"1823":2,"184":3,"185":3,"186":3,"188":3,"190":3,"191":3,"192":3,"193":3,"194":3,"195":3,"196":3,"198":3,"1983":[7,11],"1984":[8,12],"1989":[8,12],"199":3,"1991":[7,8,11,12],"1999":[8,10,12],"200":3,"2001":10,"2004":8,"2006":[8,12],"2012":[8,12],"2013":[7,10,11],"2014":[7,11],"2016":[7,8,11,12],"2017":[7,11],"2018":[7,8,11,12],"2019":[1,8,12],"202":3,"2021":[7,8,11,12],"2048":2,"2141":1,"220":3,"245":3,"2500":3,"256":[2,3],"2mn":2,"3076":1,"3713":1,"3750":3,"3mn":2,"4096":2,"4940":1,"497":1,"5000":3,"512":3,"6250":3,"654":[2,5],"6724":1,"7500":3,"768":3,"781":2,"7mn":2,"861":3,"8750":3,"896":3,"9733":1,"98432":1,"abstract":[7,8,10,11,12],"break":[8,12],"byte":2,"case":[2,3,7,8,9,10,11,12,13],"class":[1,2,3,7,8,9,11,12,13],"export":3,"final":10,"float":[1,2,3,7,8,9,11,12,13],"function":[1,2,8,9,12,13],"import":[1,2,3,7,8,9,11,12,13],"int":[1,2,3,7,8,9,11,12,13],"return":[1,2,3,10],"short":3,"static":[7,8,9,10,11,12,13],"super":3,"switch":3,"true":[1,2,3],"typeof":3,"var":[8,12],"void":[1,2,3],"while":[0,7,9,11,13],For:[1,3,7,8,9,10,11,12,13],One:[3,9,13],SMs:[8,12],T_S:[8,12],The:[1,2,6,7,8,11,12],These:[3,8,9,10,12,13],Used:[1,2,3],__expf:2,__global__:[1,2,3,9,13],_add:1,_align8:3,_dot:3,_softmax:2,_src:[1,2],a100:[3,8,12],abl:[3,8,12],about:[1,2,3,6],abov:[1,2,3,8,9,12,13],abs:1,absolut:3,academ:[7,11],acc:[3,7,8,11,12],acceler:[7,11],access:[1,7,8,10,11,12],accomod:[3,9,13],accordingli:[8,12],account:[3,8,12],accumul:[8,12],accuraci:[7,11],achiev:[1,7,8,9,11,12,13],across:[7,8,11,12],activ:3,actual:[3,7,8,11,12],add:[1,5,9,10,13],added:[9,10,13],addit:[2,3,4,5,7,9,10,11,13],addition:[8,9,12,13],address:[2,7,11],adequ:10,adopt:[8,12],advanc:[7,11],advantag:1,advoc:[8,12],affect:3,affin:[8,12],after:[3,10],again:[9,13],against:[1,2,3,6,10],aggreg:10,aggress:[2,7,8,10,11,12],agnost:[7,8,11,12],ahead:[8,12],aim:6,algebra:[8,12],algorithm:[3,7,8,9,10,11,12,13],alia:[8,12],alias:10,align8:3,align:10,all:[2,3,4,7,8,9,10,11,12,13],allclos:[2,3],allen1984:8,allen:[8,12],alloc:[1,7,11],allow:[1,2,7,8,10,11,12],almost:2,along:[1,9,10,13],also:[1,2,3,7,8,9,10,11,12,13],alwai:[8,12],amd:[7,11],amen:[8,12],amount:[2,7,11],ampl:[8,12],analysi:[7,8,9,11,12,13],analyz:[8,12],ancourt1991:8,ancourt:[8,12],ani:[2,3,8,9,12,13],anoth:[2,8,10,12],ansi:[9,13],anywai:10,apart:[8,12],api:[0,1],appli:[1,2,3,7,8,11,12],applic:[8,10,12],approach:[7,8,9,11,12,13],appropri:[9,13],approxim:2,architectur:[3,7,11],area:[8,12],arg:[1,2,3],argument:[1,2,3,9,10,13],arithmet:10,around:2,arrai:[1,8,9,10,12,13],arrang:3,art:[7,8,11,12],arxiv:[7,8,11,12],ask:2,aspect:[8,9,12,13],asplo:[7,11],assembl:3,assert:[1,2,3],assign:10,associ:[9,13],assum:2,ast:10,asynchron:[7,11],atol:3,atom:[9,10,13],atomic_add:[9,13],attribut:[1,9,10,13],auguin1983:7,auguin:[7,11],auto:[2,8,10,12],autograd:[1,2],autom:[7,11],automat:[2,3,7,8,9,11,12,13],autotun:[3,8,12],autotune_config:3,autotune_kei:3,avail:[3,7,8,11,12],awar:[7,9,11,13],axi:[1,2,3,9,13],back:[1,2,3],backend:10,backward:1,baghdadi2021:[7,8],baghdadi:[7,8,11,12],balanc:[8,12],bandwidth:2,base:[7,8,9,10,11,12,13],basic:[1,3,4,8,9,12,13],becaus:[2,9,13],becom:[7,11],been:[7,8,11,12],befor:[3,10],begin:[8,12],behavior:[8,12],being:10,believ:[8,12],below:[1,4,8,9,10,12,13],bench:0,benchmark:0,benefit:[2,7,8,9,10,11,12,13],best:[1,3,7,11],better:[3,10],between:[1,7,11],bin:3,binari:[9,13],bit:[2,10],block:[1,2,3,7,8,9,11,12,13],block_siz:[8,12],blockidx:1,bodi:10,boil:[8,12],bool:[1,2,9,13],both:[8,9,12,13],bound:[1,2,8,12],branch:[8,10,12],braun13:10,braun:10,broad:[7,11],broadcast:10,build:[0,3],built:[1,3,8,9,12,13],c_0:3,c_1:3,c_2:3,cach:[1,2,7,8,9,10,11,12,13],call:[3,8,10,12],callabl:1,can:[0,1,2,3,7,8,9,10,11,12,13],cannot:[3,7,8,9,11,12,13],capabl:[2,6,7,9,11,13],carri:10,carter99:10,carter:10,cast:3,categori:[9,13],cdiv:[1,3],ceil:1,center:10,certain:[9,13],cfg:10,cgo:[7,8,11,12],chang:[3,9,13],chapter:[6,9,10,13],characterist:[8,12],cheap:[7,11],check:[1,2,6],chen2018:7,chen:[7,11],chip:2,choic:6,chunk:1,cite:[8,12],citizen:[1,9,13],click:[1,2,3],clone:[0,3],close:[8,10,12],cmake:[0,3],cmp:10,coalesc:[7,9,11,13],code:[1,2,3,4,7,8,9,10,11,12,13],codegen:0,coher:10,col:[8,12],column:[2,3,9,13],com:[0,3,8,12],combin:[7,11],come:[1,2,3,8,12],command:[0,3],comment:1,common:[8,12],commonli:[8,12],commun:[9,13],compar:[2,3,6,8,12],compil:[0,1,2,3,6,7,9,10,11,13],complet:[8,9,12,13],complex:[8,9,10,12,13],compos:[7,10,11],composit:[8,12],comprehens:[7,8,11,12],comput:[6,7,8,11,12],computation:[7,8,11,12],concern:[8,12],concis:1,concurr:[9,13],cond:[1,10],condit:[1,8,9,10,12,13],config:3,connectom:[7,11],consecut:[8,12],consequ:[7,11],consid:2,consist:[2,10],constant:[9,10,13],constraint:[1,2,8,9,12,13],construct:[3,7,9,10,11,13],constructor:3,contain:[8,10,12],content:[9,13],context:1,contextu:[8,12],contigu:[1,3],contrari:1,control:[1,7,8,9,11,12,13],convers:[9,13],convolut:[7,11],coordin:1,copi:[1,7,11],core:[3,7,8,9,11,12,13],correct:1,correspond:[1,2,3,10],cost:[8,12],could:[2,3,8,10,12],cours:[1,7,11],creat:[1,3,7,9,10,11,13],crucial:10,csv:1,ctx:[1,2,3],cubla:[3,7,11],cuda:[1,2,3,7,9,11,13],cudnn:[7,11],current:[3,9,13],custom:[1,2,3,6],cutlass_include_dir:3,cutlass_library_dir:3,cutlass_library_kernel:3,cutlass_matmul:3,cutlass_tensorop_f16_s16816gemm_:3,cutlass_tensorop_f16_s884gemm_f16_:3,cvpr:[7,11],dart:[8,12],darte1999:8,data:[1,2,3,7,8,9,10,11,12,13],data_ptr:[1,2,3],dataflow:[8,12],dblock:1,dcutlass_library_kernel:3,dcutlass_nvcc_archs_en:3,decad:[7,11],declar:[1,9,10,13],decompos:[8,9,12,13],decor:1,decreas:3,deep:[3,7,8,11,12],def:[1,2,3],defin:[1,2,3,8,9,10,12,13],definit:[8,9,10,12,13],denom:2,denomin:2,dens:[8,12],depend:[8,12],deploi:[7,11],dereferenc:[1,9,13],describ:[8,9,10,12,13],design:[8,12],desir:[3,10],detail:[1,8,9,12,13],detect:[7,11],develop:[7,8,9,11,12,13],devic:[1,2,3],dfg:10,dialect:[8,12],dict:[1,2,3],diesel:[8,12],differ:[1,2,3,7,8,11,12],difficult:[8,12],difficulti:[3,7,11],dijkstra82:[8,12],dim:[8,12],dimens:[3,9,10,13],dimension:[3,8,9,10,12,13],dir:0,direct:0,directli:[0,9,10,13],discuss:[9,13],disjoint:[8,12],disk:1,dissert:[8,12],distribut:[8,12],diverg:10,divis:1,dnn:[6,7,8,11,12],do_bench:[1,2,3],document:[9,10,13],doe:[1,2,8,9,12,13],doesn:[8,12],doing:[7,10,11],domain:[7,8,11,12],don:2,done:[0,3,7,9,10,11,13],door:[9,13],dot:[3,10],doubl:[9,13],doubli:3,doubt:[8,12],down:[8,12],download:[0,1,2,3,4],dram:2,driver:0,dsl:[6,7,8,10,11,12],dtype:[1,2,3],dure:3,each:[1,2,3,7,8,9,10,11,12,13],eas:[8,12],easi:[1,3],easier:[1,2,7,11],education:2,effect:[8,12],effici:[3,7,10,11],effort:[8,12],egg:3,either:[9,10,13],elango2018:8,elango:[8,12],element:[1,2,9,10,13],element_s:2,elementwis:2,ellips:[9,13],emerg:[7,11],emit:[9,13],empti:[3,10],empty_lik:[1,2],enabl:[8,12],encod:[8,12],end:[7,8,9,10,11,12,13],enforc:[8,12],engin:[8,9,12,13],ensur:[8,12],entir:[2,8,12],environ:[3,6,10],equal:[8,12],error:[9,13],especi:[7,11],etc:[3,9,13],euromicro:[7,11],even:[8,12],eventu:10,evidenc:[7,11],evolv:[7,11],exampl:[1,2,3,4,7,8,9,10,11,12,13],execut:[1,5,7,8,9,10,11,12,13],exemplifi:[9,13],exist:[1,7,8,9,11,12,13],exp:2,expect:[1,2],expens:[7,8,11,12],expert:3,explor:[7,11],exponenti:2,expos:[3,10],express:[7,8,11,12],extend:[3,9,10,13],extens:[1,10],extrem:[8,12],f32_infin:2,facilit:[7,8,9,11,12,13],fact:[3,8,12],fairli:3,fall:[3,9,13],false_valu:10,familiar:[9,13],far:2,fast:[2,7,8,11,12],faster:[2,3],fastest:[8,12],featur:[9,13],feel:3,fetch:[7,11],few:[1,8,9,12,13],field:[7,11],figur:[8,12],file:[1,2,3,5],find:3,first:[1,6,8,9,12,13],fit:2,flexibl:[7,11],float16:3,float32:[1,2,3],flow:[1,7,8,9,11,12,13],focu:[3,8,12],follow:[0,2,3,6,7,8,9,10,11,12,13],forbidden:[9,13],forc:3,form:10,formal:[8,9,12,13],format:[8,12],former:10,forward:[1,2,3,10],found:[0,9,10,13],foundat:[8,12],fp16:3,framework:[7,8,11,12],free:3,from:[1,2,3,7,8,9,10,11,12,13],full:[1,2,3,10],fulli:[8,12],func:[8,12],fundament:[8,12],further:[8,12],fuse:[3,4,5],fusion:[2,8,12],futur:[3,9,10,13],galleri:[1,2,3,4],gbp:[1,2],gener:[1,2,3,4,7,8,10,11,12],geq:[8,12],get:[1,2,3,5],get_program_id:[1,2,3,9,13],getelementptr:10,girbal2006:8,girbal:[8,12],git:[0,3],github:[0,3],give:[7,11],given:[2,3],global:[8,9,10,12,13],good:[1,3,8,12],gpgpu:[7,11],gpu:[2,6,7,8,9,10,11,12,13],grammat:[8,12],graph:10,graphic:[7,11],greater:2,grid:[1,2,3],grid_m:3,grid_n:3,grosser2012:8,grosser:[8,12],group:3,group_id:3,group_siz:3,grow:[8,12],guard:[2,10],guess:2,guid:[7,11],had:[9,13],half:[3,9,13],halid:[7,8,11,12],hand:[8,12],handl:[2,3,8,9,10,12,13],handwritten:[3,7,11],happen:3,hard:3,harder:[8,12],hardwar:[3,6,8,9,12,13],has:[1,2,7,8,11,12],have:[2,7,8,9,11,12,13],haven:[9,13],header:10,heavi:[7,11],helper:2,henc:[3,10],here:[0,1,2,3],heurist:2,hide:[9,13],hierarch:[7,11],hierarchi:[8,12],high:[3,7,8,10,11,12],higher:10,highest:10,highli:[3,7,11],highlight:[1,8,12],hint:[8,10,12],hit:3,hook:[9,13],how:[1,2,3,6,7,9,11,13],howev:[3,8,9,10,12,13],http:[0,3],i32:10,idea:[7,11],ident:[2,9,13],identifi:[9,13],ids:[9,13],idx:10,imag:[7,8,11,12],imper:[6,9,13],implement:[1,2,3,7,8,9,10,11,12,13],implicitli:[3,9,10,13],importantli:[8,12],impos:[8,12],improv:3,includ:[3,10],incompat:[3,8,9,12,13],increas:1,incred:[7,11],increment:[8,12],inde:[8,12],independ:[8,10,12],index:2,indic:[2,8,10,12],individu:10,induc:[8,12],industri:[7,11],inequ:[8,12],infanc:[9,13],inform:[8,12],infrastructur:[8,12],initi:[3,9,13],inlin:10,inner:3,input:[1,2,3,8,10,12],instal:6,instanc:[2,3,7,9,10,11,13],instead:[1,2,3],instrins:[9,13],instruct:[6,7,9,11,13],int16:[9,13],int32:[3,9,13],int64:[3,9,13],int8:[9,13],integ:[8,9,10,12,13],integr:0,inter:[9,13],interchang:[8,12],interdepend:10,interest:[0,3,7,8,11,12],intermedi:[0,6,8,9,12,13],intern:[0,2,8,12],interpret:10,intra:10,intrins:[8,12],introduc:[3,9,10,13],introduct:[6,9,13],intuit:[9,13],invari:[8,12],ipynb:[1,2,3],irregular:[2,8,12],is_contigu:3,issu:[7,8,11,12],iter:[3,7,8,11,12],its:[2,8,9,10,12,13],itself:[9,10,13],jit:[9,10,13],journal:[8,12],jrk2013:7,jupyt:[1,2,3,4],just:[1,2,3,8,9,12,13],kei:[1,2,3,7,11],kellei:[7,11],kernel:[6,7,9,11,13],kick:3,kind:[9,13],kitwar:3,known:[8,10,12],label:[1,2,3],lam1991:7,lam:[7,11],lambda:[1,2,3],languag:[1,6,7,11],larg:[2,7,8,11,12],larger:2,later:[8,12],latest:0,lattner2004:8,lattner2019:8,lattner:[8,12],launch:[1,2,3],law:[8,12],layer:[7,8,11,12],lda:3,ldb:3,ldc:3,lead:[7,8,9,11,12,13],learn:[1,2,3,6,7,8,11,12],least:[8,12],lee2017:7,lee:[7,11],left:[8,9,12,13],legal:[8,12],less:[2,7,8,11,12],let:2,letter:[8,12],level:[3,7,8,9,11,12,13],lib:3,librari:[3,7,8,11,12],lies:[7,11],lifelong:[8,12],like:[1,7,8,9,11,12,13],limit:[2,9,13],line:[1,2,3,8,10,12],linear:[7,8,11,12],linkag:10,linker:10,linux:3,list:[3,10],literatur:10,litteratur:[8,12],live:3,llvm:[0,8,10,12],load:[1,2,8,9,10,12,13],local:[7,8,11,12],locat:3,logarithm:1,longer:2,look:[2,6,7,11],loop:[3,8,9,10,12,13],lot:10,low:[8,12],lowest:[9,13],lstlist:[9,13],machin:[7,8,11,12],machineri:[7,8,11,12],macro:[1,9,13],made:[7,9,11,13],mai:[0,1,8,9,10,12,13],main:[3,7,8,9,11,12,13],maintain:[1,2,8,12],major:[3,8,12],make:[0,1,2,3,7,8,10,11,12],make_add_kernel:1,make_kernel:[2,3],manag:[7,9,11,13],mani:[1,7,8,9,10,11,12,13],manual:[2,8,12],manual_se:[1,2],mapl:[1,8,12],markedli:[7,11],mask:[9,13],masked_load:10,masked_stor:10,match:3,mathbb:[8,12],mathbf:[8,12],mathcal:[8,12],mathemat:[8,12],matmul:[3,8,12],matric:[2,3],matrix:[2,4,5,7,8,9,10,11,12,13],matrix_s:[8,12],matter:[1,3,7,8,11,12],max:[1,2,9,13],max_group_s:3,max_m:[1,2,3],maxim:[6,8,12],maximum:[1,9,13],mean:[2,3,8,9,10,12,13],mechan:[2,8,12],memori:[1,2,3,7,8,9,10,11,12,13],mention:[2,3],merg:10,metadata:10,method:[1,8,9,12,13],methodolog:[8,12],micro:[7,10,11],might:[9,13],min:[2,3,9,13],min_m:[1,2,3],minut:[0,1,2,3],miscellan:10,miss:[8,12],mitig:[8,12],mixtur:3,mkdir:[0,3],mlir:[8,12],model:[1,7,8,11,12],modern:[3,6,7,8,9,11,12,13],modifi:[1,3,9,13],modular:[8,12],moor:[8,12],more:[1,2,6,7,8,10,11,12],most:[3,8,12],move:2,much:10,mullapudi2016:8,mullapudi:[8,12],multi:[3,7,8,9,10,11,12,13],multipl:[1,4,5,7,8,9,10,11,12,13],multipli:[8,12],must:[2,3,9,10,13],naiv:[2,3],naive_softmax:2,name:[1,2,3,10],nativ:1,natur:[2,7,11],necessari:[2,10],need:[1,2,3,9,10,13],nelement:2,nest:[3,8,9,12,13],net:[8,12],network:[7,8,11,12],neural:[7,8,11,12],neurosci:[7,11],newaxi:[3,9,13],next:[2,3,9,10,13],next_power_of_2:2,nightli:0,nip:[7,11],non:[7,9,10,11,13],none:[2,10],nonetheless:[9,13],normal:2,note:[0,1,2,3,8,9,10,12,13],notebook:[1,2,3,4],notic:[8,12],notori:[3,7,11],novel:[7,11],now:[1,2,3,9,13],num:2,num_warp:[2,3],number:[1,2,8,10,12],numer:[2,7,11],numpi:[9,13],nvidia:[3,7,10,11],object:[1,3,7,11],obvious:2,occur:[8,12],offer:[7,9,11,13],offici:0,offset:[1,3],often:3,omega:[8,12],onc:[2,7,8,10,11,12],one:[2,4,7,8,9,10,11,12,13],ones:[9,10,13],onli:[1,2,3,7,8,10,11,12],open:[9,13],opencl:[7,11],oper:[1,2,3,4,7,9,10,11,13],operand:[3,9,13],opportun:[7,11],ops:1,opsila:[7,11],opt:[1,2,3],optim:[7,8,9,10,11,12,13],order:[3,4,8,12],origin:[8,12],osdi:[7,11],other:[1,3,6,8,10,12],our:[1,2,3,7,9,10,11,13],out:[1,2,3,6,8,10,12],outlin:[8,10,12],outperform:[2,3],output:[1,2,3],over:[7,8,11,12],overach:1,pact:[8,10,12],pad:[2,9,10,13],paper:1,paradigm:[7,8,11,12],parallel:[1,2,3,6,7,8,9,11,12,13],paralleliz:[7,11],paramet:[1,3,8,9,10,12,13],parametr:[7,9,10,11,13],parenthes:3,pars:10,parser:0,part:[3,8,12],partial:[2,10],particular:[9,13],particularli:[7,8,10,11,12],partit:[7,11],pass:[1,3,8,9,12,13],past:[1,7,8,11,12],path:[1,3,10],pattern:[7,11],peak:[8,12],per:2,perf:3,perf_report:[1,2,3],perform:[1,2,7,8,9,10,11,12,13],pertain:[9,13],phase:[8,12],philosophi:[8,12],pid:[1,3],pid_m:3,pid_n:3,piec:3,pip:[0,3],pipelin:[7,8,11,12],platform:[6,8,12],pldi:[7,11],plot:[0,1,2,3],plot_nam:[1,2,3],pmatrix:[8,12],point:[8,9,12,13],pointer:[1,9,13],polli:[8,12],polyhedr:[7,11],polyhedra:[8,12],popular:[8,12],portabl:[1,7,8,11,12],pose:[7,11],possibl:[1,2,3,8,12],potenti:10,power:[2,8,12],ppopp:[8,12],practic:[1,2,3,7,11],pragma:[7,11],pre:[0,1,7,9,11,13],preced:[9,13],predic:[2,10],predict:[2,8,12],prefer:[1,2],premis:[7,11],prepar:10,preprocessor:10,present:[9,13],preserv:[8,10,12],pressur:3,pretti:[1,3,9,13],prevent:[8,12],previou:[2,10],primer:[8,12],primit:[1,7,9,11,13],principl:[8,9,12,13],print:[1,2,3],probabl:[3,8,12],problem:1,problemat:[8,10,12],procedur:[8,12],process:[1,3,7,8,11,12],processor:[1,7,9,11,13],product:[3,6,8,12],program:[1,2,3,7,11],program_id:3,program_id_m:3,program_id_n:3,programm:[7,8,9,11,12,13],project:[7,9,11,13],prologu:3,promot:[3,8,12],properli:2,properti:[8,12],propos:[7,11],proprietari:3,provid:[1,2,3,6,8,9,10,12,13],pseudo:[3,9,13],pssa:10,ptillet:[0,3],ptr:[1,9,13],publicli:3,purpos:[3,7,8,9,10,11,12,13],push:[8,12],put:3,putat:[8,12],puzzl:[9,13],pytest:0,python:[1,2,3,4],pytorch:[1,2],qquad:[8,12],queri:[9,13],quit:[2,9,13],ragan:[7,11],rand:[1,3],randn:[2,3],rang:[1,2,3,7,8,9,11,12,13],rapidli:[7,8,11,12],rate:3,rather:[3,7,11],raw:[1,10],rdom:[8,12],read:[2,3,4],reader:[8,12],readi:3,readonli:10,real:[7,11],reason:[3,8,9,12,13],reblock:10,recent:[3,7,10,11],recommend:4,recomput:[7,11],rectifi:[7,11],redmon2016:7,redmon:[7,11],reduc:10,reduct:[2,3,9,10,13],refer:1,regist:3,regrett:[7,11],regular:[8,12],rel:[1,8,12],relat:6,releas:[0,3,7,11],reli:[8,12],remain:[7,11],remateri:3,reorder:[8,12],replic:[3,9,10,13],repres:[8,12],represent:[0,6],requir:[2,8,9,12,13],research:[7,8,11,12],reshap:[9,10,13],resolut:[8,12],resolv:10,resourc:[7,11],resp:[8,12],respect:[8,12],restrict:[8,12],result:[0,1,2,7,8,10,11,12],ret:2,retriev:[1,8,9,12,13],reus:3,revisit:[7,11],right:[8,9,12,13],rise:[8,12],role:10,roughli:3,round:2,row:[2,3,9,13],rtol:3,rule:[9,13],run:[0,1,2,3,6,8,12],runtim:[0,8,12],rvar:[8,12],said:[8,12],same:[7,9,10,11,13],satisfi:[9,13],sato2019:8,sato:[8,12],save:[1,2,3],save_path:1,scalabl:[8,12],scalar:[7,9,10,11,13],scan:[8,12],schedul:[7,11],scienc:[8,12],scop:[8,12],scope:[8,12],script:[1,2,3],second:[1,2,3,8,9,12,13],section:[3,8,12],see:[1,2,3,8,12],seem:[1,8,12],select:[7,10,11],semant:[8,10,12],semi:[8,12],sens:[1,7,8,9,11,12,13],separ:[8,12],sequenc:[7,10,11],serial:10,set:[1,3,8,10,12],sever:[7,8,9,11,12,13],shall:[8,12],shape:[1,2,3,8,9,10,12,13],share:[2,7,9,10,11,13],shortcut:1,should:[1,3,7,8,11,12],show:3,show_plot:[1,2,3],shown:[1,8,9,10,12,13],side:[8,12],sight:[8,12],signal:[7,11],signifi:10,significantli:2,sigplan:[8,12],simd:[7,11],similar:[1,2,9,10,13],simpl:[1,2,10],simpler:[9,10,13],simplest:4,simpli:[3,8,12],simplifi:[9,10,13],sinc:[3,10],singl:[1,7,9,10,11,13],size:[1,3,8,10,12],slice:[9,13],slower:[7,8,11,12],slowest:[8,12],smaller:2,smallest:2,snemi3d:[7,11],softmax:[4,5],solid:[8,12],solut:3,solv:[8,10,12],some:[3,9,13],sometim:[8,12],sourc:[1,2,3,4,8,12],space:[7,8,11,12],spars:[7,8,11,12],spatial:[8,12],speak:3,spec:2,special:[7,9,10,11,13],specif:[3,7,11],specifi:[3,8,10,12],speed:2,sphinx:[1,2,3,4],split:[8,12],spmd:[1,7,8,9,11,12,13],src:3,ssa:10,stabil:2,stack:[9,13],standard:[1,8,12],start:4,started_tutori:5,state:[7,8,11,12],statement:[8,12],staticmethod:[1,2,3],step:[8,12],still:[8,9,12,13],store:[1,2,9,13],stoutchinin01:10,stoutchinin:10,straight:10,straightforward:3,strategi:[8,12],strength:[7,11],stress:[9,13],strict:[9,13],stride:[2,3],stride_a_0:3,stride_b_0:3,stride_c_0:3,stride_xm:2,stride_ym:2,string:[1,3],strongli:[9,13],struct:[9,13],structur:[7,8,9,11,12,13],sub:[9,13],subdirectori:3,subscript:[8,12],subsect:[9,13],substanti:[7,11],successfulli:[8,12],suffer:[8,12],suit:[7,11],suitabl:10,sum:[1,2,9,13],superhuman:[7,11],support:[0,8,9,10,12,13],sure:[1,2],surprisingli:[7,11],surround:[8,12],sutskev:[7,11],sutskever2014:7,swizzl:[7,11],symbol:10,synchron:[7,9,11,13],syntax:[1,2,9,10,13],system:[3,7,8,11,12],taco:[8,12],take:[0,1,3,6],taken:[8,12],tar:3,target:[7,11],techniqu:[7,8,11,12],tempor:[8,12],temporari:2,tend:[8,12],tension:[7,11],tensor:[1,3,7,8,9,11,12,13],tensorrt:[7,11],termin:10,ternari:[1,9,13],test:0,text:[8,12],tflop:3,than:[2,3,7,8,11,12],thei:[1,3,7,8,9,10,11,12,13],them:1,themselv:3,theoret:2,therebi:[8,12],therefor:[3,10],theta:[8,12],theta_:[8,12],thi:[0,1,2,3,7,8,9,10,11,12,13],thing:1,think:2,those:[0,1,9,13],though:[2,7,8,9,11,12,13],thread:[7,9,11,13],three:1,through:[3,4,8,10,12],throughout:[8,12],throughput:6,tile:[2,3,8,12],time:[1,2,3,7,8,9,10,11,12,13],tiramisu:[7,8,11,12],tmp:[0,3],tog:[8,12],togeth:3,too:2,tool:3,topic:[8,12],total:[1,2,3,5],tradit:[7,8,10,11,12],transcompil:[9,13],transfer:2,transform:[1,8,10,12],travers:[8,12],tree:10,trend:[7,11],trick:2,trigger:3,triton:[0,1,2,3,4,7,8,11,12],trivial:[7,11],true_addr:10,true_valu:10,ts1:10,tsn:10,tune:[2,8,12],tuner:[3,10],tupl:1,tutori:[0,1,2,3,6,9,13],tutorials_jupyt:4,tutorials_python:4,tvm:[7,8,11,12],twice:2,two:[1,2,3,8,9,12,13],type:[1,3,9,13],typic:[3,8,12],uint16:[9,13],uint32:[9,13],uint64:[9,13],uint8:[9,13],unclear:[9,13],uncommon:[8,12],underneath:[8,12],understand:2,unfortun:[3,8,12],unifi:[7,11],uninstal:3,union:[9,13],unit:[0,7,10,11],univers:[8,12],unless:[9,13],unlik:3,unnecessari:10,unrol:[8,12],until:[9,13],updat:[3,8,12],usag:[0,2],use:[0,1,2,3,7,8,9,10,11,12,13],used:[1,3,9,10,13],useful:[9,10,13],uses:[3,10],using:[1,3,7,8,9,10,11,12,13],usual:[9,10,13],util:1,v100:[3,8,12],val_fals:1,val_tru:1,valid:1,valu:[1,2,3,10],valuabl:2,vari:[9,13],variabl:[3,9,10,13],variant:[7,11],variou:4,vasilach:[7,8,11,12],vasilache2018:[7,8],vast:[8,12],vec:[8,12],vector:[2,4,5,7,8,10,11,12],vendor:3,veri:[2,8,12],verif:[8,12],verifi:[2,8,12],version:[3,10],via:[8,12],violat:10,visibl:[8,10,12],vision:[7,11],wai:[2,3,10],want:[0,1,2,3],warp:[2,9,10,13],wast:2,well:[7,8,11,12],were:[9,10,13],wget:3,what:1,when:[1,2,3,7,8,10,11,12],where:[2,3,8,9,10,12,13],whether:[1,7,11],which:[1,2,3,7,8,9,11,12,13],whose:[1,2,3,8,10,12],why:[9,13],wide:[8,12],width:3,wise:[1,2,9,10,13],wish:[3,8,12],within:10,without:[1,8,12],wolf:[8,12],wolfe1989:8,won:2,word:[1,8,12],work:[2,6,7,11],workload:3,wors:[7,8,11,12],would:[2,9,10,13],wouldn:[8,12],wrapper:3,write:[1,2,3,4,6,8,12],written:3,wrote:2,x86_64:3,x_1:[9,13],x_2:[9,13],x_log:1,x_max:2,x_name:[1,2,3],x_val:[1,2,3],xii:[8,12],xzvf:3,y_line:[1,2,3],y_name:[1,2,3],y_ref:2,y_tri:2,y_val:[1,2,3],year:[8,12],yet:[7,8,9,11,12,13],yii:[8,12],ylabel:[1,2,3],you:[0,1,2,3,4,7,11],your:[0,6],yourself:[2,3],zero:3,zip:4},titles:["Installation","Vector Addition","Fused Softmax","Matrix Multiplication","Tutorials","Computation times","Welcome to Triton\u2019s documentation!","Introduction","Related Work","The Triton-C Language","The Triton-IR Intermediate Representation","Introduction","Related Work","The Triton-C Language"],titleterms:{"final":3,"function":[3,10],The:[3,9,10,13],addit:1,advantag:[8,12],analysi:10,arithmet:3,auto:3,autograd:3,basic:10,benchmark:[1,2,3],binari:0,bind:[1,2,3],block:10,broadcast:[9,13],cach:3,challeng:[7,11],compil:[8,12],comput:[1,2,3,5],control:10,cutlass:3,dataflow:10,differ:[9,13],distribut:0,document:6,extens:[9,13],flow:10,from:0,fuse:2,get:6,guid:6,instal:[0,3],instruct:10,intermedi:10,introduct:[7,11],kernel:[1,2,3],languag:[8,9,12,13],level:10,limit:[8,12],matrix:3,model:[9,13],modul:10,motiv:[2,3,7,11],multipl:3,optim:3,packag:0,perform:3,pointer:3,polyhedr:[8,12],program:[6,8,9,10,12,13],python:0,refer:[7,8,10,11,12],relat:[8,12],represent:[8,10,12],restrict:[9,13],result:3,schedul:[8,12],semant:[9,13],softmax:2,sourc:0,squar:3,start:6,structur:10,test:[1,2,3],time:5,torch:[1,2,3],triton:[6,9,10,13],tune:3,tutori:4,type:10,unit:[1,2,3],vector:1,welcom:6,work:[8,12]}}) \ No newline at end of file