[GH-PAGES] Updated website
@@ -58,7 +58,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import triton\n\n\n@triton.jit\ndef _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):\n # row index\n m = triton.program_id(0)\n # col indices\n n = triton.arange(0, meta['BLOCK'])\n # the memory address of all the elements\n # that we want to load can be computed as follows\n X = X + m * stride_xm + n\n x = triton.load(X, mask=n < N, other=-float('inf'))\n # Substract maximum for numerical stability\n z = x - triton.max(x, axis=0)\n # Note that exponentials in Triton are fast\n # but approximate (i.e., think __expf in CUDA)\n num = triton.exp(z)\n denom = triton.sum(num, axis=0)\n y = num / denom\n # Write back to Y\n Y = Y + m * stride_ym + n\n triton.store(Y, y, mask=n < N)"
|
"import triton\nimport triton.language as tl\n\n\n@triton.jit\ndef _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):\n # row index\n m = tl.program_id(0)\n # col indices\n n = tl.arange(0, meta['BLOCK'])\n # the memory address of all the elements\n # that we want to load can be computed as follows\n X = X + m * stride_xm + n\n x = tl.load(X, mask=n < N, other=-float('inf'))\n # Substract maximum for numerical stability\n z = x - tl.max(x, axis=0)\n # Note that exponentials in Triton are fast\n # but approximate (i.e., think __expf in CUDA)\n num = tl.exp(z)\n denom = tl.sum(num, axis=0)\n y = num / denom\n # Write back to Y\n Y = Y + m * stride_ym + n\n tl.store(Y, y, mask=n < N)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['N'], # argument names to use as an x-axis for the plot\n x_vals=[256 * i for i in range(2, 50)], # 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', 'naive'], # possible keys for `y_name`\n y_lines=[\"Torch\", \"Triton\", 'Naive'], # label name for the lines\n ylabel=\"GB/s\", # label name for the y-axis\n plot_name=\"softmax-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={'M': 4096} # values for function arguments not in `x_names` and `y_name`\n )\n)\ndef benchmark(M, N, provider):\n x = torch.randn(M, N, device='cuda', dtype=torch.float32)\n if provider == 'torch':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.softmax(x, axis=-1))\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: softmax(x))\n if provider == 'naive':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: naive_softmax(x))\n gbps = lambda ms: 2 * x.nelement() * x.element_size() * 1e-9 / (ms * 1e-3)\n return gbps(ms), gbps(max_ms), gbps(min_ms)\n\n\nbenchmark.run(show_plots=True)"
|
"@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['N'], # argument names to use as an x-axis for the plot\n x_vals=[256 * i for i in range(2, 50)], # different possible values for `x_name`\n line_arg='provider', # argument name whose value corresponds to a different line in the plot\n line_vals=['torch', 'triton', 'naive'], # possible values for `line_arg``\n line_names=[\"Torch\", \"Triton\", 'Naive'], # label name for the lines\n ylabel=\"GB/s\", # label name for the y-axis\n plot_name=\"softmax-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={'M': 4096} # values for function arguments not in `x_names` and `y_name`\n )\n)\ndef benchmark(M, N, provider):\n x = torch.randn(M, N, device='cuda', dtype=torch.float32)\n if provider == 'torch':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: torch.softmax(x, axis=-1))\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: softmax(x))\n if provider == 'naive':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: naive_softmax(x))\n gbps = lambda ms: 2 * x.nelement() * x.element_size() * 1e-9 / (ms * 1e-3)\n return gbps(ms), gbps(max_ms), gbps(min_ms)\n\n\nbenchmark.run(show_plots=True)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -13,6 +13,7 @@ In this tutorial, you will write a simple vector addition using Triton and learn
|
|||||||
# --------------------------
|
# --------------------------
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
import triton.language as tl
|
||||||
import triton
|
import triton
|
||||||
|
|
||||||
|
|
||||||
@@ -24,19 +25,19 @@ def _add(
|
|||||||
N, # Size of the vector
|
N, # Size of the vector
|
||||||
**meta # Optional meta-parameters for the kernel
|
**meta # Optional meta-parameters for the kernel
|
||||||
):
|
):
|
||||||
pid = triton.program_id(0)
|
pid = tl.program_id(0)
|
||||||
# Create an offset for the blocks of pointers to be
|
# Create an offset for the blocks of pointers to be
|
||||||
# processed by this program instance
|
# processed by this program instance
|
||||||
offsets = pid * meta['BLOCK'] + triton.arange(0, meta['BLOCK'])
|
offsets = pid * meta['BLOCK'] + tl.arange(0, meta['BLOCK'])
|
||||||
# Create a mask to guard memory operations against
|
# Create a mask to guard memory operations against
|
||||||
# out-of-bounds accesses
|
# out-of-bounds accesses
|
||||||
mask = offsets < N
|
mask = offsets < N
|
||||||
# Load x
|
# Load x
|
||||||
x = triton.load(X + offsets, mask=mask)
|
x = tl.load(X + offsets, mask=mask)
|
||||||
y = triton.load(Y + offsets, mask=mask)
|
y = tl.load(Y + offsets, mask=mask)
|
||||||
# Write back x + y
|
# Write back x + y
|
||||||
z = x + y
|
z = x + y
|
||||||
triton.store(Z + offsets, z)
|
tl.store(Z + offsets, z)
|
||||||
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
@@ -89,9 +90,9 @@ print(f'The maximum difference between torch and triton is ' f'{torch.max(torch.
|
|||||||
x_names=['size'], # argument names to use as an x-axis for the plot
|
x_names=['size'], # argument names to use as an x-axis for the plot
|
||||||
x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`
|
x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`
|
||||||
x_log=True, # x axis is logarithmic
|
x_log=True, # x axis is logarithmic
|
||||||
y_name='provider', # argument name whose value corresponds to a different line in the plot
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['torch', 'triton'], # possible keys for `y_name`
|
line_vals=['torch', 'triton'], # possible values for `line_arg`
|
||||||
y_lines=["Torch", "Triton"], # label name for the lines
|
line_names=["Torch", "Triton"], # label name for the lines
|
||||||
ylabel="GB/s", # label name for the y-axis
|
ylabel="GB/s", # label name for the y-axis
|
||||||
plot_name="vector-add-performance", # name for the plot. Used also as a file name for saving the plot.
|
plot_name="vector-add-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={} # values for function arguments not in `x_names` and `y_name`
|
args={} # values for function arguments not in `x_names` and `y_name`
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import torch\nimport triton\n\n# %\n# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:\n# - A list of :code:`triton.Config` objects that define different configurations of meta-parameters (e.g., BLOCK_M) and compilation options (e.g., num_warps) to try\n# - A autotuning *key* whose change in values will trigger evaluation of all the provided configs\n\n\n@triton.jit\ndef sigmoid(x):\n ret_true = 1 / (1 + triton.exp(-x))\n ret_false = triton.exp(x) / (1 + triton.exp(x))\n return triton.where(x >= 0, ret_true, ret_false)\n\n\n@triton.jit\ndef swish(x):\n return x * sigmoid(x)\n\n\n@triton.autotune(\n configs=[\n triton.Config({'BLOCK_M': 128, 'BLOCK_N': 128, 'BLOCK_K': 32, 'GROUP_M': 8}, num_warps=4),\n triton.Config({'BLOCK_M': 64, 'BLOCK_N': 128, 'BLOCK_K': 32, 'GROUP_M': 8}, num_warps=4),\n ],\n key=['M', 'N', 'K'],\n)\n# %\n# We can now define our kernel as normal, using all the techniques presented above\n@triton.jit\ndef _matmul(A, B, C, M, N, K, stride_am, stride_ak, stride_bk, stride_bn, stride_cm, stride_cn, **META):\n # extract meta-parameters\n BLOCK_M = META['BLOCK_M']\n BLOCK_N = META['BLOCK_N']\n BLOCK_K = META['BLOCK_K']\n GROUP_M = 8\n # matrix multiplication\n pid = triton.program_id(0)\n grid_m = (M + BLOCK_M - 1) // BLOCK_M\n grid_n = (N + BLOCK_N - 1) // BLOCK_N\n # re-order program ID for better L2 performance\n width = GROUP_M * grid_n\n group_id = pid // width\n group_size = min(grid_m - group_id * GROUP_M, GROUP_M)\n pid_m = group_id * GROUP_M + (pid % group_size)\n pid_n = (pid % width) // (group_size)\n # do matrix multiplication\n rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)\n rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)\n rk = triton.arange(0, BLOCK_K)\n A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)\n B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)\n acc = triton.zeros((BLOCK_M, BLOCK_N), dtype=triton.float32)\n for k in range(K, 0, -BLOCK_K):\n a = triton.load(A)\n b = triton.load(B)\n acc += triton.dot(a, b)\n A += BLOCK_K * stride_ak\n B += BLOCK_K * stride_bk\n # triton can accept arbitrary activation function\n # via metaparameters!\n if META['ACTIVATION']:\n acc = META['ACTIVATION'](acc)\n # rematerialize rm and rn to save registers\n rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)\n rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)\n C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)\n mask = (rm[:, None] < M) & (rn[None, :] < N)\n triton.store(C, acc, mask=mask)"
|
"import torch\nimport triton\nimport triton.language as tl\n\n# %\n# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:\n# - A list of :code:`triton.Config` objects that define different configurations of meta-parameters (e.g., BLOCK_M) and compilation options (e.g., num_warps) to try\n# - A autotuning *key* whose change in values will trigger evaluation of all the provided configs\n\n\n@triton.jit\ndef sigmoid(x):\n ret_true = 1 / (1 + tl.exp(-x))\n ret_false = tl.exp(x) / (1 + tl.exp(x))\n return tl.where(x >= 0, ret_true, ret_false)\n\n\n@triton.jit\ndef swish(x):\n return x * sigmoid(x)\n\n\n@triton.autotune(\n configs=[\n triton.Config({'BLOCK_M': 128, 'BLOCK_N': 128, 'BLOCK_K': 32, 'GROUP_M': 8}, num_warps=4),\n triton.Config({'BLOCK_M': 64, 'BLOCK_N': 128, 'BLOCK_K': 32, 'GROUP_M': 8}, num_warps=4),\n ],\n key=['M', 'N', 'K'],\n)\n# %\n# We can now define our kernel as normal, using all the techniques presented above\n@triton.jit\ndef _matmul(A, B, C, M, N, K, stride_am, stride_ak, stride_bk, stride_bn, stride_cm, stride_cn, **META):\n # extract meta-parameters\n BLOCK_M = META['BLOCK_M']\n BLOCK_N = META['BLOCK_N']\n BLOCK_K = META['BLOCK_K']\n GROUP_M = 8\n # matrix multiplication\n pid = tl.program_id(0)\n grid_m = (M + BLOCK_M - 1) // BLOCK_M\n grid_n = (N + BLOCK_N - 1) // BLOCK_N\n # re-order program ID for better L2 performance\n width = GROUP_M * grid_n\n group_id = pid // width\n group_size = min(grid_m - group_id * GROUP_M, GROUP_M)\n pid_m = group_id * GROUP_M + (pid % group_size)\n pid_n = (pid % width) // (group_size)\n # do matrix multiplication\n rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)\n rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)\n rk = tl.arange(0, BLOCK_K)\n A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)\n B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)\n acc = tl.zeros((BLOCK_M, BLOCK_N), dtype=tl.float32)\n for k in range(K, 0, -BLOCK_K):\n a = tl.load(A)\n b = tl.load(B)\n acc += tl.dot(a, b)\n A += BLOCK_K * stride_ak\n B += BLOCK_K * stride_bk\n # triton can accept arbitrary activation function\n # via metaparameters!\n if META['ACTIVATION']:\n acc = META['ACTIVATION'](acc)\n # rematerialize rm and rn to save registers\n rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)\n rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)\n C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)\n mask = (rm[:, None] < M) & (rn[None, :] < N)\n tl.store(C, acc, mask=mask)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"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=['cublas', 'triton'], # possible keys for `y_name`\n y_lines=[\"cuBLAS\", \"Triton\"], # 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 silu = torch.nn.SiLU()\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: 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(print_data=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 line_arg='provider', # argument name whose value corresponds to a different line in the plot\n line_vals=['cublas', 'triton'], # possible values for `line_arg``\n line_names=[\"cuBLAS\", \"Triton\"], # 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 silu = torch.nn.SiLU()\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: 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, print_data=True)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@@ -115,6 +115,7 @@ You will specifically learn about:
|
|||||||
|
|
||||||
import torch
|
import torch
|
||||||
import triton
|
import triton
|
||||||
|
import triton.language as tl
|
||||||
|
|
||||||
# %
|
# %
|
||||||
# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:
|
# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:
|
||||||
@@ -124,9 +125,9 @@ import triton
|
|||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
def sigmoid(x):
|
def sigmoid(x):
|
||||||
ret_true = 1 / (1 + triton.exp(-x))
|
ret_true = 1 / (1 + tl.exp(-x))
|
||||||
ret_false = triton.exp(x) / (1 + triton.exp(x))
|
ret_false = tl.exp(x) / (1 + tl.exp(x))
|
||||||
return triton.where(x >= 0, ret_true, ret_false)
|
return tl.where(x >= 0, ret_true, ret_false)
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
@@ -151,7 +152,7 @@ def _matmul(A, B, C, M, N, K, stride_am, stride_ak, stride_bk, stride_bn, stride
|
|||||||
BLOCK_K = META['BLOCK_K']
|
BLOCK_K = META['BLOCK_K']
|
||||||
GROUP_M = 8
|
GROUP_M = 8
|
||||||
# matrix multiplication
|
# matrix multiplication
|
||||||
pid = triton.program_id(0)
|
pid = tl.program_id(0)
|
||||||
grid_m = (M + BLOCK_M - 1) // BLOCK_M
|
grid_m = (M + BLOCK_M - 1) // BLOCK_M
|
||||||
grid_n = (N + BLOCK_N - 1) // BLOCK_N
|
grid_n = (N + BLOCK_N - 1) // BLOCK_N
|
||||||
# re-order program ID for better L2 performance
|
# re-order program ID for better L2 performance
|
||||||
@@ -161,16 +162,16 @@ def _matmul(A, B, C, M, N, K, stride_am, stride_ak, stride_bk, stride_bn, stride
|
|||||||
pid_m = group_id * GROUP_M + (pid % group_size)
|
pid_m = group_id * GROUP_M + (pid % group_size)
|
||||||
pid_n = (pid % width) // (group_size)
|
pid_n = (pid % width) // (group_size)
|
||||||
# do matrix multiplication
|
# do matrix multiplication
|
||||||
rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)
|
rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)
|
||||||
rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)
|
rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)
|
||||||
rk = triton.arange(0, BLOCK_K)
|
rk = tl.arange(0, BLOCK_K)
|
||||||
A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)
|
A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)
|
||||||
B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)
|
B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)
|
||||||
acc = triton.zeros((BLOCK_M, BLOCK_N), dtype=triton.float32)
|
acc = tl.zeros((BLOCK_M, BLOCK_N), dtype=tl.float32)
|
||||||
for k in range(K, 0, -BLOCK_K):
|
for k in range(K, 0, -BLOCK_K):
|
||||||
a = triton.load(A)
|
a = tl.load(A)
|
||||||
b = triton.load(B)
|
b = tl.load(B)
|
||||||
acc += triton.dot(a, b)
|
acc += tl.dot(a, b)
|
||||||
A += BLOCK_K * stride_ak
|
A += BLOCK_K * stride_ak
|
||||||
B += BLOCK_K * stride_bk
|
B += BLOCK_K * stride_bk
|
||||||
# triton can accept arbitrary activation function
|
# triton can accept arbitrary activation function
|
||||||
@@ -178,11 +179,11 @@ def _matmul(A, B, C, M, N, K, stride_am, stride_ak, stride_bk, stride_bn, stride
|
|||||||
if META['ACTIVATION']:
|
if META['ACTIVATION']:
|
||||||
acc = META['ACTIVATION'](acc)
|
acc = META['ACTIVATION'](acc)
|
||||||
# rematerialize rm and rn to save registers
|
# rematerialize rm and rn to save registers
|
||||||
rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)
|
rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)
|
||||||
rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)
|
rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)
|
||||||
C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)
|
C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)
|
||||||
mask = (rm[:, None] < M) & (rn[None, :] < N)
|
mask = (rm[:, None] < M) & (rn[None, :] < N)
|
||||||
triton.store(C, acc, mask=mask)
|
tl.store(C, acc, mask=mask)
|
||||||
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
@@ -238,9 +239,9 @@ print(triton.testing.allclose(c_0, c_1))
|
|||||||
triton.testing.Benchmark(
|
triton.testing.Benchmark(
|
||||||
x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot
|
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`
|
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
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['cublas', 'triton'], # possible keys for `y_name`
|
line_vals=['cublas', 'triton'], # possible values for `line_arg``
|
||||||
y_lines=["cuBLAS", "Triton"], # label name for the lines
|
line_names=["cuBLAS", "Triton"], # label name for the lines
|
||||||
ylabel="TFLOPS", # label name for the y-axis
|
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.
|
plot_name="matmul-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={}
|
args={}
|
||||||
@@ -258,4 +259,4 @@ def benchmark(M, N, K, provider):
|
|||||||
return perf(ms), perf(max_ms), perf(min_ms)
|
return perf(ms), perf(max_ms), perf(min_ms)
|
||||||
|
|
||||||
|
|
||||||
benchmark.run(print_data=True)
|
benchmark.run(show_plots=True, print_data=True)
|
@@ -46,28 +46,29 @@ def naive_softmax(x):
|
|||||||
# so we need to internally "pad" tiles and guard the memory operations properly if we want to handle any possible input shapes:
|
# so we need to internally "pad" tiles and guard the memory operations properly if we want to handle any possible input shapes:
|
||||||
|
|
||||||
import triton
|
import triton
|
||||||
|
import triton.language as tl
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
def _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):
|
def _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):
|
||||||
# row index
|
# row index
|
||||||
m = triton.program_id(0)
|
m = tl.program_id(0)
|
||||||
# col indices
|
# col indices
|
||||||
n = triton.arange(0, meta['BLOCK'])
|
n = tl.arange(0, meta['BLOCK'])
|
||||||
# the memory address of all the elements
|
# the memory address of all the elements
|
||||||
# that we want to load can be computed as follows
|
# that we want to load can be computed as follows
|
||||||
X = X + m * stride_xm + n
|
X = X + m * stride_xm + n
|
||||||
x = triton.load(X, mask=n < N, other=-float('inf'))
|
x = tl.load(X, mask=n < N, other=-float('inf'))
|
||||||
# Substract maximum for numerical stability
|
# Substract maximum for numerical stability
|
||||||
z = x - triton.max(x, axis=0)
|
z = x - tl.max(x, axis=0)
|
||||||
# Note that exponentials in Triton are fast
|
# Note that exponentials in Triton are fast
|
||||||
# but approximate (i.e., think __expf in CUDA)
|
# but approximate (i.e., think __expf in CUDA)
|
||||||
num = triton.exp(z)
|
num = tl.exp(z)
|
||||||
denom = triton.sum(num, axis=0)
|
denom = tl.sum(num, axis=0)
|
||||||
y = num / denom
|
y = num / denom
|
||||||
# Write back to Y
|
# Write back to Y
|
||||||
Y = Y + m * stride_ym + n
|
Y = Y + m * stride_ym + n
|
||||||
triton.store(Y, y, mask=n < N)
|
tl.store(Y, y, mask=n < N)
|
||||||
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
@@ -132,9 +133,9 @@ print(torch.allclose(y_tri, y_ref))
|
|||||||
triton.testing.Benchmark(
|
triton.testing.Benchmark(
|
||||||
x_names=['N'], # argument names to use as an x-axis for the plot
|
x_names=['N'], # argument names to use as an x-axis for the plot
|
||||||
x_vals=[256 * i for i in range(2, 50)], # different possible values for `x_name`
|
x_vals=[256 * i for i in range(2, 50)], # different possible values for `x_name`
|
||||||
y_name='provider', # argument name whose value corresponds to a different line in the plot
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['torch', 'triton', 'naive'], # possible keys for `y_name`
|
line_vals=['torch', 'triton', 'naive'], # possible values for `line_arg``
|
||||||
y_lines=["Torch", "Triton", 'Naive'], # label name for the lines
|
line_names=["Torch", "Triton", 'Naive'], # label name for the lines
|
||||||
ylabel="GB/s", # label name for the y-axis
|
ylabel="GB/s", # label name for the y-axis
|
||||||
plot_name="softmax-performance", # name for the plot. Used also as a file name for saving the plot.
|
plot_name="softmax-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={'M': 4096} # values for function arguments not in `x_names` and `y_name`
|
args={'M': 4096} # values for function arguments not in `x_names` and `y_name`
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import torch\nimport triton\n\n\n@triton.jit\ndef _add(\n X, # *Pointer* to first input vector\n Y, # *Pointer* to second input vector\n Z, # *Pointer* to output vector\n N, # Size of the vector\n **meta # Optional meta-parameters for the kernel\n):\n pid = triton.program_id(0)\n # Create an offset for the blocks of pointers to be\n # processed by this program instance\n offsets = pid * meta['BLOCK'] + triton.arange(0, meta['BLOCK'])\n # Create a mask to guard memory operations against\n # out-of-bounds accesses\n mask = offsets < N\n # Load x\n x = triton.load(X + offsets, mask=mask)\n y = triton.load(Y + offsets, mask=mask)\n # Write back x + y\n z = x + y\n triton.store(Z + offsets, z)"
|
"import torch\nimport triton.language as tl\nimport triton\n\n\n@triton.jit\ndef _add(\n X, # *Pointer* to first input vector\n Y, # *Pointer* to second input vector\n Z, # *Pointer* to output vector\n N, # Size of the vector\n **meta # Optional meta-parameters for the kernel\n):\n pid = tl.program_id(0)\n # Create an offset for the blocks of pointers to be\n # processed by this program instance\n offsets = pid * meta['BLOCK'] + tl.arange(0, meta['BLOCK'])\n # Create a mask to guard memory operations against\n # out-of-bounds accesses\n mask = offsets < N\n # Load x\n x = tl.load(X + offsets, mask=mask)\n y = tl.load(Y + offsets, mask=mask)\n # Write back x + y\n z = x + y\n tl.store(Z + offsets, z)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['size'], # argument names to use as an x-axis for the plot\n x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`\n x_log=True, # x axis is logarithmic\n y_name='provider', # argument name whose value corresponds to a different line in the plot\n y_vals=['torch', 'triton'], # possible keys for `y_name`\n y_lines=[\"Torch\", \"Triton\"], # label name for the lines\n ylabel=\"GB/s\", # label name for the y-axis\n plot_name=\"vector-add-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={} # values for function arguments not in `x_names` and `y_name`\n )\n)\ndef benchmark(size, provider):\n x = torch.rand(size, device='cuda', dtype=torch.float32)\n y = torch.rand(size, device='cuda', dtype=torch.float32)\n if provider == 'torch':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: x + y)\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: add(x, y))\n gbps = lambda ms: 12 * size / ms * 1e-6\n return gbps(ms), gbps(max_ms), gbps(min_ms)"
|
"@triton.testing.perf_report(\n triton.testing.Benchmark(\n x_names=['size'], # argument names to use as an x-axis for the plot\n x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`\n x_log=True, # x axis is logarithmic\n line_arg='provider', # argument name whose value corresponds to a different line in the plot\n line_vals=['torch', 'triton'], # possible values for `line_arg`\n line_names=[\"Torch\", \"Triton\"], # label name for the lines\n ylabel=\"GB/s\", # label name for the y-axis\n plot_name=\"vector-add-performance\", # name for the plot. Used also as a file name for saving the plot.\n args={} # values for function arguments not in `x_names` and `y_name`\n )\n)\ndef benchmark(size, provider):\n x = torch.rand(size, device='cuda', dtype=torch.float32)\n y = torch.rand(size, device='cuda', dtype=torch.float32)\n if provider == 'torch':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: x + y)\n if provider == 'triton':\n ms, min_ms, max_ms = triton.testing.do_bench(lambda: add(x, y))\n gbps = lambda ms: 12 * size / ms * 1e-6\n return gbps(ms), gbps(max_ms), gbps(min_ms)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 22 KiB |
@@ -31,12 +31,13 @@ In this tutorial, you will write a simple vector addition using Triton and learn
|
|||||||
Compute Kernel
|
Compute Kernel
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 14-42
|
.. GENERATED FROM PYTHON SOURCE LINES 14-43
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
import triton.language as tl
|
||||||
import triton
|
import triton
|
||||||
|
|
||||||
|
|
||||||
@@ -48,19 +49,19 @@ Compute Kernel
|
|||||||
N, # Size of the vector
|
N, # Size of the vector
|
||||||
**meta # Optional meta-parameters for the kernel
|
**meta # Optional meta-parameters for the kernel
|
||||||
):
|
):
|
||||||
pid = triton.program_id(0)
|
pid = tl.program_id(0)
|
||||||
# Create an offset for the blocks of pointers to be
|
# Create an offset for the blocks of pointers to be
|
||||||
# processed by this program instance
|
# processed by this program instance
|
||||||
offsets = pid * meta['BLOCK'] + triton.arange(0, meta['BLOCK'])
|
offsets = pid * meta['BLOCK'] + tl.arange(0, meta['BLOCK'])
|
||||||
# Create a mask to guard memory operations against
|
# Create a mask to guard memory operations against
|
||||||
# out-of-bounds accesses
|
# out-of-bounds accesses
|
||||||
mask = offsets < N
|
mask = offsets < N
|
||||||
# Load x
|
# Load x
|
||||||
x = triton.load(X + offsets, mask=mask)
|
x = tl.load(X + offsets, mask=mask)
|
||||||
y = triton.load(Y + offsets, mask=mask)
|
y = tl.load(Y + offsets, mask=mask)
|
||||||
# Write back x + y
|
# Write back x + y
|
||||||
z = x + y
|
z = x + y
|
||||||
triton.store(Z + offsets, z)
|
tl.store(Z + offsets, z)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -70,12 +71,12 @@ Compute Kernel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 43-45
|
.. GENERATED FROM PYTHON SOURCE LINES 44-46
|
||||||
|
|
||||||
We can also declara a helper function that handles allocating the output vector
|
We can also declara a helper function that handles allocating the output vector
|
||||||
and enqueueing the kernel.
|
and enqueueing the kernel.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 45-63
|
.. GENERATED FROM PYTHON SOURCE LINES 46-64
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -104,11 +105,11 @@ and enqueueing the kernel.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 64-65
|
.. GENERATED FROM PYTHON SOURCE LINES 65-66
|
||||||
|
|
||||||
We can now use the above function to compute the sum of two `torch.tensor` objects and test our results:
|
We can now use the above function to compute the sum of two `torch.tensor` objects and test our results:
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 65-76
|
.. GENERATED FROM PYTHON SOURCE LINES 66-77
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -140,11 +141,11 @@ We can now use the above function to compute the sum of two `torch.tensor` objec
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 77-78
|
.. GENERATED FROM PYTHON SOURCE LINES 78-79
|
||||||
|
|
||||||
Seems like we're good to go!
|
Seems like we're good to go!
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 80-85
|
.. GENERATED FROM PYTHON SOURCE LINES 81-86
|
||||||
|
|
||||||
Benchmark
|
Benchmark
|
||||||
-----------
|
-----------
|
||||||
@@ -152,7 +153,7 @@ We can now benchmark our custom op for vectors of increasing sizes to get a sens
|
|||||||
To make things easier, Triton has a set of built-in utilities that allow us to concisely plot the performance of our custom op.
|
To make things easier, Triton has a set of built-in utilities that allow us to concisely plot the performance of our custom op.
|
||||||
for different problem sizes.
|
for different problem sizes.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 85-111
|
.. GENERATED FROM PYTHON SOURCE LINES 86-112
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -163,9 +164,9 @@ for different problem sizes.
|
|||||||
x_names=['size'], # argument names to use as an x-axis for the plot
|
x_names=['size'], # argument names to use as an x-axis for the plot
|
||||||
x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`
|
x_vals=[2**i for i in range(12, 28, 1)], # different possible values for `x_name`
|
||||||
x_log=True, # x axis is logarithmic
|
x_log=True, # x axis is logarithmic
|
||||||
y_name='provider', # argument name whose value corresponds to a different line in the plot
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['torch', 'triton'], # possible keys for `y_name`
|
line_vals=['torch', 'triton'], # possible values for `line_arg`
|
||||||
y_lines=["Torch", "Triton"], # label name for the lines
|
line_names=["Torch", "Triton"], # label name for the lines
|
||||||
ylabel="GB/s", # label name for the y-axis
|
ylabel="GB/s", # label name for the y-axis
|
||||||
plot_name="vector-add-performance", # name for the plot. Used also as a file name for saving the plot.
|
plot_name="vector-add-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={} # values for function arguments not in `x_names` and `y_name`
|
args={} # values for function arguments not in `x_names` and `y_name`
|
||||||
@@ -189,12 +190,12 @@ for different problem sizes.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 112-114
|
.. GENERATED FROM PYTHON SOURCE LINES 113-115
|
||||||
|
|
||||||
We can now run the decorated function above. Pass `show_plots=True` to see the plots and/or
|
We can now run the decorated function above. Pass `show_plots=True` to see the plots and/or
|
||||||
`save_path='/path/to/results/' to save them to disk along with raw CSV data
|
`save_path='/path/to/results/' to save them to disk along with raw CSV data
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 114-114
|
.. GENERATED FROM PYTHON SOURCE LINES 115-115
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -212,7 +213,7 @@ We can now run the decorated function above. Pass `show_plots=True` to see the p
|
|||||||
|
|
||||||
.. rst-class:: sphx-glr-timing
|
.. rst-class:: sphx-glr-timing
|
||||||
|
|
||||||
**Total running time of the script:** ( 0 minutes 7.044 seconds)
|
**Total running time of the script:** ( 0 minutes 7.682 seconds)
|
||||||
|
|
||||||
|
|
||||||
.. _sphx_glr_download_getting-started_tutorials_01-vector-add.py:
|
.. _sphx_glr_download_getting-started_tutorials_01-vector-add.py:
|
||||||
|
@@ -78,34 +78,35 @@ Our softmax kernel works as follows: each program loads a row of the input matri
|
|||||||
Note that one important limitation of Triton is that each block must have a power-of-two number of elements,
|
Note that one important limitation of Triton is that each block must have a power-of-two number of elements,
|
||||||
so we need to internally "pad" tiles and guard the memory operations properly if we want to handle any possible input shapes:
|
so we need to internally "pad" tiles and guard the memory operations properly if we want to handle any possible input shapes:
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 47-73
|
.. GENERATED FROM PYTHON SOURCE LINES 47-74
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
|
|
||||||
import triton
|
import triton
|
||||||
|
import triton.language as tl
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
def _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):
|
def _softmax(Y, X, stride_xm, stride_ym, M, N, **meta):
|
||||||
# row index
|
# row index
|
||||||
m = triton.program_id(0)
|
m = tl.program_id(0)
|
||||||
# col indices
|
# col indices
|
||||||
n = triton.arange(0, meta['BLOCK'])
|
n = tl.arange(0, meta['BLOCK'])
|
||||||
# the memory address of all the elements
|
# the memory address of all the elements
|
||||||
# that we want to load can be computed as follows
|
# that we want to load can be computed as follows
|
||||||
X = X + m * stride_xm + n
|
X = X + m * stride_xm + n
|
||||||
x = triton.load(X, mask=n < N, other=-float('inf'))
|
x = tl.load(X, mask=n < N, other=-float('inf'))
|
||||||
# Substract maximum for numerical stability
|
# Substract maximum for numerical stability
|
||||||
z = x - triton.max(x, axis=0)
|
z = x - tl.max(x, axis=0)
|
||||||
# Note that exponentials in Triton are fast
|
# Note that exponentials in Triton are fast
|
||||||
# but approximate (i.e., think __expf in CUDA)
|
# but approximate (i.e., think __expf in CUDA)
|
||||||
num = triton.exp(z)
|
num = tl.exp(z)
|
||||||
denom = triton.sum(num, axis=0)
|
denom = tl.sum(num, axis=0)
|
||||||
y = num / denom
|
y = num / denom
|
||||||
# Write back to Y
|
# Write back to Y
|
||||||
Y = Y + m * stride_ym + n
|
Y = Y + m * stride_ym + n
|
||||||
triton.store(Y, y, mask=n < N)
|
tl.store(Y, y, mask=n < N)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -115,11 +116,11 @@ so we need to internally "pad" tiles and guard the memory operations properly if
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 74-75
|
.. GENERATED FROM PYTHON SOURCE LINES 75-76
|
||||||
|
|
||||||
We can create a helper function that enqueues the kernel and its (meta-)arguments for any given input tensor.
|
We can create a helper function that enqueues the kernel and its (meta-)arguments for any given input tensor.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 75-107
|
.. GENERATED FROM PYTHON SOURCE LINES 76-108
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -162,17 +163,17 @@ We can create a helper function that enqueues the kernel and its (meta-)argument
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 108-110
|
.. GENERATED FROM PYTHON SOURCE LINES 109-111
|
||||||
|
|
||||||
Unit Test
|
Unit Test
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 112-114
|
.. GENERATED FROM PYTHON SOURCE LINES 113-115
|
||||||
|
|
||||||
We make sure that we test our kernel on a matrix with an irregular number of rows and columns.
|
We make sure that we test our kernel on a matrix with an irregular number of rows and columns.
|
||||||
This will allow us to verify that our padding mechanism works.
|
This will allow us to verify that our padding mechanism works.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 114-121
|
.. GENERATED FROM PYTHON SOURCE LINES 115-122
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -198,18 +199,18 @@ This will allow us to verify that our padding mechanism works.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 122-123
|
.. GENERATED FROM PYTHON SOURCE LINES 123-124
|
||||||
|
|
||||||
As expected, the results are identical.
|
As expected, the results are identical.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 125-129
|
.. GENERATED FROM PYTHON SOURCE LINES 126-130
|
||||||
|
|
||||||
Benchmark
|
Benchmark
|
||||||
-------------
|
-------------
|
||||||
Here we will benchmark our operation as a function of the number of columns in the input matrix -- assuming 4096 rows.
|
Here we will benchmark our operation as a function of the number of columns in the input matrix -- assuming 4096 rows.
|
||||||
We will then compare its performance against (1) :code:`torch.softmax` and (2) the :code:`naive_softmax` defined above.
|
We will then compare its performance against (1) :code:`torch.softmax` and (2) the :code:`naive_softmax` defined above.
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 129-157
|
.. GENERATED FROM PYTHON SOURCE LINES 130-158
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -219,9 +220,9 @@ We will then compare its performance against (1) :code:`torch.softmax` and (2) t
|
|||||||
triton.testing.Benchmark(
|
triton.testing.Benchmark(
|
||||||
x_names=['N'], # argument names to use as an x-axis for the plot
|
x_names=['N'], # argument names to use as an x-axis for the plot
|
||||||
x_vals=[256 * i for i in range(2, 50)], # different possible values for `x_name`
|
x_vals=[256 * i for i in range(2, 50)], # different possible values for `x_name`
|
||||||
y_name='provider', # argument name whose value corresponds to a different line in the plot
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['torch', 'triton', 'naive'], # possible keys for `y_name`
|
line_vals=['torch', 'triton', 'naive'], # possible values for `line_arg``
|
||||||
y_lines=["Torch", "Triton", 'Naive'], # label name for the lines
|
line_names=["Torch", "Triton", 'Naive'], # label name for the lines
|
||||||
ylabel="GB/s", # label name for the y-axis
|
ylabel="GB/s", # label name for the y-axis
|
||||||
plot_name="softmax-performance", # name for the plot. Used also as a file name for saving the plot.
|
plot_name="softmax-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={'M': 4096} # values for function arguments not in `x_names` and `y_name`
|
args={'M': 4096} # values for function arguments not in `x_names` and `y_name`
|
||||||
@@ -252,7 +253,7 @@ We will then compare its performance against (1) :code:`torch.softmax` and (2) t
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 158-163
|
.. GENERATED FROM PYTHON SOURCE LINES 159-164
|
||||||
|
|
||||||
In the above plot, we can see that:
|
In the above plot, we can see that:
|
||||||
|
|
||||||
@@ -264,7 +265,7 @@ In the above plot, we can see that:
|
|||||||
|
|
||||||
.. rst-class:: sphx-glr-timing
|
.. rst-class:: sphx-glr-timing
|
||||||
|
|
||||||
**Total running time of the script:** ( 0 minutes 20.176 seconds)
|
**Total running time of the script:** ( 0 minutes 20.250 seconds)
|
||||||
|
|
||||||
|
|
||||||
.. _sphx_glr_download_getting-started_tutorials_02-fused-softmax.py:
|
.. _sphx_glr_download_getting-started_tutorials_02-fused-softmax.py:
|
||||||
|
@@ -134,13 +134,14 @@ Final Result
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 115-188
|
.. GENERATED FROM PYTHON SOURCE LINES 115-189
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import triton
|
import triton
|
||||||
|
import triton.language as tl
|
||||||
|
|
||||||
# %
|
# %
|
||||||
# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:
|
# :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:
|
||||||
@@ -150,9 +151,9 @@ Final Result
|
|||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
def sigmoid(x):
|
def sigmoid(x):
|
||||||
ret_true = 1 / (1 + triton.exp(-x))
|
ret_true = 1 / (1 + tl.exp(-x))
|
||||||
ret_false = triton.exp(x) / (1 + triton.exp(x))
|
ret_false = tl.exp(x) / (1 + tl.exp(x))
|
||||||
return triton.where(x >= 0, ret_true, ret_false)
|
return tl.where(x >= 0, ret_true, ret_false)
|
||||||
|
|
||||||
|
|
||||||
@triton.jit
|
@triton.jit
|
||||||
@@ -177,7 +178,7 @@ Final Result
|
|||||||
BLOCK_K = META['BLOCK_K']
|
BLOCK_K = META['BLOCK_K']
|
||||||
GROUP_M = 8
|
GROUP_M = 8
|
||||||
# matrix multiplication
|
# matrix multiplication
|
||||||
pid = triton.program_id(0)
|
pid = tl.program_id(0)
|
||||||
grid_m = (M + BLOCK_M - 1) // BLOCK_M
|
grid_m = (M + BLOCK_M - 1) // BLOCK_M
|
||||||
grid_n = (N + BLOCK_N - 1) // BLOCK_N
|
grid_n = (N + BLOCK_N - 1) // BLOCK_N
|
||||||
# re-order program ID for better L2 performance
|
# re-order program ID for better L2 performance
|
||||||
@@ -187,16 +188,16 @@ Final Result
|
|||||||
pid_m = group_id * GROUP_M + (pid % group_size)
|
pid_m = group_id * GROUP_M + (pid % group_size)
|
||||||
pid_n = (pid % width) // (group_size)
|
pid_n = (pid % width) // (group_size)
|
||||||
# do matrix multiplication
|
# do matrix multiplication
|
||||||
rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)
|
rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)
|
||||||
rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)
|
rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)
|
||||||
rk = triton.arange(0, BLOCK_K)
|
rk = tl.arange(0, BLOCK_K)
|
||||||
A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)
|
A = A + (rm[:, None] * stride_am + rk[None, :] * stride_ak)
|
||||||
B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)
|
B = B + (rk[:, None] * stride_bk + rn[None, :] * stride_bn)
|
||||||
acc = triton.zeros((BLOCK_M, BLOCK_N), dtype=triton.float32)
|
acc = tl.zeros((BLOCK_M, BLOCK_N), dtype=tl.float32)
|
||||||
for k in range(K, 0, -BLOCK_K):
|
for k in range(K, 0, -BLOCK_K):
|
||||||
a = triton.load(A)
|
a = tl.load(A)
|
||||||
b = triton.load(B)
|
b = tl.load(B)
|
||||||
acc += triton.dot(a, b)
|
acc += tl.dot(a, b)
|
||||||
A += BLOCK_K * stride_ak
|
A += BLOCK_K * stride_ak
|
||||||
B += BLOCK_K * stride_bk
|
B += BLOCK_K * stride_bk
|
||||||
# triton can accept arbitrary activation function
|
# triton can accept arbitrary activation function
|
||||||
@@ -204,11 +205,11 @@ Final Result
|
|||||||
if META['ACTIVATION']:
|
if META['ACTIVATION']:
|
||||||
acc = META['ACTIVATION'](acc)
|
acc = META['ACTIVATION'](acc)
|
||||||
# rematerialize rm and rn to save registers
|
# rematerialize rm and rn to save registers
|
||||||
rm = pid_m * BLOCK_M + triton.arange(0, BLOCK_M)
|
rm = pid_m * BLOCK_M + tl.arange(0, BLOCK_M)
|
||||||
rn = pid_n * BLOCK_N + triton.arange(0, BLOCK_N)
|
rn = pid_n * BLOCK_N + tl.arange(0, BLOCK_N)
|
||||||
C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)
|
C = C + (rm[:, None] * stride_cm + rn[None, :] * stride_cn)
|
||||||
mask = (rm[:, None] < M) & (rn[None, :] < N)
|
mask = (rm[:, None] < M) & (rn[None, :] < N)
|
||||||
triton.store(C, acc, mask=mask)
|
tl.store(C, acc, mask=mask)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -218,12 +219,12 @@ Final Result
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 189-191
|
.. GENERATED FROM PYTHON SOURCE LINES 190-192
|
||||||
|
|
||||||
We can also create a convenience wrapper function that only takes two input tensors
|
We can also create a convenience wrapper function that only takes two input tensors
|
||||||
and (1) checks any shape constraint; (2) allocates the output; (3) launches the kernel
|
and (1) checks any shape constraint; (2) allocates the output; (3) launches the kernel
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 191-213
|
.. GENERATED FROM PYTHON SOURCE LINES 192-214
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -256,14 +257,14 @@ and (1) checks any shape constraint; (2) allocates the output; (3) launches the
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 214-218
|
.. GENERATED FROM PYTHON SOURCE LINES 215-219
|
||||||
|
|
||||||
Unit Test
|
Unit Test
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
We can test our custom matrix multiplication operation against a native torch implementation (i.e., cuBLAS + custom element-wise swish kernel)
|
We can test our custom matrix multiplication operation against a native torch implementation (i.e., cuBLAS + custom element-wise swish kernel)
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 218-228
|
.. GENERATED FROM PYTHON SOURCE LINES 219-229
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -287,38 +288,38 @@ We can test our custom matrix multiplication operation against a native torch im
|
|||||||
|
|
||||||
.. code-block:: none
|
.. code-block:: none
|
||||||
|
|
||||||
tensor([[-5.9605e-08, 5.1094e+01, -1.8477e-05, ..., 2.6547e+01,
|
tensor([[-4.5061e-05, 4.1656e+01, 1.7500e+01, ..., -2.7405e-02,
|
||||||
-7.2598e-05, -4.2510e-04],
|
-2.3251e-03, -0.0000e+00],
|
||||||
[-2.7100e-01, -3.0220e-05, 5.9414e+00, ..., 2.8340e+00,
|
[-1.0967e-04, -4.2915e-06, -0.0000e+00, ..., -1.4901e-06,
|
||||||
-1.8644e-04, 1.3094e+01],
|
-0.0000e+00, 1.4367e+01],
|
||||||
[-1.5332e-01, 4.8125e+00, 8.4277e-01, ..., 3.6387e+00,
|
[ 5.8156e+01, -0.0000e+00, -1.4603e-04, ..., 1.3930e+01,
|
||||||
4.3375e+01, 1.6865e+00],
|
-2.1362e-01, 9.4062e+00],
|
||||||
...,
|
...,
|
||||||
[-0.0000e+00, 2.9453e+01, -4.7684e-07, ..., 6.2617e+00,
|
[ 2.3703e+01, -9.2163e-02, -1.3471e-05, ..., -9.5215e-02,
|
||||||
4.1133e+00, -0.0000e+00],
|
2.0047e+01, 1.4891e+01],
|
||||||
[ 1.6562e+01, -8.1539e-04, 1.3836e+01, ..., 1.9844e+00,
|
[-1.9073e-06, 5.0664e+00, -0.0000e+00, ..., 2.0281e+01,
|
||||||
-1.1238e-02, 8.4375e+00],
|
-1.7583e-05, 3.8000e+01],
|
||||||
[-1.0876e-01, -2.7295e-01, 3.2156e+01, ..., -1.6907e-02,
|
[-1.7285e-05, 5.3945e+00, -1.3916e-01, ..., -2.0984e-01,
|
||||||
-0.0000e+00, -0.0000e+00]], device='cuda:0', dtype=torch.float16)
|
5.3750e+00, -1.5993e-03]], device='cuda:0', dtype=torch.float16)
|
||||||
tensor([[-5.9605e-08, 5.1094e+01, -1.8537e-05, ..., 2.6547e+01,
|
tensor([[-4.4942e-05, 4.1656e+01, 1.7500e+01, ..., -2.7405e-02,
|
||||||
-7.2658e-05, -4.2605e-04],
|
-2.3232e-03, -0.0000e+00],
|
||||||
[-2.7100e-01, -3.0220e-05, 5.9414e+00, ..., 2.8340e+00,
|
[-1.1003e-04, -4.2915e-06, -0.0000e+00, ..., -1.4901e-06,
|
||||||
-1.8632e-04, 1.3094e+01],
|
-0.0000e+00, 1.4367e+01],
|
||||||
[-1.5332e-01, 4.8125e+00, 8.4277e-01, ..., 3.6387e+00,
|
[ 5.8156e+01, -0.0000e+00, -1.4639e-04, ..., 1.3930e+01,
|
||||||
4.3375e+01, 1.6875e+00],
|
-2.1362e-01, 9.4062e+00],
|
||||||
...,
|
...,
|
||||||
[-0.0000e+00, 2.9453e+01, -4.7684e-07, ..., 6.2617e+00,
|
[ 2.3703e+01, -9.2163e-02, -1.3471e-05, ..., -9.5276e-02,
|
||||||
4.1133e+00, -0.0000e+00],
|
2.0047e+01, 1.4891e+01],
|
||||||
[ 1.6562e+01, -8.1778e-04, 1.3836e+01, ..., 1.9844e+00,
|
[-1.9073e-06, 5.0664e+00, -0.0000e+00, ..., 2.0281e+01,
|
||||||
-1.1238e-02, 8.4375e+00],
|
-1.7583e-05, 3.8000e+01],
|
||||||
[-1.0876e-01, -2.7295e-01, 3.2156e+01, ..., -1.6891e-02,
|
[-1.7345e-05, 5.3945e+00, -1.3916e-01, ..., -2.0984e-01,
|
||||||
-0.0000e+00, -0.0000e+00]], device='cuda:0', dtype=torch.float16)
|
5.3750e+00, -1.6031e-03]], device='cuda:0', dtype=torch.float16)
|
||||||
tensor(True, device='cuda:0')
|
tensor(True, device='cuda:0')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. GENERATED FROM PYTHON SOURCE LINES 229-235
|
.. GENERATED FROM PYTHON SOURCE LINES 230-236
|
||||||
|
|
||||||
Benchmark
|
Benchmark
|
||||||
--------------
|
--------------
|
||||||
@@ -327,7 +328,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.#
|
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 235-261
|
.. GENERATED FROM PYTHON SOURCE LINES 236-262
|
||||||
|
|
||||||
.. code-block:: default
|
.. code-block:: default
|
||||||
|
|
||||||
@@ -337,9 +338,9 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus
|
|||||||
triton.testing.Benchmark(
|
triton.testing.Benchmark(
|
||||||
x_names=['M', 'N', 'K'], # argument names to use as an x-axis for the plot
|
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`
|
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
|
line_arg='provider', # argument name whose value corresponds to a different line in the plot
|
||||||
y_vals=['cublas', 'triton'], # possible keys for `y_name`
|
line_vals=['cublas', 'triton'], # possible values for `line_arg``
|
||||||
y_lines=["cuBLAS", "Triton"], # label name for the lines
|
line_names=["cuBLAS", "Triton"], # label name for the lines
|
||||||
ylabel="TFLOPS", # label name for the y-axis
|
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.
|
plot_name="matmul-performance", # name for the plot. Used also as a file name for saving the plot.
|
||||||
args={}
|
args={}
|
||||||
@@ -357,7 +358,7 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus
|
|||||||
return perf(ms), perf(max_ms), perf(min_ms)
|
return perf(ms), perf(max_ms), perf(min_ms)
|
||||||
|
|
||||||
|
|
||||||
benchmark.run(print_data=True)
|
benchmark.run(show_plots=True, print_data=True)
|
||||||
|
|
||||||
|
|
||||||
.. image:: /getting-started/tutorials/images/sphx_glr_03-matrix-multiplication_001.png
|
.. image:: /getting-started/tutorials/images/sphx_glr_03-matrix-multiplication_001.png
|
||||||
@@ -374,35 +375,35 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus
|
|||||||
M cuBLAS Triton
|
M cuBLAS Triton
|
||||||
0 512.0 20.164923 15.420235
|
0 512.0 20.164923 15.420235
|
||||||
1 768.0 58.982401 40.215272
|
1 768.0 58.982401 40.215272
|
||||||
2 1024.0 91.180520 72.315584
|
2 1024.0 95.325090 72.315584
|
||||||
3 1280.0 157.538463 117.028568
|
3 1280.0 151.703703 117.028568
|
||||||
4 1536.0 153.867127 144.446699
|
4 1536.0 153.867127 150.593357
|
||||||
5 1792.0 208.137481 190.498706
|
5 1792.0 208.137481 190.498706
|
||||||
6 2048.0 199.728763 152.520144
|
6 2048.0 202.135135 151.146088
|
||||||
7 2304.0 246.266731 178.267699
|
7 2304.0 251.451276 178.267699
|
||||||
8 2560.0 235.741014 215.578957
|
8 2560.0 237.449270 218.453323
|
||||||
9 2816.0 231.990461 198.246398
|
9 2816.0 238.329010 200.987140
|
||||||
10 3072.0 236.916752 221.184001
|
10 3072.0 243.017615 223.806730
|
||||||
11 3328.0 239.173747 210.500857
|
11 3328.0 244.868356 210.500857
|
||||||
12 3584.0 248.385067 230.552287
|
12 3584.0 250.460703 232.941430
|
||||||
13 3840.0 251.917998 222.519114
|
13 3840.0 256.593972 225.697957
|
||||||
14 4096.0 263.172024 244.032234
|
14 4096.0 266.305018 247.634187
|
||||||
15 4352.0 249.595626 232.307632
|
15 4352.0 247.675667 237.797917
|
||||||
16 4608.0 276.560014 254.803966
|
16 4608.0 280.621108 260.713476
|
||||||
17 4864.0 266.614125 245.366501
|
17 4864.0 272.431168 252.534501
|
||||||
18 5120.0 257.003930 238.096276
|
18 5120.0 265.596772 245.223576
|
||||||
19 5376.0 252.676487 236.527241
|
19 5376.0 261.381955 244.335299
|
||||||
20 5632.0 270.057027 248.514009
|
20 5632.0 283.439220 260.383339
|
||||||
21 5888.0 264.206935 242.511113
|
21 5888.0 276.674704 254.103421
|
||||||
22 6144.0 259.441481 241.205983
|
22 6144.0 274.869441 252.078378
|
||||||
23 6400.0 257.157204 235.078047
|
23 6400.0 269.190319 249.027231
|
||||||
24 6656.0 254.161678 232.699140
|
24 6656.0 269.252160 249.104840
|
||||||
25 6912.0 251.844029 233.178785
|
25 6912.0 267.069377 247.115909
|
||||||
26 7168.0 253.282797 231.740709
|
26 7168.0 268.504352 246.006552
|
||||||
27 7424.0 251.868505 230.377264
|
27 7424.0 267.373291 246.355964
|
||||||
28 7680.0 250.988932 231.606284
|
28 7680.0 266.406511 245.760004
|
||||||
29 7936.0 253.293068 229.692102
|
29 7936.0 228.348876 248.331598
|
||||||
30 8192.0 253.002304 231.360005
|
30 8192.0 227.680622 247.977332
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -410,7 +411,7 @@ We can now compare the performance of our kernel against CUTLASS. Here we focus
|
|||||||
|
|
||||||
.. rst-class:: sphx-glr-timing
|
.. rst-class:: sphx-glr-timing
|
||||||
|
|
||||||
**Total running time of the script:** ( 0 minutes 32.933 seconds)
|
**Total running time of the script:** ( 0 minutes 37.657 seconds)
|
||||||
|
|
||||||
|
|
||||||
.. _sphx_glr_download_getting-started_tutorials_03-matrix-multiplication.py:
|
.. _sphx_glr_download_getting-started_tutorials_03-matrix-multiplication.py:
|
||||||
|
@@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
Computation times
|
Computation times
|
||||||
=================
|
=================
|
||||||
**01:00.154** total execution time for **getting-started_tutorials** files:
|
**00:37.657** total execution time for **getting-started_tutorials** files:
|
||||||
|
|
||||||
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||||
| :ref:`sphx_glr_getting-started_tutorials_03-matrix-multiplication.py` (``03-matrix-multiplication.py``) | 00:32.933 | 0.0 MB |
|
| :ref:`sphx_glr_getting-started_tutorials_03-matrix-multiplication.py` (``03-matrix-multiplication.py``) | 00:37.657 | 0.0 MB |
|
||||||
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||||
| :ref:`sphx_glr_getting-started_tutorials_02-fused-softmax.py` (``02-fused-softmax.py``) | 00:20.176 | 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.044 | 0.0 MB |
|
| :ref:`sphx_glr_getting-started_tutorials_02-fused-softmax.py` (``02-fused-softmax.py``) | 00:00.000 | 0.0 MB |
|
||||||
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
+---------------------------------------------------------------------------------------------------------+-----------+--------+
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
Welcome to Triton's documentation!
|
Welcome to Triton's documentation!
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
Triton is an imperative language and compiler for parallel programming. It aims to provide a programming environment for productively writing custom DNN compute kernels capable of running at maximal throughput on modern GPU hardware.
|
Triton is an language and compiler for parallel programming. It aims to provide a Python-based programming environment for productively writing custom DNN compute kernels capable of running at maximal throughput on modern GPU hardware.
|
||||||
|
|
||||||
Getting Started
|
Getting Started
|
||||||
---------------
|
---------------
|
||||||
@@ -17,18 +17,22 @@ Getting Started
|
|||||||
getting-started/installation
|
getting-started/installation
|
||||||
getting-started/tutorials/index
|
getting-started/tutorials/index
|
||||||
|
|
||||||
Language Reference
|
Python API
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
- Checkout the :doc:`Python API Documentation <language-reference/python-api/index>`
|
- :doc:`triton <python-api/triton>`
|
||||||
|
- :doc:`triton.language <python-api/triton.language>`
|
||||||
|
- :doc:`triton.testing <python-api/triton.testing>`
|
||||||
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: Language Reference
|
:caption: Python API
|
||||||
:hidden:
|
:hidden:
|
||||||
|
|
||||||
language-reference/python-api/index
|
python-api/triton
|
||||||
|
python-api/triton.language
|
||||||
|
python-api/triton.testing
|
||||||
|
|
||||||
|
|
||||||
Going Further
|
Going Further
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
triton.arange
|
|
||||||
=============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: arange
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.atomic\_cas
|
|
||||||
==================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: atomic_cas
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.atomic\_xchg
|
|
||||||
===================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: atomic_xchg
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.broadcast\_to
|
|
||||||
====================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: broadcast_to
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.dot
|
|
||||||
==========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: dot
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.exp
|
|
||||||
==========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: exp
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.load
|
|
||||||
===========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: load
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.max
|
|
||||||
==========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: max
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.maximum
|
|
||||||
==============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: maximum
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.min
|
|
||||||
==========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: min
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.minimum
|
|
||||||
==============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: minimum
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.multiple\_of
|
|
||||||
===================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: multiple_of
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.num\_programs
|
|
||||||
====================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: num_programs
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.program\_id
|
|
||||||
==================
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: program_id
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.ravel
|
|
||||||
============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: ravel
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.reshape
|
|
||||||
==============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: reshape
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.sigmoid
|
|
||||||
==============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: sigmoid
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.softmax
|
|
||||||
==============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: softmax
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.store
|
|
||||||
============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: store
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.sum
|
|
||||||
==========
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: sum
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.where
|
|
||||||
============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: where
|
|
@@ -1,6 +0,0 @@
|
|||||||
triton.zeros
|
|
||||||
============
|
|
||||||
|
|
||||||
.. currentmodule:: triton
|
|
||||||
|
|
||||||
.. autofunction:: zeros
|
|
@@ -1,6 +1,6 @@
|
|||||||
triton.log
|
triton.jit
|
||||||
==========
|
==========
|
||||||
|
|
||||||
.. currentmodule:: triton
|
.. currentmodule:: triton
|
||||||
|
|
||||||
.. autofunction:: log
|
.. autofunction:: jit
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.arange
|
||||||
|
======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: arange
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.atomic\_cas
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: atomic_cas
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.atomic\_xchg
|
||||||
|
============================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: atomic_xchg
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.broadcast\_to
|
||||||
|
=============================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: broadcast_to
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.dot
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: dot
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.exp
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: exp
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.load
|
||||||
|
====================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: load
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.log
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: log
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.max
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: max
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.maximum
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: maximum
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.min
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: min
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.minimum
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: minimum
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.multiple\_of
|
||||||
|
============================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: multiple_of
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.num\_programs
|
||||||
|
=============================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: num_programs
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.program\_id
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: program_id
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.ravel
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: ravel
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.reshape
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: reshape
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.sigmoid
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: sigmoid
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.softmax
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: softmax
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.store
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: store
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.sum
|
||||||
|
===================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: sum
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.where
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: where
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.language.zeros
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
.. autofunction:: zeros
|
@@ -0,0 +1,22 @@
|
|||||||
|
triton.testing.Benchmark
|
||||||
|
========================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.testing
|
||||||
|
|
||||||
|
.. autoclass:: Benchmark
|
||||||
|
|
||||||
|
|
||||||
|
.. automethod:: __init__
|
||||||
|
|
||||||
|
|
||||||
|
.. rubric:: Methods
|
||||||
|
|
||||||
|
.. autosummary::
|
||||||
|
|
||||||
|
~Benchmark.__init__
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.testing.do\_bench
|
||||||
|
========================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.testing
|
||||||
|
|
||||||
|
.. autofunction:: do_bench
|
@@ -0,0 +1,6 @@
|
|||||||
|
triton.testing.perf\_report
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.testing
|
||||||
|
|
||||||
|
.. autofunction:: perf_report
|
@@ -1,7 +1,7 @@
|
|||||||
Python API
|
triton.language
|
||||||
===========
|
================
|
||||||
|
|
||||||
.. currentmodule:: triton
|
.. currentmodule:: triton.language
|
||||||
|
|
||||||
|
|
||||||
Programming Model
|
Programming Model
|
10
_sources/python-api/triton.rst.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
triton
|
||||||
|
========
|
||||||
|
|
||||||
|
.. currentmodule:: triton
|
||||||
|
|
||||||
|
.. autosummary::
|
||||||
|
:toctree: generated
|
||||||
|
:nosignatures:
|
||||||
|
|
||||||
|
jit
|
12
_sources/python-api/triton.testing.rst.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
triton.testing
|
||||||
|
================
|
||||||
|
|
||||||
|
.. currentmodule:: triton.testing
|
||||||
|
|
||||||
|
.. autosummary::
|
||||||
|
:toctree: generated
|
||||||
|
:nosignatures:
|
||||||
|
|
||||||
|
do_bench
|
||||||
|
Benchmark
|
||||||
|
perf_report
|
@@ -92,9 +92,11 @@
|
|||||||
<li class="toctree-l1"><a class="reference internal" href="getting-started/installation.html">Installation</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="getting-started/installation.html">Installation</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="getting-started/tutorials/index.html">Tutorials</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="getting-started/tutorials/index.html">Tutorials</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -169,10 +171,12 @@
|
|||||||
<h1 id="index">Index</h1>
|
<h1 id="index">Index</h1>
|
||||||
|
|
||||||
<div class="genindex-jumpbox">
|
<div class="genindex-jumpbox">
|
||||||
<a href="#A"><strong>A</strong></a>
|
<a href="#_"><strong>_</strong></a>
|
||||||
|
| <a href="#A"><strong>A</strong></a>
|
||||||
| <a href="#B"><strong>B</strong></a>
|
| <a href="#B"><strong>B</strong></a>
|
||||||
| <a href="#D"><strong>D</strong></a>
|
| <a href="#D"><strong>D</strong></a>
|
||||||
| <a href="#E"><strong>E</strong></a>
|
| <a href="#E"><strong>E</strong></a>
|
||||||
|
| <a href="#J"><strong>J</strong></a>
|
||||||
| <a href="#L"><strong>L</strong></a>
|
| <a href="#L"><strong>L</strong></a>
|
||||||
| <a href="#M"><strong>M</strong></a>
|
| <a href="#M"><strong>M</strong></a>
|
||||||
| <a href="#N"><strong>N</strong></a>
|
| <a href="#N"><strong>N</strong></a>
|
||||||
@@ -183,16 +187,24 @@
|
|||||||
| <a href="#Z"><strong>Z</strong></a>
|
| <a href="#Z"><strong>Z</strong></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<h2 id="_">_</h2>
|
||||||
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="python-api/generated/triton.testing.Benchmark.html#triton.testing.Benchmark.__init__">__init__() (triton.testing.Benchmark method)</a>
|
||||||
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
</tr></table>
|
||||||
|
|
||||||
<h2 id="A">A</h2>
|
<h2 id="A">A</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.arange.html#triton.arange">arange() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.arange.html#triton.language.arange">arange() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.atomic_cas.html#triton.atomic_cas">atomic_cas() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.atomic_cas.html#triton.language.atomic_cas">atomic_cas() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.atomic_xchg.html#triton.atomic_xchg">atomic_xchg() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.atomic_xchg.html#triton.language.atomic_xchg">atomic_xchg() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -200,7 +212,11 @@
|
|||||||
<h2 id="B">B</h2>
|
<h2 id="B">B</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.broadcast_to.html#triton.broadcast_to">broadcast_to() (in module triton)</a>
|
<li><a href="python-api/generated/triton.testing.Benchmark.html#triton.testing.Benchmark">Benchmark (class in triton.testing)</a>
|
||||||
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="python-api/generated/triton.language.broadcast_to.html#triton.language.broadcast_to">broadcast_to() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -208,7 +224,11 @@
|
|||||||
<h2 id="D">D</h2>
|
<h2 id="D">D</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.dot.html#triton.dot">dot() (in module triton)</a>
|
<li><a href="python-api/generated/triton.testing.do_bench.html#triton.testing.do_bench">do_bench() (in module triton.testing)</a>
|
||||||
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="python-api/generated/triton.language.dot.html#triton.language.dot">dot() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -216,7 +236,15 @@
|
|||||||
<h2 id="E">E</h2>
|
<h2 id="E">E</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.exp.html#triton.exp">exp() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.exp.html#triton.language.exp">exp() (in module triton.language)</a>
|
||||||
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
</tr></table>
|
||||||
|
|
||||||
|
<h2 id="J">J</h2>
|
||||||
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="python-api/generated/triton.jit.html#triton.jit">jit() (in module triton)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -224,11 +252,11 @@
|
|||||||
<h2 id="L">L</h2>
|
<h2 id="L">L</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.load.html#triton.load">load() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.load.html#triton.language.load">load() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.log.html#triton.log">log() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.log.html#triton.language.log">log() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -236,17 +264,17 @@
|
|||||||
<h2 id="M">M</h2>
|
<h2 id="M">M</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.max.html#triton.max">max() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.max.html#triton.language.max">max() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.maximum.html#triton.maximum">maximum() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.maximum.html#triton.language.maximum">maximum() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.min.html#triton.min">min() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.min.html#triton.language.min">min() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.minimum.html#triton.minimum">minimum() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.minimum.html#triton.language.minimum">minimum() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.multiple_of.html#triton.multiple_of">multiple_of() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.multiple_of.html#triton.language.multiple_of">multiple_of() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -254,7 +282,7 @@
|
|||||||
<h2 id="N">N</h2>
|
<h2 id="N">N</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.num_programs.html#triton.num_programs">num_programs() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.num_programs.html#triton.language.num_programs">num_programs() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -262,7 +290,11 @@
|
|||||||
<h2 id="P">P</h2>
|
<h2 id="P">P</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.program_id.html#triton.program_id">program_id() (in module triton)</a>
|
<li><a href="python-api/generated/triton.testing.perf_report.html#triton.testing.perf_report">perf_report() (in module triton.testing)</a>
|
||||||
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="python-api/generated/triton.language.program_id.html#triton.language.program_id">program_id() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -270,11 +302,11 @@
|
|||||||
<h2 id="R">R</h2>
|
<h2 id="R">R</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.ravel.html#triton.ravel">ravel() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.ravel.html#triton.language.ravel">ravel() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.reshape.html#triton.reshape">reshape() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.reshape.html#triton.language.reshape">reshape() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -282,15 +314,15 @@
|
|||||||
<h2 id="S">S</h2>
|
<h2 id="S">S</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.sigmoid.html#triton.sigmoid">sigmoid() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.sigmoid.html#triton.language.sigmoid">sigmoid() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.softmax.html#triton.softmax">softmax() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.softmax.html#triton.language.softmax">softmax() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.store.html#triton.store">store() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.store.html#triton.language.store">store() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="language-reference/python-api/generated/triton.sum.html#triton.sum">sum() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.sum.html#triton.language.sum">sum() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -298,7 +330,7 @@
|
|||||||
<h2 id="W">W</h2>
|
<h2 id="W">W</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.where.html#triton.where">where() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.where.html#triton.language.where">where() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
@@ -306,7 +338,7 @@
|
|||||||
<h2 id="Z">Z</h2>
|
<h2 id="Z">Z</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="language-reference/python-api/generated/triton.zeros.html#triton.zeros">zeros() (in module triton)</a>
|
<li><a href="python-api/generated/triton.language.zeros.html#triton.language.zeros">zeros() (in module triton.language)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
@@ -102,9 +102,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="tutorials/index.html">Tutorials</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="tutorials/index.html">Tutorials</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@@ -103,9 +103,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -196,6 +198,7 @@ to download the full example code</p>
|
|||||||
<div class="section" id="compute-kernel">
|
<div class="section" id="compute-kernel">
|
||||||
<h2>Compute Kernel<a class="headerlink" href="#compute-kernel" title="Permalink to this headline">¶</a></h2>
|
<h2>Compute Kernel<a class="headerlink" href="#compute-kernel" title="Permalink to this headline">¶</a></h2>
|
||||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">triton.language</span> <span class="k">as</span> <span class="nn">tl</span>
|
||||||
<span class="kn">import</span> <span class="nn">triton</span>
|
<span class="kn">import</span> <span class="nn">triton</span>
|
||||||
|
|
||||||
|
|
||||||
@@ -207,19 +210,19 @@ to download the full example code</p>
|
|||||||
<span class="n">N</span><span class="p">,</span> <span class="c1"># Size of the vector</span>
|
<span class="n">N</span><span class="p">,</span> <span class="c1"># Size of the vector</span>
|
||||||
<span class="o">**</span><span class="n">meta</span> <span class="c1"># Optional meta-parameters for the kernel</span>
|
<span class="o">**</span><span class="n">meta</span> <span class="c1"># Optional meta-parameters for the kernel</span>
|
||||||
<span class="p">):</span>
|
<span class="p">):</span>
|
||||||
<span class="n">pid</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
<span class="n">pid</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
||||||
<span class="c1"># Create an offset for the blocks of pointers to be</span>
|
<span class="c1"># Create an offset for the blocks of pointers to be</span>
|
||||||
<span class="c1"># processed by this program instance</span>
|
<span class="c1"># processed by this program instance</span>
|
||||||
<span class="n">offsets</span> <span class="o">=</span> <span class="n">pid</span> <span class="o">*</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">]</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">])</span>
|
<span class="n">offsets</span> <span class="o">=</span> <span class="n">pid</span> <span class="o">*</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">]</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">])</span>
|
||||||
<span class="c1"># Create a mask to guard memory operations against</span>
|
<span class="c1"># Create a mask to guard memory operations against</span>
|
||||||
<span class="c1"># out-of-bounds accesses</span>
|
<span class="c1"># out-of-bounds accesses</span>
|
||||||
<span class="n">mask</span> <span class="o">=</span> <span class="n">offsets</span> <span class="o"><</span> <span class="n">N</span>
|
<span class="n">mask</span> <span class="o">=</span> <span class="n">offsets</span> <span class="o"><</span> <span class="n">N</span>
|
||||||
<span class="c1"># Load x</span>
|
<span class="c1"># Load x</span>
|
||||||
<span class="n">x</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">X</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
<span class="n">x</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">X</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
||||||
<span class="n">y</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">Y</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
<span class="n">y</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">Y</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
||||||
<span class="c1"># Write back x + y</span>
|
<span class="c1"># Write back x + y</span>
|
||||||
<span class="n">z</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span>
|
<span class="n">z</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span>
|
||||||
<span class="n">triton</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">Z</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
|
<span class="n">tl</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">Z</span> <span class="o">+</span> <span class="n">offsets</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>We can also declara a helper function that handles allocating the output vector
|
<p>We can also declara a helper function that handles allocating the output vector
|
||||||
@@ -270,9 +273,9 @@ for different problem sizes.</p>
|
|||||||
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'size'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'size'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
||||||
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">2</span><span class="o">**</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">28</span><span class="p">,</span> <span class="mi">1</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">2</span><span class="o">**</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="mi">28</span><span class="p">,</span> <span class="mi">1</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
||||||
<span class="n">x_log</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># x axis is logarithmic</span>
|
<span class="n">x_log</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># x axis is logarithmic</span>
|
||||||
<span class="n">y_name</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
<span class="n">line_arg</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
||||||
<span class="n">y_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'torch'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">],</span> <span class="c1"># possible keys for `y_name`</span>
|
<span class="n">line_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'torch'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">],</span> <span class="c1"># possible values for `line_arg`</span>
|
||||||
<span class="n">y_lines</span><span class="o">=</span><span class="p">[</span><span class="s2">"Torch"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
<span class="n">line_names</span><span class="o">=</span><span class="p">[</span><span class="s2">"Torch"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
||||||
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"GB/s"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"GB/s"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
||||||
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"vector-add-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"vector-add-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
||||||
<span class="n">args</span><span class="o">=</span><span class="p">{}</span> <span class="c1"># values for function arguments not in `x_names` and `y_name`</span>
|
<span class="n">args</span><span class="o">=</span><span class="p">{}</span> <span class="c1"># values for function arguments not in `x_names` and `y_name`</span>
|
||||||
@@ -295,7 +298,7 @@ for different problem sizes.</p>
|
|||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<img alt="01 vector add" class="sphx-glr-single-img" src="../../_images/sphx_glr_01-vector-add_001.png" />
|
<img alt="01 vector add" class="sphx-glr-single-img" src="../../_images/sphx_glr_01-vector-add_001.png" />
|
||||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 7.044 seconds)</p>
|
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 7.682 seconds)</p>
|
||||||
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-01-vector-add-py">
|
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-01-vector-add-py">
|
||||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||||
<p><a class="reference download internal" download="" href="../../_downloads/62d97d49a32414049819dd8bb8378080/01-vector-add.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">01-vector-add.py</span></code></a></p>
|
<p><a class="reference download internal" download="" href="../../_downloads/62d97d49a32414049819dd8bb8378080/01-vector-add.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">01-vector-add.py</span></code></a></p>
|
||||||
|
@@ -106,9 +106,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -229,28 +231,29 @@ In practice, though, we would be getting a bit less as our kernel computes expon
|
|||||||
Note that one important limitation of Triton is that each block must have a power-of-two number of elements,
|
Note that one important limitation of Triton is that each block must have a power-of-two number of elements,
|
||||||
so we need to internally “pad” tiles and guard the memory operations properly if we want to handle any possible input shapes:</p>
|
so we need to internally “pad” tiles and guard the memory operations properly if we want to handle any possible input shapes:</p>
|
||||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">triton</span>
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">triton</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">triton.language</span> <span class="k">as</span> <span class="nn">tl</span>
|
||||||
|
|
||||||
|
|
||||||
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
||||||
<span class="k">def</span> <span class="nf">_softmax</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">stride_xm</span><span class="p">,</span> <span class="n">stride_ym</span><span class="p">,</span> <span class="n">M</span><span class="p">,</span> <span class="n">N</span><span class="p">,</span> <span class="o">**</span><span class="n">meta</span><span class="p">):</span>
|
<span class="k">def</span> <span class="nf">_softmax</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">stride_xm</span><span class="p">,</span> <span class="n">stride_ym</span><span class="p">,</span> <span class="n">M</span><span class="p">,</span> <span class="n">N</span><span class="p">,</span> <span class="o">**</span><span class="n">meta</span><span class="p">):</span>
|
||||||
<span class="c1"># row index</span>
|
<span class="c1"># row index</span>
|
||||||
<span class="n">m</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
<span class="n">m</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
||||||
<span class="c1"># col indices</span>
|
<span class="c1"># col indices</span>
|
||||||
<span class="n">n</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">])</span>
|
<span class="n">n</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">meta</span><span class="p">[</span><span class="s1">'BLOCK'</span><span class="p">])</span>
|
||||||
<span class="c1"># the memory address of all the elements</span>
|
<span class="c1"># the memory address of all the elements</span>
|
||||||
<span class="c1"># that we want to load can be computed as follows</span>
|
<span class="c1"># that we want to load can be computed as follows</span>
|
||||||
<span class="n">X</span> <span class="o">=</span> <span class="n">X</span> <span class="o">+</span> <span class="n">m</span> <span class="o">*</span> <span class="n">stride_xm</span> <span class="o">+</span> <span class="n">n</span>
|
<span class="n">X</span> <span class="o">=</span> <span class="n">X</span> <span class="o">+</span> <span class="n">m</span> <span class="o">*</span> <span class="n">stride_xm</span> <span class="o">+</span> <span class="n">n</span>
|
||||||
<span class="n">x</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">n</span> <span class="o"><</span> <span class="n">N</span><span class="p">,</span> <span class="n">other</span><span class="o">=-</span><span class="nb">float</span><span class="p">(</span><span class="s1">'inf'</span><span class="p">))</span>
|
<span class="n">x</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">n</span> <span class="o"><</span> <span class="n">N</span><span class="p">,</span> <span class="n">other</span><span class="o">=-</span><span class="nb">float</span><span class="p">(</span><span class="s1">'inf'</span><span class="p">))</span>
|
||||||
<span class="c1"># Substract maximum for numerical stability</span>
|
<span class="c1"># Substract maximum for numerical stability</span>
|
||||||
<span class="n">z</span> <span class="o">=</span> <span class="n">x</span> <span class="o">-</span> <span class="n">triton</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
<span class="n">z</span> <span class="o">=</span> <span class="n">x</span> <span class="o">-</span> <span class="n">tl</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
||||||
<span class="c1"># Note that exponentials in Triton are fast</span>
|
<span class="c1"># Note that exponentials in Triton are fast</span>
|
||||||
<span class="c1"># but approximate (i.e., think __expf in CUDA)</span>
|
<span class="c1"># but approximate (i.e., think __expf in CUDA)</span>
|
||||||
<span class="n">num</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
|
<span class="n">num</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
|
||||||
<span class="n">denom</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
<span class="n">denom</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">num</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
|
||||||
<span class="n">y</span> <span class="o">=</span> <span class="n">num</span> <span class="o">/</span> <span class="n">denom</span>
|
<span class="n">y</span> <span class="o">=</span> <span class="n">num</span> <span class="o">/</span> <span class="n">denom</span>
|
||||||
<span class="c1"># Write back to Y</span>
|
<span class="c1"># Write back to Y</span>
|
||||||
<span class="n">Y</span> <span class="o">=</span> <span class="n">Y</span> <span class="o">+</span> <span class="n">m</span> <span class="o">*</span> <span class="n">stride_ym</span> <span class="o">+</span> <span class="n">n</span>
|
<span class="n">Y</span> <span class="o">=</span> <span class="n">Y</span> <span class="o">+</span> <span class="n">m</span> <span class="o">*</span> <span class="n">stride_ym</span> <span class="o">+</span> <span class="n">n</span>
|
||||||
<span class="n">triton</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">n</span> <span class="o"><</span> <span class="n">N</span><span class="p">)</span>
|
<span class="n">tl</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">n</span> <span class="o"><</span> <span class="n">N</span><span class="p">)</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>We can create a helper function that enqueues the kernel and its (meta-)arguments for any given input tensor.</p>
|
<p>We can create a helper function that enqueues the kernel and its (meta-)arguments for any given input tensor.</p>
|
||||||
@@ -310,9 +313,9 @@ We will then compare its performance against (1) <code class="code docutils lite
|
|||||||
<span class="n">triton</span><span class="o">.</span><span class="n">testing</span><span class="o">.</span><span class="n">Benchmark</span><span class="p">(</span>
|
<span class="n">triton</span><span class="o">.</span><span class="n">testing</span><span class="o">.</span><span class="n">Benchmark</span><span class="p">(</span>
|
||||||
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'N'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'N'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
||||||
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">256</span> <span class="o">*</span> <span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">50</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">256</span> <span class="o">*</span> <span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">50</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
||||||
<span class="n">y_name</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
<span class="n">line_arg</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
||||||
<span class="n">y_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'torch'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">,</span> <span class="s1">'naive'</span><span class="p">],</span> <span class="c1"># possible keys for `y_name`</span>
|
<span class="n">line_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'torch'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">,</span> <span class="s1">'naive'</span><span class="p">],</span> <span class="c1"># possible values for `line_arg``</span>
|
||||||
<span class="n">y_lines</span><span class="o">=</span><span class="p">[</span><span class="s2">"Torch"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">,</span> <span class="s1">'Naive'</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
<span class="n">line_names</span><span class="o">=</span><span class="p">[</span><span class="s2">"Torch"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">,</span> <span class="s1">'Naive'</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
||||||
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"GB/s"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"GB/s"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
||||||
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"softmax-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"softmax-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
||||||
<span class="n">args</span><span class="o">=</span><span class="p">{</span><span class="s1">'M'</span><span class="p">:</span> <span class="mi">4096</span><span class="p">}</span> <span class="c1"># values for function arguments not in `x_names` and `y_name`</span>
|
<span class="n">args</span><span class="o">=</span><span class="p">{</span><span class="s1">'M'</span><span class="p">:</span> <span class="mi">4096</span><span class="p">}</span> <span class="c1"># values for function arguments not in `x_names` and `y_name`</span>
|
||||||
@@ -343,7 +346,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 <strong>easier to read, understand and maintain</strong>.</p></li>
|
Note that our Triton kernel is not only faster than PyTorch’s CUDA kernel, it is also <strong>easier to read, understand and maintain</strong>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 20.176 seconds)</p>
|
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 20.250 seconds)</p>
|
||||||
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-02-fused-softmax-py">
|
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-02-fused-softmax-py">
|
||||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||||
<p><a class="reference download internal" download="" href="../../_downloads/d91442ac2982c4e0cc3ab0f43534afbc/02-fused-softmax.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">02-fused-softmax.py</span></code></a></p>
|
<p><a class="reference download internal" download="" href="../../_downloads/d91442ac2982c4e0cc3ab0f43534afbc/02-fused-softmax.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">02-fused-softmax.py</span></code></a></p>
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<link rel="index" title="Index" href="../../genindex.html" />
|
<link rel="index" title="Index" href="../../genindex.html" />
|
||||||
<link rel="search" title="Search" href="../../search.html" />
|
<link rel="search" title="Search" href="../../search.html" />
|
||||||
<link rel="next" title="Python API" href="../../language-reference/python-api/index.html" />
|
<link rel="next" title="triton" href="../../python-api/triton.html" />
|
||||||
<link rel="prev" title="Fused Softmax" href="02-fused-softmax.html" />
|
<link rel="prev" title="Fused Softmax" href="02-fused-softmax.html" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -113,9 +113,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -299,6 +301,7 @@ This can be done by ‘super-grouping’ blocks in groups of <code class="code d
|
|||||||
<h2>Final Result<a class="headerlink" href="#final-result" title="Permalink to this headline">¶</a></h2>
|
<h2>Final Result<a class="headerlink" href="#final-result" title="Permalink to this headline">¶</a></h2>
|
||||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">torch</span>
|
||||||
<span class="kn">import</span> <span class="nn">triton</span>
|
<span class="kn">import</span> <span class="nn">triton</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">triton.language</span> <span class="k">as</span> <span class="nn">tl</span>
|
||||||
|
|
||||||
<span class="c1"># %</span>
|
<span class="c1"># %</span>
|
||||||
<span class="c1"># :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:</span>
|
<span class="c1"># :code:`triton.jit`'ed functions can be auto-tuned by using the `triton.autotune` decorator, which consumes:</span>
|
||||||
@@ -308,9 +311,9 @@ This can be done by ‘super-grouping’ blocks in groups of <code class="code d
|
|||||||
|
|
||||||
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
||||||
<span class="k">def</span> <span class="nf">sigmoid</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
|
<span class="k">def</span> <span class="nf">sigmoid</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
|
||||||
<span class="n">ret_true</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">))</span>
|
<span class="n">ret_true</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">))</span>
|
||||||
<span class="n">ret_false</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
|
<span class="n">ret_false</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
|
||||||
<span class="k">return</span> <span class="n">triton</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">x</span> <span class="o">>=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ret_true</span><span class="p">,</span> <span class="n">ret_false</span><span class="p">)</span>
|
<span class="k">return</span> <span class="n">tl</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="n">x</span> <span class="o">>=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ret_true</span><span class="p">,</span> <span class="n">ret_false</span><span class="p">)</span>
|
||||||
|
|
||||||
|
|
||||||
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
<span class="nd">@triton</span><span class="o">.</span><span class="n">jit</span>
|
||||||
@@ -335,7 +338,7 @@ This can be done by ‘super-grouping’ blocks in groups of <code class="code d
|
|||||||
<span class="n">BLOCK_K</span> <span class="o">=</span> <span class="n">META</span><span class="p">[</span><span class="s1">'BLOCK_K'</span><span class="p">]</span>
|
<span class="n">BLOCK_K</span> <span class="o">=</span> <span class="n">META</span><span class="p">[</span><span class="s1">'BLOCK_K'</span><span class="p">]</span>
|
||||||
<span class="n">GROUP_M</span> <span class="o">=</span> <span class="mi">8</span>
|
<span class="n">GROUP_M</span> <span class="o">=</span> <span class="mi">8</span>
|
||||||
<span class="c1"># matrix multiplication</span>
|
<span class="c1"># matrix multiplication</span>
|
||||||
<span class="n">pid</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
<span class="n">pid</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">program_id</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
|
||||||
<span class="n">grid_m</span> <span class="o">=</span> <span class="p">(</span><span class="n">M</span> <span class="o">+</span> <span class="n">BLOCK_M</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">//</span> <span class="n">BLOCK_M</span>
|
<span class="n">grid_m</span> <span class="o">=</span> <span class="p">(</span><span class="n">M</span> <span class="o">+</span> <span class="n">BLOCK_M</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">//</span> <span class="n">BLOCK_M</span>
|
||||||
<span class="n">grid_n</span> <span class="o">=</span> <span class="p">(</span><span class="n">N</span> <span class="o">+</span> <span class="n">BLOCK_N</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">//</span> <span class="n">BLOCK_N</span>
|
<span class="n">grid_n</span> <span class="o">=</span> <span class="p">(</span><span class="n">N</span> <span class="o">+</span> <span class="n">BLOCK_N</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">//</span> <span class="n">BLOCK_N</span>
|
||||||
<span class="c1"># re-order program ID for better L2 performance</span>
|
<span class="c1"># re-order program ID for better L2 performance</span>
|
||||||
@@ -345,16 +348,16 @@ This can be done by ‘super-grouping’ blocks in groups of <code class="code d
|
|||||||
<span class="n">pid_m</span> <span class="o">=</span> <span class="n">group_id</span> <span class="o">*</span> <span class="n">GROUP_M</span> <span class="o">+</span> <span class="p">(</span><span class="n">pid</span> <span class="o">%</span> <span class="n">group_size</span><span class="p">)</span>
|
<span class="n">pid_m</span> <span class="o">=</span> <span class="n">group_id</span> <span class="o">*</span> <span class="n">GROUP_M</span> <span class="o">+</span> <span class="p">(</span><span class="n">pid</span> <span class="o">%</span> <span class="n">group_size</span><span class="p">)</span>
|
||||||
<span class="n">pid_n</span> <span class="o">=</span> <span class="p">(</span><span class="n">pid</span> <span class="o">%</span> <span class="n">width</span><span class="p">)</span> <span class="o">//</span> <span class="p">(</span><span class="n">group_size</span><span class="p">)</span>
|
<span class="n">pid_n</span> <span class="o">=</span> <span class="p">(</span><span class="n">pid</span> <span class="o">%</span> <span class="n">width</span><span class="p">)</span> <span class="o">//</span> <span class="p">(</span><span class="n">group_size</span><span class="p">)</span>
|
||||||
<span class="c1"># do matrix multiplication</span>
|
<span class="c1"># do matrix multiplication</span>
|
||||||
<span class="n">rm</span> <span class="o">=</span> <span class="n">pid_m</span> <span class="o">*</span> <span class="n">BLOCK_M</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_M</span><span class="p">)</span>
|
<span class="n">rm</span> <span class="o">=</span> <span class="n">pid_m</span> <span class="o">*</span> <span class="n">BLOCK_M</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_M</span><span class="p">)</span>
|
||||||
<span class="n">rn</span> <span class="o">=</span> <span class="n">pid_n</span> <span class="o">*</span> <span class="n">BLOCK_N</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">)</span>
|
<span class="n">rn</span> <span class="o">=</span> <span class="n">pid_n</span> <span class="o">*</span> <span class="n">BLOCK_N</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">)</span>
|
||||||
<span class="n">rk</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_K</span><span class="p">)</span>
|
<span class="n">rk</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_K</span><span class="p">)</span>
|
||||||
<span class="n">A</span> <span class="o">=</span> <span class="n">A</span> <span class="o">+</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_am</span> <span class="o">+</span> <span class="n">rk</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_ak</span><span class="p">)</span>
|
<span class="n">A</span> <span class="o">=</span> <span class="n">A</span> <span class="o">+</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_am</span> <span class="o">+</span> <span class="n">rk</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_ak</span><span class="p">)</span>
|
||||||
<span class="n">B</span> <span class="o">=</span> <span class="n">B</span> <span class="o">+</span> <span class="p">(</span><span class="n">rk</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_bk</span> <span class="o">+</span> <span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_bn</span><span class="p">)</span>
|
<span class="n">B</span> <span class="o">=</span> <span class="n">B</span> <span class="o">+</span> <span class="p">(</span><span class="n">rk</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_bk</span> <span class="o">+</span> <span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_bn</span><span class="p">)</span>
|
||||||
<span class="n">acc</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="n">BLOCK_M</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">triton</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
|
<span class="n">acc</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="n">BLOCK_M</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">tl</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
|
||||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">K</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="n">BLOCK_K</span><span class="p">):</span>
|
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">K</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="n">BLOCK_K</span><span class="p">):</span>
|
||||||
<span class="n">a</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
|
<span class="n">a</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
|
||||||
<span class="n">b</span> <span class="o">=</span> <span class="n">triton</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
|
<span class="n">b</span> <span class="o">=</span> <span class="n">tl</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
|
||||||
<span class="n">acc</span> <span class="o">+=</span> <span class="n">triton</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
|
<span class="n">acc</span> <span class="o">+=</span> <span class="n">tl</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
|
||||||
<span class="n">A</span> <span class="o">+=</span> <span class="n">BLOCK_K</span> <span class="o">*</span> <span class="n">stride_ak</span>
|
<span class="n">A</span> <span class="o">+=</span> <span class="n">BLOCK_K</span> <span class="o">*</span> <span class="n">stride_ak</span>
|
||||||
<span class="n">B</span> <span class="o">+=</span> <span class="n">BLOCK_K</span> <span class="o">*</span> <span class="n">stride_bk</span>
|
<span class="n">B</span> <span class="o">+=</span> <span class="n">BLOCK_K</span> <span class="o">*</span> <span class="n">stride_bk</span>
|
||||||
<span class="c1"># triton can accept arbitrary activation function</span>
|
<span class="c1"># triton can accept arbitrary activation function</span>
|
||||||
@@ -362,11 +365,11 @@ This can be done by ‘super-grouping’ blocks in groups of <code class="code d
|
|||||||
<span class="k">if</span> <span class="n">META</span><span class="p">[</span><span class="s1">'ACTIVATION'</span><span class="p">]:</span>
|
<span class="k">if</span> <span class="n">META</span><span class="p">[</span><span class="s1">'ACTIVATION'</span><span class="p">]:</span>
|
||||||
<span class="n">acc</span> <span class="o">=</span> <span class="n">META</span><span class="p">[</span><span class="s1">'ACTIVATION'</span><span class="p">](</span><span class="n">acc</span><span class="p">)</span>
|
<span class="n">acc</span> <span class="o">=</span> <span class="n">META</span><span class="p">[</span><span class="s1">'ACTIVATION'</span><span class="p">](</span><span class="n">acc</span><span class="p">)</span>
|
||||||
<span class="c1"># rematerialize rm and rn to save registers</span>
|
<span class="c1"># rematerialize rm and rn to save registers</span>
|
||||||
<span class="n">rm</span> <span class="o">=</span> <span class="n">pid_m</span> <span class="o">*</span> <span class="n">BLOCK_M</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_M</span><span class="p">)</span>
|
<span class="n">rm</span> <span class="o">=</span> <span class="n">pid_m</span> <span class="o">*</span> <span class="n">BLOCK_M</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_M</span><span class="p">)</span>
|
||||||
<span class="n">rn</span> <span class="o">=</span> <span class="n">pid_n</span> <span class="o">*</span> <span class="n">BLOCK_N</span> <span class="o">+</span> <span class="n">triton</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">)</span>
|
<span class="n">rn</span> <span class="o">=</span> <span class="n">pid_n</span> <span class="o">*</span> <span class="n">BLOCK_N</span> <span class="o">+</span> <span class="n">tl</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">BLOCK_N</span><span class="p">)</span>
|
||||||
<span class="n">C</span> <span class="o">=</span> <span class="n">C</span> <span class="o">+</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_cm</span> <span class="o">+</span> <span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_cn</span><span class="p">)</span>
|
<span class="n">C</span> <span class="o">=</span> <span class="n">C</span> <span class="o">+</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o">*</span> <span class="n">stride_cm</span> <span class="o">+</span> <span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o">*</span> <span class="n">stride_cn</span><span class="p">)</span>
|
||||||
<span class="n">mask</span> <span class="o">=</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o"><</span> <span class="n">M</span><span class="p">)</span> <span class="o">&</span> <span class="p">(</span><span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o"><</span> <span class="n">N</span><span class="p">)</span>
|
<span class="n">mask</span> <span class="o">=</span> <span class="p">(</span><span class="n">rm</span><span class="p">[:,</span> <span class="kc">None</span><span class="p">]</span> <span class="o"><</span> <span class="n">M</span><span class="p">)</span> <span class="o">&</span> <span class="p">(</span><span class="n">rn</span><span class="p">[</span><span class="kc">None</span><span class="p">,</span> <span class="p">:]</span> <span class="o"><</span> <span class="n">N</span><span class="p">)</span>
|
||||||
<span class="n">triton</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">C</span><span class="p">,</span> <span class="n">acc</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
<span class="n">tl</span><span class="o">.</span><span class="n">store</span><span class="p">(</span><span class="n">C</span><span class="p">,</span> <span class="n">acc</span><span class="p">,</span> <span class="n">mask</span><span class="o">=</span><span class="n">mask</span><span class="p">)</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p>We can also create a convenience wrapper function that only takes two input tensors
|
<p>We can also create a convenience wrapper function that only takes two input tensors
|
||||||
@@ -406,32 +409,32 @@ and (1) checks any shape constraint; (2) allocates the output; (3) launches the
|
|||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p class="sphx-glr-script-out">Out:</p>
|
<p class="sphx-glr-script-out">Out:</p>
|
||||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>tensor([[-5.9605e-08, 5.1094e+01, -1.8477e-05, ..., 2.6547e+01,
|
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>tensor([[-4.5061e-05, 4.1656e+01, 1.7500e+01, ..., -2.7405e-02,
|
||||||
-7.2598e-05, -4.2510e-04],
|
-2.3251e-03, -0.0000e+00],
|
||||||
[-2.7100e-01, -3.0220e-05, 5.9414e+00, ..., 2.8340e+00,
|
[-1.0967e-04, -4.2915e-06, -0.0000e+00, ..., -1.4901e-06,
|
||||||
-1.8644e-04, 1.3094e+01],
|
-0.0000e+00, 1.4367e+01],
|
||||||
[-1.5332e-01, 4.8125e+00, 8.4277e-01, ..., 3.6387e+00,
|
[ 5.8156e+01, -0.0000e+00, -1.4603e-04, ..., 1.3930e+01,
|
||||||
4.3375e+01, 1.6865e+00],
|
-2.1362e-01, 9.4062e+00],
|
||||||
...,
|
...,
|
||||||
[-0.0000e+00, 2.9453e+01, -4.7684e-07, ..., 6.2617e+00,
|
[ 2.3703e+01, -9.2163e-02, -1.3471e-05, ..., -9.5215e-02,
|
||||||
4.1133e+00, -0.0000e+00],
|
2.0047e+01, 1.4891e+01],
|
||||||
[ 1.6562e+01, -8.1539e-04, 1.3836e+01, ..., 1.9844e+00,
|
[-1.9073e-06, 5.0664e+00, -0.0000e+00, ..., 2.0281e+01,
|
||||||
-1.1238e-02, 8.4375e+00],
|
-1.7583e-05, 3.8000e+01],
|
||||||
[-1.0876e-01, -2.7295e-01, 3.2156e+01, ..., -1.6907e-02,
|
[-1.7285e-05, 5.3945e+00, -1.3916e-01, ..., -2.0984e-01,
|
||||||
-0.0000e+00, -0.0000e+00]], device='cuda:0', dtype=torch.float16)
|
5.3750e+00, -1.5993e-03]], device='cuda:0', dtype=torch.float16)
|
||||||
tensor([[-5.9605e-08, 5.1094e+01, -1.8537e-05, ..., 2.6547e+01,
|
tensor([[-4.4942e-05, 4.1656e+01, 1.7500e+01, ..., -2.7405e-02,
|
||||||
-7.2658e-05, -4.2605e-04],
|
-2.3232e-03, -0.0000e+00],
|
||||||
[-2.7100e-01, -3.0220e-05, 5.9414e+00, ..., 2.8340e+00,
|
[-1.1003e-04, -4.2915e-06, -0.0000e+00, ..., -1.4901e-06,
|
||||||
-1.8632e-04, 1.3094e+01],
|
-0.0000e+00, 1.4367e+01],
|
||||||
[-1.5332e-01, 4.8125e+00, 8.4277e-01, ..., 3.6387e+00,
|
[ 5.8156e+01, -0.0000e+00, -1.4639e-04, ..., 1.3930e+01,
|
||||||
4.3375e+01, 1.6875e+00],
|
-2.1362e-01, 9.4062e+00],
|
||||||
...,
|
...,
|
||||||
[-0.0000e+00, 2.9453e+01, -4.7684e-07, ..., 6.2617e+00,
|
[ 2.3703e+01, -9.2163e-02, -1.3471e-05, ..., -9.5276e-02,
|
||||||
4.1133e+00, -0.0000e+00],
|
2.0047e+01, 1.4891e+01],
|
||||||
[ 1.6562e+01, -8.1778e-04, 1.3836e+01, ..., 1.9844e+00,
|
[-1.9073e-06, 5.0664e+00, -0.0000e+00, ..., 2.0281e+01,
|
||||||
-1.1238e-02, 8.4375e+00],
|
-1.7583e-05, 3.8000e+01],
|
||||||
[-1.0876e-01, -2.7295e-01, 3.2156e+01, ..., -1.6891e-02,
|
[-1.7345e-05, 5.3945e+00, -1.3916e-01, ..., -2.0984e-01,
|
||||||
-0.0000e+00, -0.0000e+00]], device='cuda:0', dtype=torch.float16)
|
5.3750e+00, -1.6031e-03]], device='cuda:0', dtype=torch.float16)
|
||||||
tensor(True, device='cuda:0')
|
tensor(True, device='cuda:0')
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -445,9 +448,9 @@ tensor(True, device='cuda:0')
|
|||||||
<span class="n">triton</span><span class="o">.</span><span class="n">testing</span><span class="o">.</span><span class="n">Benchmark</span><span class="p">(</span>
|
<span class="n">triton</span><span class="o">.</span><span class="n">testing</span><span class="o">.</span><span class="n">Benchmark</span><span class="p">(</span>
|
||||||
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'M'</span><span class="p">,</span> <span class="s1">'N'</span><span class="p">,</span> <span class="s1">'K'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
<span class="n">x_names</span><span class="o">=</span><span class="p">[</span><span class="s1">'M'</span><span class="p">,</span> <span class="s1">'N'</span><span class="p">,</span> <span class="s1">'K'</span><span class="p">],</span> <span class="c1"># argument names to use as an x-axis for the plot</span>
|
||||||
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">256</span> <span class="o">*</span> <span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">33</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
<span class="n">x_vals</span><span class="o">=</span><span class="p">[</span><span class="mi">256</span> <span class="o">*</span> <span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">33</span><span class="p">)],</span> <span class="c1"># different possible values for `x_name`</span>
|
||||||
<span class="n">y_name</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
<span class="n">line_arg</span><span class="o">=</span><span class="s1">'provider'</span><span class="p">,</span> <span class="c1"># argument name whose value corresponds to a different line in the plot</span>
|
||||||
<span class="n">y_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'cublas'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">],</span> <span class="c1"># possible keys for `y_name`</span>
|
<span class="n">line_vals</span><span class="o">=</span><span class="p">[</span><span class="s1">'cublas'</span><span class="p">,</span> <span class="s1">'triton'</span><span class="p">],</span> <span class="c1"># possible values for `line_arg``</span>
|
||||||
<span class="n">y_lines</span><span class="o">=</span><span class="p">[</span><span class="s2">"cuBLAS"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
<span class="n">line_names</span><span class="o">=</span><span class="p">[</span><span class="s2">"cuBLAS"</span><span class="p">,</span> <span class="s2">"Triton"</span><span class="p">],</span> <span class="c1"># label name for the lines</span>
|
||||||
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"TFLOPS"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
<span class="n">ylabel</span><span class="o">=</span><span class="s2">"TFLOPS"</span><span class="p">,</span> <span class="c1"># label name for the y-axis</span>
|
||||||
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"matmul-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
<span class="n">plot_name</span><span class="o">=</span><span class="s2">"matmul-performance"</span><span class="p">,</span> <span class="c1"># name for the plot. Used also as a file name for saving the plot.</span>
|
||||||
<span class="n">args</span><span class="o">=</span><span class="p">{}</span>
|
<span class="n">args</span><span class="o">=</span><span class="p">{}</span>
|
||||||
@@ -465,7 +468,7 @@ tensor(True, device='cuda:0')
|
|||||||
<span class="k">return</span> <span class="n">perf</span><span class="p">(</span><span class="n">ms</span><span class="p">),</span> <span class="n">perf</span><span class="p">(</span><span class="n">max_ms</span><span class="p">),</span> <span class="n">perf</span><span class="p">(</span><span class="n">min_ms</span><span class="p">)</span>
|
<span class="k">return</span> <span class="n">perf</span><span class="p">(</span><span class="n">ms</span><span class="p">),</span> <span class="n">perf</span><span class="p">(</span><span class="n">max_ms</span><span class="p">),</span> <span class="n">perf</span><span class="p">(</span><span class="n">min_ms</span><span class="p">)</span>
|
||||||
|
|
||||||
|
|
||||||
<span class="n">benchmark</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">print_data</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
<span class="n">benchmark</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">show_plots</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">print_data</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<img alt="03 matrix multiplication" class="sphx-glr-single-img" src="../../_images/sphx_glr_03-matrix-multiplication_001.png" />
|
<img alt="03 matrix multiplication" class="sphx-glr-single-img" src="../../_images/sphx_glr_03-matrix-multiplication_001.png" />
|
||||||
@@ -473,38 +476,38 @@ tensor(True, device='cuda:0')
|
|||||||
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span> M cuBLAS Triton
|
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span> M cuBLAS Triton
|
||||||
0 512.0 20.164923 15.420235
|
0 512.0 20.164923 15.420235
|
||||||
1 768.0 58.982401 40.215272
|
1 768.0 58.982401 40.215272
|
||||||
2 1024.0 91.180520 72.315584
|
2 1024.0 95.325090 72.315584
|
||||||
3 1280.0 157.538463 117.028568
|
3 1280.0 151.703703 117.028568
|
||||||
4 1536.0 153.867127 144.446699
|
4 1536.0 153.867127 150.593357
|
||||||
5 1792.0 208.137481 190.498706
|
5 1792.0 208.137481 190.498706
|
||||||
6 2048.0 199.728763 152.520144
|
6 2048.0 202.135135 151.146088
|
||||||
7 2304.0 246.266731 178.267699
|
7 2304.0 251.451276 178.267699
|
||||||
8 2560.0 235.741014 215.578957
|
8 2560.0 237.449270 218.453323
|
||||||
9 2816.0 231.990461 198.246398
|
9 2816.0 238.329010 200.987140
|
||||||
10 3072.0 236.916752 221.184001
|
10 3072.0 243.017615 223.806730
|
||||||
11 3328.0 239.173747 210.500857
|
11 3328.0 244.868356 210.500857
|
||||||
12 3584.0 248.385067 230.552287
|
12 3584.0 250.460703 232.941430
|
||||||
13 3840.0 251.917998 222.519114
|
13 3840.0 256.593972 225.697957
|
||||||
14 4096.0 263.172024 244.032234
|
14 4096.0 266.305018 247.634187
|
||||||
15 4352.0 249.595626 232.307632
|
15 4352.0 247.675667 237.797917
|
||||||
16 4608.0 276.560014 254.803966
|
16 4608.0 280.621108 260.713476
|
||||||
17 4864.0 266.614125 245.366501
|
17 4864.0 272.431168 252.534501
|
||||||
18 5120.0 257.003930 238.096276
|
18 5120.0 265.596772 245.223576
|
||||||
19 5376.0 252.676487 236.527241
|
19 5376.0 261.381955 244.335299
|
||||||
20 5632.0 270.057027 248.514009
|
20 5632.0 283.439220 260.383339
|
||||||
21 5888.0 264.206935 242.511113
|
21 5888.0 276.674704 254.103421
|
||||||
22 6144.0 259.441481 241.205983
|
22 6144.0 274.869441 252.078378
|
||||||
23 6400.0 257.157204 235.078047
|
23 6400.0 269.190319 249.027231
|
||||||
24 6656.0 254.161678 232.699140
|
24 6656.0 269.252160 249.104840
|
||||||
25 6912.0 251.844029 233.178785
|
25 6912.0 267.069377 247.115909
|
||||||
26 7168.0 253.282797 231.740709
|
26 7168.0 268.504352 246.006552
|
||||||
27 7424.0 251.868505 230.377264
|
27 7424.0 267.373291 246.355964
|
||||||
28 7680.0 250.988932 231.606284
|
28 7680.0 266.406511 245.760004
|
||||||
29 7936.0 253.293068 229.692102
|
29 7936.0 228.348876 248.331598
|
||||||
30 8192.0 253.002304 231.360005
|
30 8192.0 227.680622 247.977332
|
||||||
</pre></div>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 32.933 seconds)</p>
|
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> ( 0 minutes 37.657 seconds)</p>
|
||||||
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-03-matrix-multiplication-py">
|
<div class="sphx-glr-footer class sphx-glr-footer-example docutils container" id="sphx-glr-download-getting-started-tutorials-03-matrix-multiplication-py">
|
||||||
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
<div class="sphx-glr-download sphx-glr-download-python docutils container">
|
||||||
<p><a class="reference download internal" download="" href="../../_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">03-matrix-multiplication.py</span></code></a></p>
|
<p><a class="reference download internal" download="" href="../../_downloads/d5fee5b55a64e47f1b5724ec39adf171/03-matrix-multiplication.py"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Python</span> <span class="pre">source</span> <span class="pre">code:</span> <span class="pre">03-matrix-multiplication.py</span></code></a></p>
|
||||||
@@ -524,7 +527,7 @@ tensor(True, device='cuda:0')
|
|||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||||||
<a href="../../language-reference/python-api/index.html" class="btn btn-neutral float-right" title="Python API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
<a href="../../python-api/triton.html" class="btn btn-neutral float-right" title="triton" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||||||
<a href="02-fused-softmax.html" class="btn btn-neutral float-left" title="Fused Softmax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
<a href="02-fused-softmax.html" class="btn btn-neutral float-left" title="Fused Softmax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -99,9 +99,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@@ -92,9 +92,11 @@
|
|||||||
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="index.html">Tutorials</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="index.html">Tutorials</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="../../python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -169,7 +171,7 @@
|
|||||||
|
|
||||||
<div class="section" id="computation-times">
|
<div class="section" id="computation-times">
|
||||||
<span id="sphx-glr-getting-started-tutorials-sg-execution-times"></span><h1>Computation times<a class="headerlink" href="#computation-times" title="Permalink to this headline">¶</a></h1>
|
<span id="sphx-glr-getting-started-tutorials-sg-execution-times"></span><h1>Computation times<a class="headerlink" href="#computation-times" title="Permalink to this headline">¶</a></h1>
|
||||||
<p><strong>01:00.154</strong> total execution time for <strong>getting-started_tutorials</strong> files:</p>
|
<p><strong>00:37.657</strong> total execution time for <strong>getting-started_tutorials</strong> files:</p>
|
||||||
<table class="docutils align-default">
|
<table class="docutils align-default">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style="width: 85%" />
|
<col style="width: 85%" />
|
||||||
@@ -178,15 +180,15 @@
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="row-odd"><td><p><a class="reference internal" href="03-matrix-multiplication.html#sphx-glr-getting-started-tutorials-03-matrix-multiplication-py"><span class="std std-ref">Matrix Multiplication</span></a> (<code class="docutils literal notranslate"><span class="pre">03-matrix-multiplication.py</span></code>)</p></td>
|
<tr class="row-odd"><td><p><a class="reference internal" href="03-matrix-multiplication.html#sphx-glr-getting-started-tutorials-03-matrix-multiplication-py"><span class="std std-ref">Matrix Multiplication</span></a> (<code class="docutils literal notranslate"><span class="pre">03-matrix-multiplication.py</span></code>)</p></td>
|
||||||
<td><p>00:32.933</p></td>
|
<td><p>00:37.657</p></td>
|
||||||
<td><p>0.0 MB</p></td>
|
<td><p>0.0 MB</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="row-even"><td><p><a class="reference internal" href="02-fused-softmax.html#sphx-glr-getting-started-tutorials-02-fused-softmax-py"><span class="std std-ref">Fused Softmax</span></a> (<code class="docutils literal notranslate"><span class="pre">02-fused-softmax.py</span></code>)</p></td>
|
<tr class="row-even"><td><p><a class="reference internal" href="01-vector-add.html#sphx-glr-getting-started-tutorials-01-vector-add-py"><span class="std std-ref">Vector Addition</span></a> (<code class="docutils literal notranslate"><span class="pre">01-vector-add.py</span></code>)</p></td>
|
||||||
<td><p>00:20.176</p></td>
|
<td><p>00:00.000</p></td>
|
||||||
<td><p>0.0 MB</p></td>
|
<td><p>0.0 MB</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="row-odd"><td><p><a class="reference internal" href="01-vector-add.html#sphx-glr-getting-started-tutorials-01-vector-add-py"><span class="std std-ref">Vector Addition</span></a> (<code class="docutils literal notranslate"><span class="pre">01-vector-add.py</span></code>)</p></td>
|
<tr class="row-odd"><td><p><a class="reference internal" href="02-fused-softmax.html#sphx-glr-getting-started-tutorials-02-fused-softmax-py"><span class="std std-ref">Fused Softmax</span></a> (<code class="docutils literal notranslate"><span class="pre">02-fused-softmax.py</span></code>)</p></td>
|
||||||
<td><p>00:07.044</p></td>
|
<td><p>00:00.000</p></td>
|
||||||
<td><p>0.0 MB</p></td>
|
<td><p>0.0 MB</p></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
16
index.html
@@ -93,9 +93,11 @@
|
|||||||
<li class="toctree-l1"><a class="reference internal" href="getting-started/installation.html">Installation</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="getting-started/installation.html">Installation</a></li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="getting-started/tutorials/index.html">Tutorials</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="getting-started/tutorials/index.html">Tutorials</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
<p class="caption"><span class="caption-text">Python API</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="language-reference/python-api/index.html">Python API</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.html">triton</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.language.html">triton.language</a></li>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="python-api/triton.testing.html">triton.testing</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -170,7 +172,7 @@
|
|||||||
|
|
||||||
<div class="section" id="welcome-to-triton-s-documentation">
|
<div class="section" id="welcome-to-triton-s-documentation">
|
||||||
<h1>Welcome to Triton’s documentation!<a class="headerlink" href="#welcome-to-triton-s-documentation" title="Permalink to this headline">¶</a></h1>
|
<h1>Welcome to Triton’s documentation!<a class="headerlink" href="#welcome-to-triton-s-documentation" title="Permalink to this headline">¶</a></h1>
|
||||||
<p>Triton is an imperative language and compiler for parallel programming. It aims to provide a programming environment for productively writing custom DNN compute kernels capable of running at maximal throughput on modern GPU hardware.</p>
|
<p>Triton is an language and compiler for parallel programming. It aims to provide a Python-based programming environment for productively writing custom DNN compute kernels capable of running at maximal throughput on modern GPU hardware.</p>
|
||||||
<div class="section" id="getting-started">
|
<div class="section" id="getting-started">
|
||||||
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
|
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
@@ -180,10 +182,12 @@
|
|||||||
<div class="toctree-wrapper compound">
|
<div class="toctree-wrapper compound">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="language-reference">
|
<div class="section" id="python-api">
|
||||||
<h2>Language Reference<a class="headerlink" href="#language-reference" title="Permalink to this headline">¶</a></h2>
|
<h2>Python API<a class="headerlink" href="#python-api" title="Permalink to this headline">¶</a></h2>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li><p>Checkout the <a class="reference internal" href="language-reference/python-api/index.html"><span class="doc">Python API Documentation</span></a></p></li>
|
<li><p><a class="reference internal" href="python-api/triton.html"><span class="doc">triton</span></a></p></li>
|
||||||
|
<li><p><a class="reference internal" href="python-api/triton.language.html"><span class="doc">triton.language</span></a></p></li>
|
||||||
|
<li><p><a class="reference internal" href="python-api/triton.testing.html"><span class="doc">triton.testing</span></a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="toctree-wrapper compound">
|
<div class="toctree-wrapper compound">
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,257 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.arange — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.zeros" href="triton.zeros.html" />
|
|
||||||
<link rel="prev" title="triton.num_programs" href="triton.num_programs.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.arange</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.zeros.html">triton.zeros</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.arange</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.arange.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-arange">
|
|
||||||
<h1>triton.arange<a class="headerlink" href="#triton-arange" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.arange">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">arange</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">start</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.arange" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns contiguous values within the open interval [<code class="code docutils literal notranslate"><span class="pre">start</span></code>, <code class="code docutils literal notranslate"><span class="pre">end</span></code>).</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>start</strong> (<em>int</em>) – Start of the interval. Must be a power of two.</p></li>
|
|
||||||
<li><p><strong>stop</strong> (<em>int</em>) – End of the interval. Must be a power of two >= start.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.zeros.html" class="btn btn-neutral float-right" title="triton.zeros" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.num_programs.html" class="btn btn-neutral float-left" title="triton.num_programs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,260 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.atomic_cas — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.atomic_xchg" href="triton.atomic_xchg.html" />
|
|
||||||
<link rel="prev" title="triton.store" href="triton.store.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.load.html">triton.load</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.store.html">triton.store</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.atomic_cas</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_xchg.html">triton.atomic_xchg</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.atomic_cas</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.atomic_cas.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-atomic-cas">
|
|
||||||
<h1>triton.atomic_cas<a class="headerlink" href="#triton-atomic-cas" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.atomic_cas">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">atomic_cas</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pointer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cmp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.atomic_cas" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Performs an atomic “compare-and-swap” and the memory locations specified by <code class="code docutils literal notranslate"><span class="pre">pointer</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>pointer</strong> (<em>Block of dtype=triton.PointerDType</em>) – The memory locations to compare-and-swap.</p></li>
|
|
||||||
<li><p><strong>cmp</strong> (<em>Block of dtype=`pointer.dtype.element_ty`</em>) – The values expected to be found in the atomic object</p></li>
|
|
||||||
<li><p><strong>val</strong> (<em>Block of dtype=`pointer.dtype.element_ty`</em>) – The values to copy in case the expected value matches the contained value.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.atomic_xchg.html" class="btn btn-neutral float-right" title="triton.atomic_xchg" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.store.html" class="btn btn-neutral float-left" title="triton.store" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,259 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.atomic_xchg — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.where" href="triton.where.html" />
|
|
||||||
<link rel="prev" title="triton.atomic_cas" href="triton.atomic_cas.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.load.html">triton.load</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.store.html">triton.store</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_cas.html">triton.atomic_cas</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.atomic_xchg</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.atomic_xchg</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.atomic_xchg.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-atomic-xchg">
|
|
||||||
<h1>triton.atomic_xchg<a class="headerlink" href="#triton-atomic-xchg" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.atomic_xchg">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">atomic_xchg</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pointer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">val</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.atomic_xchg" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Swaps the <em>old</em> values stored at location <code class="code docutils literal notranslate"><span class="pre">pointer</span></code> with the new values given by <code class="code docutils literal notranslate"><span class="pre">val</span></code>. Returns the old values.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>pointer</strong> (<em>Block of dtype=triton.PointerDType</em>) – The memory locations which contain the old values</p></li>
|
|
||||||
<li><p><strong>val</strong> (<em>Block of dtype=`pointer.dtype.element_ty`</em>) – The new values to store</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.where.html" class="btn btn-neutral float-right" title="triton.where" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.atomic_cas.html" class="btn btn-neutral float-left" title="triton.atomic_cas" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.broadcast_to — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.reshape" href="triton.reshape.html" />
|
|
||||||
<link rel="prev" title="triton.zeros" href="triton.zeros.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.broadcast_to</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.reshape.html">triton.reshape</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.ravel.html">triton.ravel</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.broadcast_to</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.broadcast_to.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-broadcast-to">
|
|
||||||
<h1>triton.broadcast_to<a class="headerlink" href="#triton-broadcast-to" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.broadcast_to">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">broadcast_to</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shape</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.broadcast_to" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Tries to broadcast the given block to a new <code class="code docutils literal notranslate"><span class="pre">shape</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> (<em>Block</em>) – The input block.</p></li>
|
|
||||||
<li><p><strong>shape</strong> (<em>Tuple</em><em>[</em><em>int</em><em>]</em>) – The desired shape.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.reshape.html" class="btn btn-neutral float-right" title="triton.reshape" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.zeros.html" class="btn btn-neutral float-left" title="triton.zeros" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,257 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.dot — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.load" href="triton.load.html" />
|
|
||||||
<link rel="prev" title="triton.ravel" href="triton.ravel.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.dot</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.dot</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.dot.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-dot">
|
|
||||||
<h1>triton.dot<a class="headerlink" href="#triton-dot" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.dot">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">dot</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">other</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.dot" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the matrix product of two blocks.</p>
|
|
||||||
<p>The two blocks must be two dimensionals and have compatible inner dimensions.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> (2D block of scalar-type in {<code class="code docutils literal notranslate"><span class="pre">float16</span></code>, <code class="code docutils literal notranslate"><span class="pre">float32</span></code>}) – The first block to be multiplied.</p></li>
|
|
||||||
<li><p><strong>other</strong> (2D block of scalar-type in {<code class="code docutils literal notranslate"><span class="pre">float16</span></code>, <code class="code docutils literal notranslate"><span class="pre">float32</span></code>}) – The second block to be multiplied.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.load.html" class="btn btn-neutral float-right" title="triton.load" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.ravel.html" class="btn btn-neutral float-left" title="triton.ravel" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.exp — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.log" href="triton.log.html" />
|
|
||||||
<link rel="prev" title="triton.where" href="triton.where.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#math-ops">Math Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.exp</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.log.html">triton.log</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.sigmoid.html">triton.sigmoid</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.softmax.html">triton.softmax</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.exp</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.exp.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-exp">
|
|
||||||
<h1>triton.exp<a class="headerlink" href="#triton-exp" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.exp">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">exp</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.exp" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise exponential of <code class="code docutils literal notranslate"><span class="pre">x</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>x</strong> (<em>Block</em>) – the input values</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.log.html" class="btn btn-neutral float-right" title="triton.log" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.where.html" class="btn btn-neutral float-left" title="triton.where" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,262 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.load — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.store" href="triton.store.html" />
|
|
||||||
<link rel="prev" title="triton.dot" href="triton.dot.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.load</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.store.html">triton.store</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_cas.html">triton.atomic_cas</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_xchg.html">triton.atomic_xchg</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.load</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.load.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-load">
|
|
||||||
<h1>triton.load<a class="headerlink" href="#triton-load" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.load">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">load</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pointer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">other</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.load" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Return a block of data whose values are, elementwise, loaded from memory at location defined by <code class="code docutils literal notranslate"><span class="pre">pointer</span></code>.</p>
|
|
||||||
<p><code class="code docutils literal notranslate"><span class="pre">mask</span></code> and <code class="code docutils literal notranslate"><span class="pre">other</span></code> are implicitly broadcast to <code class="code docutils literal notranslate"><span class="pre">pointer.shape</span></code>.</p>
|
|
||||||
<p><code class="code docutils literal notranslate"><span class="pre">other</span></code> is implicitly typecast to <code class="code docutils literal notranslate"><span class="pre">pointer.dtype.element_ty</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>pointer</strong> (<em>Block of dtype=triton.PointerDType</em>) – Pointers to the data to be loaded.</p></li>
|
|
||||||
<li><p><strong>mask</strong> (<em>Block of triton.int1</em><em>, </em><em>optional</em>) – if mask[idx] is false, do not load the data at address <code class="code docutils literal notranslate"><span class="pre">pointer[idx]</span></code>.</p></li>
|
|
||||||
<li><p><strong>other</strong> (<em>Block</em><em>, </em><em>optional</em>) – if mask[idx] is false, return other[idx]</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.store.html" class="btn btn-neutral float-right" title="triton.store" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.dot.html" class="btn btn-neutral float-left" title="triton.dot" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.log — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.sigmoid" href="triton.sigmoid.html" />
|
|
||||||
<link rel="prev" title="triton.exp" href="triton.exp.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#math-ops">Math Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.exp.html">triton.exp</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.log</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.sigmoid.html">triton.sigmoid</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.softmax.html">triton.softmax</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.log</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.log.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-log">
|
|
||||||
<h1>triton.log<a class="headerlink" href="#triton-log" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.log">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">log</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.log" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise natural logarithm of <code class="code docutils literal notranslate"><span class="pre">x</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>x</strong> (<em>Block</em>) – the input values</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.sigmoid.html" class="btn btn-neutral float-right" title="triton.sigmoid" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.exp.html" class="btn btn-neutral float-left" title="triton.exp" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.max — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.min" href="triton.min.html" />
|
|
||||||
<link rel="prev" title="triton.softmax" href="triton.softmax.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.max</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.min.html">triton.min</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.sum.html">triton.sum</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.max</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.max.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-max">
|
|
||||||
<h1>triton.max<a class="headerlink" href="#triton-max" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.max">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">max</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.max" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the maximum value of all elements in the <code class="code docutils literal notranslate"><span class="pre">input</span></code> block along the provided <code class="code docutils literal notranslate"><span class="pre">axis</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> – the input values</p></li>
|
|
||||||
<li><p><strong>axis</strong> – the dimension along which the reduction should be done</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.min.html" class="btn btn-neutral float-right" title="triton.min" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.softmax.html" class="btn btn-neutral float-left" title="triton.softmax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,256 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.maximum — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.multiple_of" href="triton.multiple_of.html" />
|
|
||||||
<link rel="prev" title="triton.minimum" href="triton.minimum.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.minimum.html">triton.minimum</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.maximum</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.maximum</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.maximum.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-maximum">
|
|
||||||
<h1>triton.maximum<a class="headerlink" href="#triton-maximum" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.maximum">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">maximum</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.maximum" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise maximum of <code class="code docutils literal notranslate"><span class="pre">x</span></code> and <code class="code docutils literal notranslate"><span class="pre">y</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> (<em>Block</em>) – the first input block</p></li>
|
|
||||||
<li><p><strong>other</strong> (<em>Block</em>) – the second input block</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.multiple_of.html" class="btn btn-neutral float-right" title="triton.multiple_of" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.minimum.html" class="btn btn-neutral float-left" title="triton.minimum" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.min — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.sum" href="triton.sum.html" />
|
|
||||||
<link rel="prev" title="triton.max" href="triton.max.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.max.html">triton.max</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.min</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.sum.html">triton.sum</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.min</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.min.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-min">
|
|
||||||
<h1>triton.min<a class="headerlink" href="#triton-min" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.min">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">min</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.min" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the minimum value of all elements in the <code class="code docutils literal notranslate"><span class="pre">input</span></code> block along the provided <code class="code docutils literal notranslate"><span class="pre">axis</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> – the input values</p></li>
|
|
||||||
<li><p><strong>axis</strong> – the dimension along which the reduction should be done</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.sum.html" class="btn btn-neutral float-right" title="triton.sum" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.max.html" class="btn btn-neutral float-left" title="triton.max" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,256 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.minimum — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.maximum" href="triton.maximum.html" />
|
|
||||||
<link rel="prev" title="triton.sum" href="triton.sum.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.minimum</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.maximum.html">triton.maximum</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.minimum</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.minimum.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-minimum">
|
|
||||||
<h1>triton.minimum<a class="headerlink" href="#triton-minimum" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.minimum">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">minimum</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.minimum" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise minimum of <code class="code docutils literal notranslate"><span class="pre">x</span></code> and <code class="code docutils literal notranslate"><span class="pre">y</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> (<em>Block</em>) – the first input block</p></li>
|
|
||||||
<li><p><strong>other</strong> (<em>Block</em>) – the second input block</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.maximum.html" class="btn btn-neutral float-right" title="triton.maximum" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.sum.html" class="btn btn-neutral float-left" title="triton.sum" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,249 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.multiple_of — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="Introduction" href="../../../programming-guide/chapter-1/introduction.html" />
|
|
||||||
<link rel="prev" title="triton.maximum" href="triton.maximum.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.multiple_of</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.multiple_of</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.multiple_of.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-multiple-of">
|
|
||||||
<h1>triton.multiple_of<a class="headerlink" href="#triton-multiple-of" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.multiple_of">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">multiple_of</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.multiple_of" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Let the compiler knows that the values in <code class="code docutils literal notranslate"><span class="pre">input</span></code> are all multiples of <code class="code docutils literal notranslate"><span class="pre">value</span></code>.
|
|
||||||
:param builder: IR builder to generate code into
|
|
||||||
:type builder: triton.ir.builder, optional from within JIT’ed functions</p>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="../../../programming-guide/chapter-1/introduction.html" class="btn btn-neutral float-right" title="Introduction" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.maximum.html" class="btn btn-neutral float-left" title="triton.maximum" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,256 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.num_programs — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.arange" href="triton.arange.html" />
|
|
||||||
<link rel="prev" title="triton.program_id" href="triton.program_id.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#programming-model">Programming Model</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.program_id.html">triton.program_id</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.num_programs</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.num_programs</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.num_programs.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-num-programs">
|
|
||||||
<h1>triton.num_programs<a class="headerlink" href="#triton-num-programs" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.num_programs">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">num_programs</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.num_programs" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the number of program instances launched along the given <code class="code docutils literal notranslate"><span class="pre">axis</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>axis</strong> (<em>int</em>) – The axis of the 3D launch grid. Has to be either 0, 1 or 2.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.arange.html" class="btn btn-neutral float-right" title="triton.arange" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.program_id.html" class="btn btn-neutral float-left" title="triton.program_id" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,256 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.program_id — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.num_programs" href="triton.num_programs.html" />
|
|
||||||
<link rel="prev" title="Python API" href="../index.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#programming-model">Programming Model</a><ul class="current">
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.program_id</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.num_programs.html">triton.num_programs</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.program_id</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.program_id.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-program-id">
|
|
||||||
<h1>triton.program_id<a class="headerlink" href="#triton-program-id" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.program_id">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">program_id</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.program_id" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the id of the current program instance along the given <code class="code docutils literal notranslate"><span class="pre">axis</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>axis</strong> (<em>int</em>) – The axis of the 3D launch grid. Has to be either 0, 1 or 2.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.num_programs.html" class="btn btn-neutral float-right" title="triton.num_programs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="../index.html" class="btn btn-neutral float-left" title="Python API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,254 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.ravel — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.dot" href="triton.dot.html" />
|
|
||||||
<link rel="prev" title="triton.reshape" href="triton.reshape.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.broadcast_to.html">triton.broadcast_to</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.reshape.html">triton.reshape</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.ravel</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.ravel</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.ravel.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-ravel">
|
|
||||||
<h1>triton.ravel<a class="headerlink" href="#triton-ravel" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.ravel">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">ravel</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.ravel" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns a contiguous flattened view of <code class="code docutils literal notranslate"><span class="pre">x</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><p><strong>x</strong> (<em>Block</em>) – the input block</p>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.dot.html" class="btn btn-neutral float-right" title="triton.dot" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.reshape.html" class="btn btn-neutral float-left" title="triton.reshape" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.reshape — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.ravel" href="triton.ravel.html" />
|
|
||||||
<link rel="prev" title="triton.broadcast_to" href="triton.broadcast_to.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.broadcast_to.html">triton.broadcast_to</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.reshape</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.ravel.html">triton.ravel</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.reshape</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.reshape.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-reshape">
|
|
||||||
<h1>triton.reshape<a class="headerlink" href="#triton-reshape" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.reshape">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">reshape</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shape</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.reshape" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Tries to reshape the given block to a new shape.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> – The input block.</p></li>
|
|
||||||
<li><p><strong>shape</strong> (<em>Tuple</em><em>[</em><em>int</em><em>]</em>) – The desired shape.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.ravel.html" class="btn btn-neutral float-right" title="triton.ravel" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.broadcast_to.html" class="btn btn-neutral float-left" title="triton.broadcast_to" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,255 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.sigmoid — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.softmax" href="triton.softmax.html" />
|
|
||||||
<link rel="prev" title="triton.log" href="triton.log.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#math-ops">Math Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.exp.html">triton.exp</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.log.html">triton.log</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.sigmoid</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.softmax.html">triton.softmax</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.sigmoid</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.sigmoid.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-sigmoid">
|
|
||||||
<h1>triton.sigmoid<a class="headerlink" href="#triton-sigmoid" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.sigmoid">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">sigmoid</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.sigmoid" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise sigmoid of <code class="code docutils literal notranslate"><span class="pre">x</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><p><strong>x</strong> (<em>Block</em>) – the input block</p>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.softmax.html" class="btn btn-neutral float-right" title="triton.softmax" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.log.html" class="btn btn-neutral float-left" title="triton.log" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,255 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.softmax — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.max" href="triton.max.html" />
|
|
||||||
<link rel="prev" title="triton.sigmoid" href="triton.sigmoid.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#math-ops">Math Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.exp.html">triton.exp</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.log.html">triton.log</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.sigmoid.html">triton.sigmoid</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.softmax</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.softmax</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.softmax.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-softmax">
|
|
||||||
<h1>triton.softmax<a class="headerlink" href="#triton-softmax" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.softmax">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">softmax</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.softmax" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Computes the element-wise softmax of <code class="code docutils literal notranslate"><span class="pre">x</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><p><strong>x</strong> (<em>Block</em>) – the input block</p>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.max.html" class="btn btn-neutral float-right" title="triton.max" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.sigmoid.html" class="btn btn-neutral float-left" title="triton.sigmoid" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,261 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.store — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.atomic_cas" href="triton.atomic_cas.html" />
|
|
||||||
<link rel="prev" title="triton.load" href="triton.load.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.load.html">triton.load</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.store</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_cas.html">triton.atomic_cas</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.atomic_xchg.html">triton.atomic_xchg</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.store</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.store.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-store">
|
|
||||||
<h1>triton.store<a class="headerlink" href="#triton-store" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.store">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">store</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pointer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.store" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Stores <code class="code docutils literal notranslate"><span class="pre">value</span></code> block of elements in memory, element-wise, at the memory locations specified by <code class="code docutils literal notranslate"><span class="pre">pointer</span></code>.</p>
|
|
||||||
<p><code class="code docutils literal notranslate"><span class="pre">value</span></code> is implicitly broadcast to <code class="code docutils literal notranslate"><span class="pre">pointer.shape</span></code> and typecast to <code class="code docutils literal notranslate"><span class="pre">pointer.dtype.element_ty</span></code>.</p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>pointer</strong> (<em>Block of dtype=triton.PointerDType</em>) – The memory locations where the elements of <code class="code docutils literal notranslate"><span class="pre">value</span></code> are stored.</p></li>
|
|
||||||
<li><p><strong>value</strong> (<em>Block</em>) – The block of elements to be stored.</p></li>
|
|
||||||
<li><p><strong>mask</strong> (<em>Block of triton.int1</em><em>, </em><em>optional</em>) – If mask[idx] is false, do not store <code class="code docutils literal notranslate"><span class="pre">value[idx]</span></code> at <code class="code docutils literal notranslate"><span class="pre">pointer[idx]</span></code>.</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.atomic_cas.html" class="btn btn-neutral float-right" title="triton.atomic_cas" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.load.html" class="btn btn-neutral float-left" title="triton.load" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,258 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="writer-html5" lang="en" >
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
|
|
||||||
<title>triton.sum — Triton documentation</title>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-binder.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-dataframe.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/gallery-rendered-html.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="../../../_static/js/html5shiv.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
|
|
||||||
<script src="../../../_static/jquery.js"></script>
|
|
||||||
<script src="../../../_static/underscore.js"></script>
|
|
||||||
<script src="../../../_static/doctools.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
|
||||||
<link rel="search" title="Search" href="../../../search.html" />
|
|
||||||
<link rel="next" title="triton.minimum" href="triton.minimum.html" />
|
|
||||||
<link rel="prev" title="triton.min" href="triton.min.html" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
||||||
<div class="wy-side-scroll">
|
|
||||||
<div class="wy-side-nav-search" >
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../index.html" class="icon icon-home"> Triton
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="search">
|
|
||||||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
<input type="hidden" name="check_keywords" value="yes" />
|
|
||||||
<input type="hidden" name="area" value="default" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/installation.html">Installation</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../getting-started/tutorials/index.html">Tutorials</a></li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Language Reference</span></p>
|
|
||||||
<ul class="current">
|
|
||||||
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python API</a><ul class="current">
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#programming-model">Programming Model</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#creation-ops">Creation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#shape-manipulation-ops">Shape Manipulation Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#linear-algebra-ops">Linear Algebra Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#memory-ops">Memory Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#indexing-ops">Indexing Ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#math-ops">Math Ops</a></li>
|
|
||||||
<li class="toctree-l2 current"><a class="reference internal" href="../index.html#reduction-ops">Reduction Ops</a><ul class="current">
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.max.html">triton.max</a></li>
|
|
||||||
<li class="toctree-l3"><a class="reference internal" href="triton.min.html">triton.min</a></li>
|
|
||||||
<li class="toctree-l3 current"><a class="current reference internal" href="#">triton.sum</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#comparison-ops">Comparison ops</a></li>
|
|
||||||
<li class="toctree-l2"><a class="reference internal" href="../index.html#compiler-hint-ops">Compiler Hint Ops</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p class="caption"><span class="caption-text">Programming Guide</span></p>
|
|
||||||
<ul>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-1/introduction.html">Introduction</a></li>
|
|
||||||
<li class="toctree-l1"><a class="reference internal" href="../../../programming-guide/chapter-2/related-work.html">Related Work</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" aria-label="top navigation">
|
|
||||||
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="../../../index.html">Triton</a>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
|
|
||||||
<div class="rst-content">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
|
|
||||||
<li><a href="../../../index.html" class="icon icon-home"></a> »</li>
|
|
||||||
|
|
||||||
<li><a href="../index.html">Python API</a> »</li>
|
|
||||||
|
|
||||||
<li>triton.sum</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../../../_sources/language-reference/python-api/generated/triton.sum.rst.txt" rel="nofollow"> View page source</a>
|
|
||||||
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
||||||
<div itemprop="articleBody">
|
|
||||||
|
|
||||||
<div class="section" id="triton-sum">
|
|
||||||
<h1>triton.sum<a class="headerlink" href="#triton-sum" title="Permalink to this headline">¶</a></h1>
|
|
||||||
<dl class="py function">
|
|
||||||
<dt id="triton.sum">
|
|
||||||
<code class="sig-prename descclassname"><span class="pre">triton.</span></code><code class="sig-name descname"><span class="pre">sum</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">builder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#triton.sum" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd><p>Returns the sum of all elements in the <code class="code docutils literal notranslate"><span class="pre">input</span></code> block along the provided <code class="code docutils literal notranslate"><span class="pre">axis</span></code></p>
|
|
||||||
<dl class="field-list simple">
|
|
||||||
<dt class="field-odd">Parameters</dt>
|
|
||||||
<dd class="field-odd"><ul class="simple">
|
|
||||||
<li><p><strong>input</strong> – the input values</p></li>
|
|
||||||
<li><p><strong>axis</strong> – the dimension along which the reduction should be done</p></li>
|
|
||||||
<li><p><strong>builder</strong> (<em>triton.ir.builder</em><em>, </em><em>optional from within JIT'ed functions</em>) – IR builder to generate code into</p></li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</dd></dl>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
<a href="triton.minimum.html" class="btn btn-neutral float-right" title="triton.minimum" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|
||||||
<a href="triton.min.html" class="btn btn-neutral float-left" title="triton.min" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<p>
|
|
||||||
© Copyright 2020, Philippe Tillet.
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
||||||
|
|
||||||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
||||||
|
|
||||||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
SphinxRtdTheme.Navigation.enable(true);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|