uuid stringlengths 36 36 | file_name stringlengths 5 50 | repo_name stringclasses 110
values | file_path stringlengths 7 112 | commit_hash stringclasses 110
values | starcount int64 0 0 | input stringlengths 39 33.8k | category dict | licenses listlengths 1 2 | github_url stringlengths 94 193 |
|---|---|---|---|---|---|---|---|---|---|
6d3ee5b8-898b-438e-a16f-c87c7ce98c84 | triton_sll.py | pytorch/FBGEMM | fbgemm_gpu/fbgemm_gpu/sll/triton_sll.py | fe980ab54a6e28818d81c8694b6564e7f804418b | 0 | @triton.jit
def _jagged_dense_flash_attention_bwd_dk_kernel(q_ptr, k_ptr, v_ptr, ab_ptr,
jagged_offsets_ptr, out_ptr, do_ptr, lse_ptr, delta_ptr, dq_ptr, dk_ptr,
dv_ptr, dbias_ptr, max_seq_len, stride_ql, stride_qd, stride_kb,
stride_kd, stride_kt, stride_vl, stride_vd, stride_ab_b, stride_ab_l,
stride_... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation",
"Matrix Multiplication",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Ob... | [
"BSD",
"MIT"
] | https://github.com/pytorch/FBGEMM/blob/fe980ab54a6e28818d81c8694b6564e7f804418b/fbgemm_gpu/fbgemm_gpu/sll/triton_sll.py |
8c7b91e8-cc8f-40fc-afce-459f1f8214bf | lightning_attn2.py | OpenNLPLab/lightning-attention | lightning_attn/ops/triton/lightning_attn2.py | d7439519541e966084eeaaf3ffd63eecc216f414 | 0 | @triton.jit
def _bwd_intra_kernel(Q, K, V, S, DO, DQ, DK, DV, b: tl.constexpr, h: tl.
constexpr, n: tl.constexpr, d: tl.constexpr, e: tl.constexpr, BLOCK: tl
.constexpr, NUM_BLOCK: tl.constexpr, CBLOCK: tl.constexpr, NUM_CBLOCK:
tl.constexpr):
off_bh = tl.program_id(0)
off_block = tl.program_id(1)
... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation",
"Matrix Multiplication",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Ob... | [
"MIT"
] | https://github.com/OpenNLPLab/lightning-attention/blob/d7439519541e966084eeaaf3ffd63eecc216f414/lightning_attn/ops/triton/lightning_attn2.py |
4fcdc1d3-596d-431c-b62b-3f6a8a65e5a1 | k_dropout.py | cpuhrsch/torchfused | torchfused/triton/k_dropout.py | 6c40ed160dcecbe7825f268f7c86bccd359e0ebf | 0 | @triton.jit
def _drop_and_scale(SEEDS, row, p, offsets, x):
seed = SEEDS + row
random = tl.rand(seed.to(tl.int32), offsets)
x_keep = random > p
zero = 0.0
zero = zero.to(x.dtype)
return tl.where(x_keep, (x / (1 - p)).to(x.dtype), zero)
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/cpuhrsch/torchfused/blob/6c40ed160dcecbe7825f268f7c86bccd359e0ebf/torchfused/triton/k_dropout.py |
83c7f330-658f-46b1-b1f2-1cd74b5122b4 | triton_welford.py | pytorch-labs/tritonbench | tritonbench/operators/welford/triton_welford.py | 3a5dccb159834968567a2e45e561dc1aeaa8f8a8 | 0 | @triton.autotune(configs=[triton.Config({'XBLOCK': 1, 'RBLOCK': 1024},
num_stages=1, num_warps=8), triton.Config({'XBLOCK': 1, 'RBLOCK': 2048},
num_stages=1, num_warps=8)], key=['xnumel', 'rnumel'])
@triton.jit
def triton_red_fused_native_layer_norm_no_welford(in_out_ptr0, in_out_ptr1,
in_ptr0, in_ptr1, in_... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Normalization",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
... | [
"BSD"
] | https://github.com/pytorch-labs/tritonbench/blob/3a5dccb159834968567a2e45e561dc1aeaa8f8a8/tritonbench/operators/welford/triton_welford.py |
c8059c9e-a8e6-4564-86fd-169f523010dc | positional_embedding.py | ai-compiler-study/triton-kernels | triton_kernels/kernels/positional_embedding.py | 2308e5e9d965059fe2d19b4d535debac4970b69e | 0 | @triton.jit
def _rope_fwd(q_ptr, k_ptr, f_ptr, oq_ptr, ok_ptr, stride, d, BLOCK_SIZE:
tl.constexpr):
bh_idx = tl.program_id(0)
s_idx = tl.program_id(1)
q_start_ptr = q_ptr + bh_idx * stride
k_start_ptr = k_ptr + bh_idx * stride
oq_start_ptr = oq_ptr + bh_idx * stride
ok_start_ptr = ok_ptr + ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/ai-compiler-study/triton-kernels/blob/2308e5e9d965059fe2d19b4d535debac4970b69e/triton_kernels/kernels/positional_embedding.py |
ae45fb44-d0d9-48b0-8661-e897c1327370 | seqlen_utils.py | Kitsunetic/kitsu | kitsu/nn/seqlen_utils.py | 826967a493c89753ac2cf1e28b52b79998fc9076 | 0 | @triton.jit
def seqlen_to_index_kernel(seqlen_ptr, idx_ptr, BLK: tl.constexpr):
pid = tl.program_id(0)
i = tl.load(seqlen_ptr + pid)
j = tl.load(seqlen_ptr + pid + 1)
idx = tl.arange(0, BLK)
tl.store(idx_ptr + i + idx, idx, mask=idx < j - i)
| {
"Data Type": [
"uint8"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Low Latency"
]
} | [
"MIT"
] | https://github.com/Kitsunetic/kitsu/blob/826967a493c89753ac2cf1e28b52b79998fc9076/kitsu/nn/seqlen_utils.py |
510db266-e82a-4bbf-b760-757bb9b99da6 | special.py | IntelLabs/EquiTriton | src/equitriton/sph_harm/direct/special.py | 1cbf04f69b512a5c1d8ff4880dbf6e17fe089d4c | 0 | @triton.jit
def joint_second_order_fwd(coord_ptr: tl.tensor, output_ptr: tl.tensor,
block_size: tl.constexpr, coord_numel: tl.constexpr, output_numel: tl.
constexpr):
"""
This Triton implementation includes l=0, 1, 2 within the
same kernel, as it would be a common operation.
"""
coord_stride... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"Apache"
] | https://github.com/IntelLabs/EquiTriton/blob/1cbf04f69b512a5c1d8ff4880dbf6e17fe089d4c/src/equitriton/sph_harm/direct/special.py |
4e1ee352-1659-4bdb-be7f-7b5f64c2a6f8 | triton_fused_vq_attn.py | LouChao98/vqtree | ops/triton_fused_vq_attn.py | 27a53274df7a804bce27dffcce5f5be73f64b6f3 | 0 | @triton.jit
def _vq_attn_fwd_inner(acc, l_i, m_i, q, sm_scale, K_block_ptr,
K_VQC_block_ptr, VVQI_block_ptr, V_VQ, stride_vvq_n, CODEBOOK_SIZE: tl.
constexpr, BLOCK_HEADDIM: tl.constexpr, BLOCK_N: tl.constexpr):
for _ in range(0, CODEBOOK_SIZE, BLOCK_N):
k = tl.load(K_block_ptr)
qk = tl.dot(... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"Memory-Bound"
]
} | [
"Apache"
] | https://github.com/LouChao98/vqtree/blob/27a53274df7a804bce27dffcce5f5be73f64b6f3/ops/triton_fused_vq_attn.py |
912d1872-d2e5-4a37-9f11-a8df42e90f66 | y_10.py | IntelLabs/EquiTriton | src/equitriton/sph_harm/direct/y_10.py | 1cbf04f69b512a5c1d8ff4880dbf6e17fe089d4c | 0 | @triton.jit
def tenth_order_bwd(coord_ptr: tl.tensor, coord_grad_ptr: tl.tensor,
sph_grad_ptr: tl.tensor, block_size: tl.constexpr, coord_numel: tl.
constexpr, output_numel: tl.constexpr, col_offset: tl.constexpr,
output_stride: tl.constexpr):
block_id = tl.program_id(0)
coord_stride = 3
coord_s... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"Apache"
] | https://github.com/IntelLabs/EquiTriton/blob/1cbf04f69b512a5c1d8ff4880dbf6e17fe089d4c/src/equitriton/sph_harm/direct/y_10.py |
de16e6fe-5490-4908-ad00-f28cbf3e7e54 | dropout.py | dame-cell/Triformer | triformer/dropout.py | 0712537d576166b93fa09aa9509b2661b9ed8a68 | 0 | @triton.jit
def _seeded_dropout(x_ptr, output_ptr, n_elements, p, seed, BLOCK_SIZE: tl.
constexpr):
pid = tl.program_id(axis=0)
block_start = pid * BLOCK_SIZE * 4
offset = block_start + tl.arange(0, BLOCK_SIZE)
r0, r1, r2, r3 = tl.random.rand4x(seed, offset)
scale = 1.0 / (1.0 - p)
for i in ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/dame-cell/Triformer/blob/0712537d576166b93fa09aa9509b2661b9ed8a68/triformer/dropout.py |
732ba6cd-e311-45e1-a903-5a7a6189d148 | fused_kl_div.py | sustcsonglin/flash-linear-attention | fla/modules/fused_kl_div.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def elementwise_mul_kernel(x, g, N: tl.constexpr, B: tl.constexpr):
"""
This function multiplies each element of the tensor pointed by x with the value pointed by g.
The multiplication is performed in-place on the tensor pointed by x.
Parameters:
x:
Pointer to the input tensor.
... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/modules/fused_kl_div.py |
1db7555b-32ef-4cc2-9217-8ecf0ada9c85 | cross_entropy_loss_kernels.py | BobMcDear/attorch | attorch/cross_entropy_loss_kernels.py | da06cb6236bb47195e33fe3986ed21c675ed94cc | 0 | @triton.autotune(configs=warps_kernel_configs(), key=['batch_dim', 'feat_dim'])
@triton.heuristics({'BLOCK_SIZE_BATCH': BLOCK_SIZE_BATCH_heuristic,
'BLOCK_SIZE_FEAT': lambda args: next_power_of_2(args['feat_dim'])})
@triton.jit
def cross_entropy_loss_backward_kernel(output_grad_pointer, target_pointer,
input_po... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Softmax",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput",
... | [
"MIT"
] | https://github.com/BobMcDear/attorch/blob/da06cb6236bb47195e33fe3986ed21c675ed94cc/attorch/cross_entropy_loss_kernels.py |
f3a6e3a3-92be-4174-ade1-4a029fd7be9b | chunk.py | sustcsonglin/flash-linear-attention | fla/ops/retention/chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({'BV': BV}, num_warps=num_warps,
num_stages=num_stages) for BV in [32, 64, 128] for num_warps in [2, 4] for
num_stages in [2, 3, 4]], key=['BT'])
@triton.jit
def chunk_retention_bwd_kernel_dqkv(... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/retention/chunk.py |
4cb7f10c-e876-4404-a8ee-8dfb7a2f3050 | sparse_copy.py | ServiceNow/Fast-LLM | fast_llm/functional/triton/sparse_copy.py | 8b46289079da67cba99628448a6b6083dac083cf | 0 | @triton.jit
def copy_sparse_to_dense_grad_score_kernel(input_ptr, grad_output_ptr,
grad_scores_ptr, sparse_rows_ptr, num_columns: tl.constexpr,
num_experts_per_token: tl.constexpr, block_size: tl.constexpr):
dense_row = tl.program_id(0)
top_index = tl.program_id(1)
sparse_row = tl.load(sparse_rows_p... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations",
"Backpropagation"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"Apache"
] | https://github.com/ServiceNow/Fast-LLM/blob/8b46289079da67cba99628448a6b6083dac083cf/fast_llm/functional/triton/sparse_copy.py |
0958dea2-dc46-4f8c-9895-f76364fbcc17 | parallel.py | sustcsonglin/flash-linear-attention | fla/ops/retention/parallel.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'NV': lambda args: triton.cdiv(args['V'], args['BV']),
'OUTPUT_ATTENTIONS': lambda args: args['attn'] is not None})
@triton.jit
def parallel_retention_fwd_kernel(q, k, v, o, attn, scale, B: tl.constexpr,
H: tl.constexpr, T: tl.constexpr, K: tl.constexpr, V: tl.constexpr, BT:
tl.constexpr... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/retention/parallel.py |
509c75fc-fcc7-4a43-b0ef-aa00f4263dba | slstm_fw.py | NX-AI/flashrnn | flashrnn/flashrnn/triton_fused/slstm_fw.py | 3fca666a81c8740af4878d7bc5e2a51900e4fe14 | 0 | @triton.autotune(configs, key=['siz_B', 'T', 'B', 'NH', 'DH'])
@triton.jit
def _forward_sequence_kernel(states_initial, Wx, R, b, states_all,
gates_all, T: tl.constexpr, NS: tl.constexpr, B: tl.constexpr, NH: tl.
constexpr, DH: tl.constexpr, NGI: tl.constexpr, NGR: tl.constexpr,
siz_B: tl.constexpr, OUTPUT_... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
... | [
"MIT",
"BSD"
] | https://github.com/NX-AI/flashrnn/blob/3fca666a81c8740af4878d7bc5e2a51900e4fe14/flashrnn/flashrnn/triton_fused/slstm_fw.py |
8404cde9-7803-4d09-a284-c110eb62f90a | mlp.py | ServiceNow/Fast-LLM | fast_llm/functional/triton/mlp.py | 8b46289079da67cba99628448a6b6083dac083cf | 0 | @triton.jit
def triton_mlp_activation_forward_kernel(input_ptr, output_ptr, gated: tl.
constexpr, activation_type: tl.constexpr, n_cols: tl.constexpr,
block_size: tl.constexpr):
row_idx = tl.program_id(0).to(tl.int64)
columns = tl.program_id(1) * block_size + tl.arange(0, block_size)
output_offsets ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Activation Functions",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"Apache"
] | https://github.com/ServiceNow/Fast-LLM/blob/8b46289079da67cba99628448a6b6083dac083cf/fast_llm/functional/triton/mlp.py |
83293d43-8c29-4602-b2d3-8e55f706ba6a | normalization.py | ai-compiler-study/triton-kernels | triton_kernels/kernels/normalization.py | 2308e5e9d965059fe2d19b4d535debac4970b69e | 0 | @triton.jit
def _rms_norm_fwd(X, Y, W, Rstd, N, eps, BLOCK_M: tl.constexpr, BLOCK_N: tl
.constexpr):
row_offset = tl.program_id(0) * BLOCK_M
row_index = row_offset + tl.arange(0, BLOCK_M)[:, None]
col_index = tl.arange(0, BLOCK_N)[None, :]
col_mask = col_index < N
x = tl.load(X + N * row_index +... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Normalization",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/ai-compiler-study/triton-kernels/blob/2308e5e9d965059fe2d19b4d535debac4970b69e/triton_kernels/kernels/normalization.py |
87e4c097-d2ca-4b41-ab22-ac0e29843a3c | RzLinearForward.py | apd10/RzLinear | python/rz_linear/impl/RzLinearForward.py | eb56657b2de0a97f398f88af421b0fbcbc5469c9 | 0 | @triton.jit
def rz_linear_forward_kernel_notune(a_ptr, b_ptr, c_ptr, init_factor, M, N,
K, H, stride_am, stride_ak, stride_cm, stride_cn, allow_tf32: tl.
constexpr, R7: int, R6: int, R5: int, R4: int, R3: int, R2: int, R1:
int, R0: int, BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr,
BLOCK_SIZE_... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/apd10/RzLinear/blob/eb56657b2de0a97f398f88af421b0fbcbc5469c9/python/rz_linear/impl/RzLinearForward.py |
7971a4d5-d72d-49a0-8810-4b44d3e7eab4 | real_rnn_tie_input_gate.py | berlino/seq_icl | src/models/sequence/rnn/scan_triton/real_rnn_tie_input_gate.py | 9b9223d15348b5a415fb453ed988ed5f7ab9fbdc | 0 | @triton.jit
def fwd_sequential_scan(v, f1, hidden, B, L, C, BLOCK_M: tl.constexpr):
offset_b = tl.program_id(0)
if offset_b >= B:
return
offset_n = tl.program_id(1)
ptr = tl.arange(0, BLOCK_M) + offset_b * L * C + offset_n * BLOCK_M
h1 = tl.zeros([BLOCK_M], dtype=tl.float32)
for _ in ran... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Tiled",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"Apache"
] | https://github.com/berlino/seq_icl/blob/9b9223d15348b5a415fb453ed988ed5f7ab9fbdc/src/models/sequence/rnn/scan_triton/real_rnn_tie_input_gate.py |
88e83a8a-262f-4bec-a1fa-c5f9b43f17d6 | relu.py | daemyung/practice-triton | relu.py | 27f727726f1507c8380a1c11751d851c7c4a07ce | 0 | @staticmethod
@triton.jit
def forward(output_ptr, input_ptr, size, block_size: tl.constexpr):
pid = tl.program_id(0)
offset = pid * block_size
input_block_ptr = tl.make_block_ptr(input_ptr, shape=(size,), strides=(
1,), offsets=(offset,), block_shape=(block_size,), order=(0,))
output_block_ptr =... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Activation Functions",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Low Latency"
]
} | [
"MIT"
] | https://github.com/daemyung/practice-triton/blob/27f727726f1507c8380a1c11751d851c7c4a07ce/relu.py |
88873c2a-b635-4908-bbff-feff8674e931 | rotary_embedding.py | AlibabaPAI/FLASHNN | flashnn/triton_kernels/rotary_embedding.py | 528a9301587f5fb135b25d973a87ba0a40a703a7 | 0 | @triton.jit
def _rotary_embedding_kernel(q_rot_ptr, k_rot_ptr, q_ptr, k_ptr, cos_ptr,
sin_ptr, seq_len, batch_size, num_heads, num_kv, hidden_size, q_strides,
q_strideb, q_strideh, q_strided, k_strides, k_strideb, k_stridekv,
k_strided, seq_offset, BLOCK_SIZE_SEQ: tl.constexpr, BLOCK_SIZE_BH: tl.
conste... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"Apache"
] | https://github.com/AlibabaPAI/FLASHNN/blob/528a9301587f5fb135b25d973a87ba0a40a703a7/flashnn/triton_kernels/rotary_embedding.py |
1629adb1-4300-4648-8f28-5969b18864d5 | block_ptr.py | daemyung/practice-triton | block_ptr.py | 27f727726f1507c8380a1c11751d851c7c4a07ce | 0 | @triton.jit
def add_kernel(x_ptr, y_ptr, z_ptr, size, block_size: tl.constexpr):
offset = tl.program_id(0) * block_size
x_block_ptr = tl.make_block_ptr(x_ptr, shape=(size,), strides=(1,),
offsets=(offset,), block_shape=(block_size,), order=(0,))
y_block_ptr = tl.make_block_ptr(y_ptr, shape=(size,), ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/daemyung/practice-triton/blob/27f727726f1507c8380a1c11751d851c7c4a07ce/block_ptr.py |
df24c070-c472-4437-97d2-8959ecc59778 | cross_entropy.py | dame-cell/Triformer | triformer/cross_entropy.py | 0712537d576166b93fa09aa9509b2661b9ed8a68 | 0 | @triton.jit
def cross_entropy_fwd_bwd_kernel(output_loss_ptr, output_logit_grad_ptr,
input_logit_ptr, input_targ_ptr, input_divisor_ptr, output_loss_stride,
output_logit_grad_stride, input_logit_stride, input_targ_stride, n_cols,
ignore_index, BLOCK_SIZE: tl.constexpr):
row_idx = tl.program_id(0)
lo... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Softmax",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/dame-cell/Triformer/blob/0712537d576166b93fa09aa9509b2661b9ed8a68/triformer/cross_entropy.py |
d1bbad34-33d0-441b-b7e1-fbac372c752f | chunk_h_split.py | sustcsonglin/flash-linear-attention | fla/ops/common/chunk_h_split.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'STORE_INITIAL_STATE_GRADIENT': lambda args: args['dh0'
] is not None, 'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({'BK': BK, 'BV': BV}, num_warps=
num_warps, num_stages=num_stages) for BK in [32, 64] for BV in [32, 64] for
num_warps ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/common/chunk_h_split.py |
12456573-9f7c-4e65-b821-93e96495dd34 | quant_triton.py | CompendiumLabs/ziggy | ziggy/backends/quant_triton.py | bd12fe50ca3475743f62ae26d4c184108e441e03 | 0 | @triton.jit
def clamp(x, a, b):
return tl.maximum(a, tl.minimum(b, x))
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/CompendiumLabs/ziggy/blob/bd12fe50ca3475743f62ae26d4c184108e441e03/ziggy/backends/quant_triton.py |
434a7a78-d4a9-4a24-a028-0bbe017c400b | masks.py | drisspg/transformer_nuggets | transformer_nuggets/flash/masks.py | a4c66bbeebaa479ad8b6ed82d7efbafa41b17260 | 0 | @triton.jit
def score_modification(score, offs_m, start_n, offs_n, off_hz, num_heads, q,
k, mask_block_ptr, BIAS_CHOICE: tl.constexpr, DEBUG_MASK: tl.constexpr,
IS_CAUSAL: tl.constexpr, MATMUL_PRECISION: tl.constexpr=tl.float16):
batch = off_hz // num_heads
head = off_hz % num_heads
seq_len_q = offs... | {
"Data Type": [
"fp16"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"BSD"
] | https://github.com/drisspg/transformer_nuggets/blob/a4c66bbeebaa479ad8b6ed82d7efbafa41b17260/transformer_nuggets/flash/masks.py |
049b3fe1-f26d-423e-844f-bef45e5755b6 | masks.py | drisspg/transformer_nuggets | transformer_nuggets/flash/masks.py | a4c66bbeebaa479ad8b6ed82d7efbafa41b17260 | 0 | @triton.jit
def rel_attention_triton(score, batch, head, seq_len_q, seq_len_kv):
bias = seq_len_kv - seq_len_q
score = score + bias
return score
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"BSD"
] | https://github.com/drisspg/transformer_nuggets/blob/a4c66bbeebaa479ad8b6ed82d7efbafa41b17260/transformer_nuggets/flash/masks.py |
5ff91ea0-293b-4837-826f-44c0fe4e319c | triton_kernels.py | vkuzo/pytorch_scripts | reduction_hack/triton_kernels.py | 15322fe2a72fbebe1b9d9e38978cb6476da3bf70 | 0 | @triton.autotune(configs=[triton.Config({'BLOCK_SIZE': 512}), triton.Config
({'BLOCK_SIZE': 1024}), triton.Config({'BLOCK_SIZE': 2048}), triton.
Config({'BLOCK_SIZE': 8192}), triton.Config({'BLOCK_SIZE': 16384})],
key=['n_elements'])
@triton.jit
def max_with_atomics_kernel(in_ptr0, out_ptr, n_elements, BLOC... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Top-K Selection"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/vkuzo/pytorch_scripts/blob/15322fe2a72fbebe1b9d9e38978cb6476da3bf70/reduction_hack/triton_kernels.py |
c2fc4d8e-023b-46eb-8021-911d529c03b8 | fused_recurrent.py | sustcsonglin/flash-linear-attention | fla/ops/delta_rule/fused_recurrent.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_INITIAL_STATE': lambda args: args['h0'] is not
None, 'STORE_FINAL_STATE': lambda args: args['ht'] is not None,
'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.jit
def fused_recurrent_delta_rule_fwd_kernel(q, k, v, u, beta, o, h0, ht,
offsets, scale, B: tl.constexpr... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Latency Sensitive"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/delta_rule/fused_recurrent.py |
6222b5ee-b5c3-4653-81db-38b9198dc016 | rms_norm_dquant.py | AlibabaPAI/FLASHNN | flashnn/triton_kernels/rms_norm_dquant.py | 528a9301587f5fb135b25d973a87ba0a40a703a7 | 0 | @triton.jit
def _rms_norm_dquant_kernel(X, Y, W, scale, stride, N, eps, BLOCK_SIZE: tl.
constexpr):
row = tl.program_id(0)
Y += row * stride
X += row * stride
_var = tl.zeros([BLOCK_SIZE], dtype=tl.float32)
for off in range(0, N, BLOCK_SIZE):
cols = off + tl.arange(0, BLOCK_SIZE)
... | {
"Data Type": [
"fp32",
"int8"
],
"Functionality": [
"Normalization",
"Quantization"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"Apache"
] | https://github.com/AlibabaPAI/FLASHNN/blob/528a9301587f5fb135b25d973a87ba0a40a703a7/flashnn/triton_kernels/rms_norm_dquant.py |
cfcb2dbd-a045-4be5-8067-8ff20faf4034 | seqlen_utils.py | Kitsunetic/kitsu | kitsu/nn/seqlen_utils.py | 826967a493c89753ac2cf1e28b52b79998fc9076 | 0 | @triton.jit
def seqlen_to_batch_index_kernel(seqlen_ptr, idx_ptr, BLK: tl.constexpr):
pid = tl.program_id(0)
i = tl.load(seqlen_ptr + pid)
j = tl.load(seqlen_ptr + pid + 1)
idx = tl.arange(0, BLK)
tl.store(idx_ptr + i + idx, pid, mask=idx < j - i)
| {
"Data Type": [],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/Kitsunetic/kitsu/blob/826967a493c89753ac2cf1e28b52b79998fc9076/kitsu/nn/seqlen_utils.py |
272fdc2b-cbf6-4942-9981-90ca27a426e6 | fused_recurrent.py | sustcsonglin/flash-linear-attention | fla/ops/delta_rule/fused_recurrent.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_INITIAL_STATE': lambda args: args['h0'] is not
None, 'USE_FINAL_STATE_GRADIENT': lambda args: args['dht'] is not None,
'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.jit
def fused_recurrent_delta_rule_bwd_kernel(q, k, v, beta, h0, dh0, dht, do,
dq, dk, dv, db, off... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Recurrent Neural Networks"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/delta_rule/fused_recurrent.py |
6737d4e9-b985-4927-a44a-82cdfbceeae6 | fused_cross_entropy.py | sustcsonglin/flash-linear-attention | fla/modules/fused_cross_entropy.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'HAS_SMOOTHING': lambda args: args['label_smoothing'] >
0.0})
@triton.jit
def cross_entropy_bwd_kernel(dlogits_ptr, dloss_ptr, logits_ptr, lse_ptr,
labels_ptr, label_smoothing, logit_scale, lse_square_scale,
ignore_index, total_classes, class_start_idx, n_cols, logits_row_stride,
dlo... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Softmax"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/modules/fused_cross_entropy.py |
b912e62b-afb4-4422-890d-6fb1182bfd6e | cumsum.py | sustcsonglin/flash-linear-attention | fla/ops/utils/cumsum.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({'BT': BT}, num_warps=num_warps) for
BT in [16, 32, 64] for num_warps in [2, 4, 8]], key=['S'])
@triton.jit
def chunk_global_cumsum_vector_kernel(s, z, offsets, T: tl.constexpr, H: tl
.constexpr... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access",
"Blocked Access"
],
"Parallelization Strategy": [
"Cooperative Groups"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/utils/cumsum.py |
6a835470-58ab-445d-b53c-4296e4297b79 | triton_kernel.py | yann-Choho/projet_PPML | notebooks/triton_kernel.py | 9274e0561443b01f029ee6e0737f922f71d2da39 | 0 | @triton.autotune(configs=get_autotune_config(), key=['n_elements'])
@triton.jit
def triple_mul_kernel(A_ptr, B_ptr, C_ptr, output_ptr, n_elements,
BLOCK_SIZE: tl.constexpr):
pid = tl.program_id(axis=0)
block_start = pid * BLOCK_SIZE
offsets = block_start + tl.arange(0, BLOCK_SIZE)
mask = offsets < n... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/yann-Choho/projet_PPML/blob/9274e0561443b01f029ee6e0737f922f71d2da39/notebooks/triton_kernel.py |
1162e2ac-eec4-4b6a-ac17-f648e706e5b4 | heuristics.py | daemyung/practice-triton | heuristics.py | 27f727726f1507c8380a1c11751d851c7c4a07ce | 0 | @triton.heuristics({'boundary_check': lambda args: args['x_size'] % args[
'block_size']})
@triton.jit
def add_kernel(x_ptr, y_ptr, z_ptr, size, block_size: tl.constexpr,
boundary_check: tl.constexpr):
offset = tl.program_id(0) * block_size
x_block_ptr = tl.make_block_ptr(x_ptr, shape=(size,), strides=(1... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Low Latency"
]
} | [
"MIT"
] | https://github.com/daemyung/practice-triton/blob/27f727726f1507c8380a1c11751d851c7c4a07ce/heuristics.py |
79923ee4-c50b-4734-a499-56f92bffc35b | sized_tuned_bwd.py | ROCm/aotriton | tritonsrc/sized_tuned_bwd.py | 016f733e8ff746450e066f78bed68709ccd93e60 | 0 | @triton.autotune(configs=TRITON_CONFIG_LIST_BWD_SIZED, key=['BLOCK_DMODEL',
'max_seqlen_q', 'max_seqlen_k'])
@triton.jit
def sized_tuned_bwd_kernel_dk_dv(Q, K, V, B, sm_scale, Out, DO, DK, DV, L,
D, stride_qz, stride_qh, stride_qm, stride_qk, stride_kz, stride_kh,
stride_kn, stride_kk, stride_vz, stride_vh,... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/ROCm/aotriton/blob/016f733e8ff746450e066f78bed68709ccd93e60/tritonsrc/sized_tuned_bwd.py |
eef87b29-d8f2-420d-a9a1-7f119fb0bc3c | wy_fast.py | sustcsonglin/flash-linear-attention | fla/ops/gated_delta_rule/wy_fast.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({}, num_warps=num_warps) for
num_warps in [1, 2, 4]], key=['BT', 'BK', 'BV'])
@triton.jit
def bwd_prepare_wy_repr_kernel(k, v, beta, g, Aw, Au, dw, du, dk, dv, dbeta,
dg, offsets, indices, T: tl... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/gated_delta_rule/wy_fast.py |
bf07f58b-4dc1-4f3e-8074-7f90a37688c0 | naive_associative_rnn_scan.py | TushaarGVS/linear-rnn | linear_rnn/triton/naive_associative_rnn_scan.py | 48320589b73154484be7d09a144923a2b9e56b85 | 0 | @triton.jit
def _naive_associative_rnn_scan_bwd_kernel():
pass
| {
"Data Type": [],
"Functionality": [
"Backpropagation",
"Recurrent Neural Networks"
],
"Memory Access Pattern": [],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"Apache"
] | https://github.com/TushaarGVS/linear-rnn/blob/48320589b73154484be7d09a144923a2b9e56b85/linear_rnn/triton/naive_associative_rnn_scan.py |
6008f8eb-f05d-46b8-ba50-eaf48490ed4d | rand_init.py | gmgu/study-triton | 6_random/rand_init.py | 3a9a24fd3f1de3e7465535ffe72f6deac8a419bd | 0 | @triton.jit
def rand_init(out_ptr, n, seed, BLOCK_SIZE: tl.constexpr):
pid = tl.program_id(axis=0)
offsets = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
mask = offsets < n
random = tl.rand(seed, offsets)
tl.store(out_ptr + offsets, random, mask=mask)
| {
"Data Type": [],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"Apache"
] | https://github.com/gmgu/study-triton/blob/3a9a24fd3f1de3e7465535ffe72f6deac8a419bd/6_random/rand_init.py |
af1c833d-4eeb-4313-a034-3b8bf3198b9d | main_triton.py | dwgan/GraphMST | main_triton.py | 4d65ed0f108d339e3e4cfff25085a39adc6a48a2 | 0 | @triton.jit
def union_kernel(parent, rank, u, v, BLOCK_SIZE: tl.constexpr):
root_u = tl.zeros((BLOCK_SIZE,), dtype=tl.int32)
root_v = tl.zeros((BLOCK_SIZE,), dtype=tl.int32)
find_kernel(parent, u, root_u, BLOCK_SIZE=BLOCK_SIZE)
find_kernel(parent, v, root_v, BLOCK_SIZE=BLOCK_SIZE)
tl.syncwarp()
... | {
"Data Type": [],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Shared Memory Intensive"
],
"Parallelization Strategy": [
"Cooperative Groups"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"MIT"
] | https://github.com/dwgan/GraphMST/blob/4d65ed0f108d339e3e4cfff25085a39adc6a48a2/main_triton.py |
faf1b309-5072-4c15-ba21-d9fb5786455c | 06-fused-attention.py | triton-lang/triton | python/tutorials/06-fused-attention.py | a2b398e0bb1b120f31cf386d6ae3261c3ab84207 | 0 | @triton.jit
def _attn_bwd(Q, K, V, sm_scale, DO, DQ, DK, DV, M, D, stride_z, stride_h,
stride_tok, stride_d, H, N_CTX, BLOCK_M1: tl.constexpr, BLOCK_N1: tl.
constexpr, BLOCK_M2: tl.constexpr, BLOCK_N2: tl.constexpr,
BLK_SLICE_FACTOR: tl.constexpr, HEAD_DIM: tl.constexpr):
LN2: tl.constexpr = 0.693147182... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation"
],
"Memory Access Pattern": [
"Tiled"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/triton-lang/triton/blob/a2b398e0bb1b120f31cf386d6ae3261c3ab84207/python/tutorials/06-fused-attention.py |
21eb0b3f-9ba8-480f-bb96-a5685bc5fff5 | snake.py | falkaer/multi-scale-music | snake.py | a7794ddfb3bbd95b70acf3fe72a08d8a1d47564d | 0 | @triton.autotune(configs=[triton.Config({}, num_warps=4), triton.Config({},
num_warps=8), triton.Config({}, num_warps=16)], reset_to_zero=['DYDA',
'DYDC'], key=['C'])
@triton.jit
def _snake_bwd_triton(X, OUT, ALPHA, CR, GRAD, DYDX, DYDA, DYDC, X_stride1,
X_stride2, X_stride3, OUT_stride1, OUT_stride2, OUT_s... | {
"Data Type": [],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Shared Memory Intensive"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"MIT"
] | https://github.com/falkaer/multi-scale-music/blob/a7794ddfb3bbd95b70acf3fe72a08d8a1d47564d/snake.py |
b98029f7-6d1d-4960-8e62-6b7ea5e45c0e | chunk.py | sustcsonglin/flash-linear-attention | fla/ops/abc/chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def chunk_abc_bwd_kernel_dh(q, z, do, dh, s_k_h, s_k_t, s_k_d, s_v_h, s_v_t,
s_v_d, s_h_h, s_h_t, s_h_d, scale, T: tl.constexpr, K: tl.constexpr, V:
tl.constexpr, BT: tl.constexpr, BK: tl.constexpr, BV: tl.constexpr, NT:
tl.constexpr, NORMK: tl.constexpr):
i_k, i_v, i_bh = tl.program_id(0), ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/abc/chunk.py |
4ff74bb4-943c-4c66-937e-646014c4ff27 | math.py | BobMcDear/attorch | attorch/math.py | da06cb6236bb47195e33fe3986ed21c675ed94cc | 0 | @triton.jit
def softmax(input, log: tl.constexpr):
"""
Normalizes the input using softmax along the last dimension.
Args:
input: Input to normalize.
The input must be of shape [BLOCK_SIZE1, BLOCK_SIZE2].
log: Flag for indicating if the log of softmax should be taken.
Return... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Softmax"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/BobMcDear/attorch/blob/da06cb6236bb47195e33fe3986ed21c675ed94cc/attorch/math.py |
7dd66f4e-95eb-48ec-8b08-1f9ced106147 | parallel.py | sustcsonglin/flash-linear-attention | fla/ops/based/parallel.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def _parallel_based_bwd_dq(i_bh, i_c, i_k, i_v, i_h, q, k, v, do, dz, dq,
s_k_h, s_k_t, s_k_d, s_v_h, s_v_t, s_v_d, B, H, T, scale, BTL: tl.
constexpr, BTS: tl.constexpr, BK: tl.constexpr, BV: tl.constexpr, K: tl
.constexpr, V: tl.constexpr):
p_do = tl.make_block_ptr(do + i_bh * s_v_h, (T, V... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/based/parallel.py |
35bf1229-189c-4ad2-b417-b760322afbf3 | positional_embedding.py | sjjeong94/ai_compiler_study | aicom/positional_embedding.py | e87284aab74acab704e2d192190be446e328e1c6 | 0 | @triton.jit
def rope_bw(dx_ptr, f_ptr, dt_ptr, dx_s_stride, f_s_stride, dt_s_stride, d,
d2, BLOCK_SIZE: tl.constexpr):
s_idx = tl.program_id(0)
bh_idx = tl.program_id(1)
dx_start_ptr = dx_ptr + s_idx * dx_s_stride
f_start_ptr = f_ptr + s_idx * f_s_stride
dt_start_ptr = dt_ptr + s_idx * dt_s_stri... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sjjeong94/ai_compiler_study/blob/e87284aab74acab704e2d192190be446e328e1c6/aicom/positional_embedding.py |
f0a324aa-5bec-4ba9-8dee-d1c6f875aff3 | triton_jagged_tensor_ops.py | pytorch/FBGEMM | fbgemm_gpu/fbgemm_gpu/triton/jagged/triton_jagged_tensor_ops.py | fe980ab54a6e28818d81c8694b6564e7f804418b | 0 | @triton.jit
def triton_jagged_to_dense(jagged_value_ptr, jagged_offsets_ptr,
jagged_value_row_stride, output_dense_ptr, dense_indices_ptr,
dense_col_stride, dense_row_stride, dense_matrix_stride, JAGGED_DIM: tl
.constexpr, thread_block_row_size: tl.constexpr, thread_block_col_size:
tl.constexpr, operati... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"BSD",
"MIT"
] | https://github.com/pytorch/FBGEMM/blob/fe980ab54a6e28818d81c8694b6564e7f804418b/fbgemm_gpu/fbgemm_gpu/triton/jagged/triton_jagged_tensor_ops.py |
7373edff-5262-4dfe-8b20-5d8d947fc6be | triton_chunk.py | NX-AI/xlstm-jax | xlstm_jax/models/xlstm_pytorch/blocks/mlstm/backend/triton_chunk.py | 6615e620ba4ecdbe4fd9cc4e9a5a313b133e84a7 | 0 | @triton.jit
def chunk_mlstm_fwd_kernel_C(k, v, C, n, m, i, f, initial_C, initial_n,
initial_m, final_C, final_n, final_m, s_qk_h, s_qk_t, s_qk_d, s_vh_h,
s_vh_t, s_vh_d, s_C_h, s_C_t, s_n_h, H: tl.constexpr, T: tl.constexpr,
K: tl.constexpr, V: tl.constexpr, BT: tl.constexpr, BK: tl.constexpr,
BV: tl.co... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"Low Latency"
]
} | [
"Apache",
"BSD"
] | https://github.com/NX-AI/xlstm-jax/blob/6615e620ba4ecdbe4fd9cc4e9a5a313b133e84a7/xlstm_jax/models/xlstm_pytorch/blocks/mlstm/backend/triton_chunk.py |
0d15dee4-56b7-4d6d-bb33-39e4b5938078 | fp8_gemm.py | pytorch/FBGEMM | fbgemm_gpu/experimental/gemm/triton_gemm/fp8_gemm.py | fe980ab54a6e28818d81c8694b6564e7f804418b | 0 | @triton.autotune(configs=MATMUL_CONFIGS, key=['m_key', 'n_key', 'k_key'],
prune_configs_by={'early_config_prune': early_config_prune,
'perf_model': estimate_matmul_time, 'top_k': 10})
@triton.heuristics({'EVEN_K': lambda args: args['K'] % (args['BLOCK_K'] *
args['SPLIT_K']) == 0})
@triton.jit
def _kernel_ma... | {
"Data Type": [],
"Functionality": [
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput"
]
} | [
"BSD",
"MIT"
] | https://github.com/pytorch/FBGEMM/blob/fe980ab54a6e28818d81c8694b6564e7f804418b/fbgemm_gpu/experimental/gemm/triton_gemm/fp8_gemm.py |
9c7bbe01-fd64-4864-80d0-e77e220fab0a | fused_chunk.py | sustcsonglin/flash-linear-attention | fla/ops/delta_rule/fused_chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.autotune(configs=[triton.Config({}, num_warps=1), triton.Config({},
num_warps=2), triton.Config({}, num_warps=4), triton.Config({},
num_warps=8)], key=['BT', 'BK', 'BV'])
@triton.jit
def fused_chunk_delta_rule_bwd_kernel(q, k, v, d, dht, dh0, do, dq, dk, dv,
dd, initial_state, s_k_h, s_k_t, s_k_d, s... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/delta_rule/fused_chunk.py |
16c05989-05bd-492f-89cf-86a814ede982 | mhmoe.py | dtadpole/triton-playground | mhmoe.py | 2d317976722d63080133b1bf88b1f0cdec98f831 | 0 | @triton.jit
def d_silu(x, o):
sig = tl.sigmoid(x)
return sig + o * (1 - sig)
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Activation Functions",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/dtadpole/triton-playground/blob/2d317976722d63080133b1bf88b1f0cdec98f831/mhmoe.py |
fd1f4159-2938-4d88-91f3-e1646ab75398 | math.py | BobMcDear/attorch | attorch/math.py | da06cb6236bb47195e33fe3986ed21c675ed94cc | 0 | @triton.jit
def calc_mean_and_inv_std(input, last_dim, eps, last_dim_mask: tl.constexpr):
"""
Calculates the mean and inverse standard deviation of the input
along the last dimension.
Args:
input: Input whose mean and inverse standard deviation are calculated.
The input must be of s... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Normalization"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/BobMcDear/attorch/blob/da06cb6236bb47195e33fe3986ed21c675ed94cc/attorch/math.py |
dc7321dc-32fb-4fed-9ba5-5273d19cb153 | kernels.py | pytorch-labs/tritonbench | tritonbench/operators/jagged_sum/kernels.py | 3a5dccb159834968567a2e45e561dc1aeaa8f8a8 | 0 | @triton.autotune(configs=[triton.Config({'BLOCK_SIZE_RAGGED': b_r,
'BLOCK_SIZE_M': b_m}, num_warps=w, num_stages=s) for b_r, b_m, w, s in
itertools.product(BLOCK_SIZES, BLOCK_SIZES, NUM_WARPS, NUM_STAGES)],
key=['M'])
@triton.jit
def triton_jagged_sum_kernel_variable_length_loop_sum_then_buffer(
input_p... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"BSD"
] | https://github.com/pytorch-labs/tritonbench/blob/3a5dccb159834968567a2e45e561dc1aeaa8f8a8/tritonbench/operators/jagged_sum/kernels.py |
e1d634ae-75e9-4158-a173-e373bc727999 | triton_fused_attn_rerope.py | LouChao98/vqtree | ops/triton_fused_attn_rerope.py | 27a53274df7a804bce27dffcce5f5be73f64b6f3 | 0 | @triton.heuristics({'EVEN_M': lambda args: args['seqlen_q'] % args[
'BLOCK_M'] == 0, 'EVEN_N': lambda args: args['seqlen_k'] % args[
'BLOCK_N'] == 0})
@triton.jit
def _fwd_kernel(Q1, Q2, K1, K2, V, sm_scale, Out, stride_qz, stride_qh,
stride_qm, stride_qk, stride_kz, stride_kh, stride_kn, stride_kk,
str... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Softmax"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]... | [
"Apache"
] | https://github.com/LouChao98/vqtree/blob/27a53274df7a804bce27dffcce5f5be73f64b6f3/ops/triton_fused_attn_rerope.py |
77311a94-8d98-4965-a46c-7c601a7fd275 | kernels.py | pytorch-labs/tritonbench | tritonbench/operators/jagged_sum/kernels.py | 3a5dccb159834968567a2e45e561dc1aeaa8f8a8 | 0 | @triton.autotune(configs=[triton.Config({'BLOCK_SIZE_RAGGED': b_r,
'BLOCK_SIZE_M': b_m}, num_warps=w, num_stages=s) for b_r, b_m, w, s in
itertools.product(BLOCK_SIZES, BLOCK_SIZES, NUM_WARPS, NUM_STAGES)],
key=['M'])
@triton.jit
def triton_jagged_sum_kernel_simple_fused_sum_then_buffer(input_ptr_values,
... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access",
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"BSD"
] | https://github.com/pytorch-labs/tritonbench/blob/3a5dccb159834968567a2e45e561dc1aeaa8f8a8/tritonbench/operators/jagged_sum/kernels.py |
454eebde-6921-487e-b8e0-ee204d96b580 | chunk.py | sustcsonglin/flash-linear-attention | fla/ops/retention/chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'STORE_INITIAL_STATE_GRADIENT': lambda args: args['dh0'
] is not None, 'USE_FINAL_STATE_GRADIENT': lambda args: args['dht'] is not
None, 'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({'BK': BK, 'BV': BV}, num_warps=
num_warps, num_stage... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/retention/chunk.py |
4ca187d4-705d-426a-ab32-956f78d4d117 | sb_fwd.py | shawntan/stickbreaking-attention | stickbreaking_attention/sb_attn/sb_fwd.py | 8dd32ad5e58f0ee0232fd4782dc53d354ff8d283 | 0 | @triton.autotune(configs=get_configs(), key=['token_size', 'head_size'])
@triton.jit
def _forward(Q_ptr, stride_qb, stride_qh, stride_qm: tl.constexpr,
stride_qd: tl.constexpr, K_ptr, stride_kb, stride_kh, stride_kn: tl.
constexpr, stride_kd: tl.constexpr, V_ptr, stride_vb, stride_vh,
stride_vn: tl.constexp... | {
"Data Type": [
"fp32",
"fp16"
],
"Functionality": [
"Attention Mechanisms",
"Softmax"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput",
"Batch-Oriented"
]
} | [
"Apache"
] | https://github.com/shawntan/stickbreaking-attention/blob/8dd32ad5e58f0ee0232fd4782dc53d354ff8d283/stickbreaking_attention/sb_attn/sb_fwd.py |
4a35494c-3b38-474a-8c6f-d0bfb320f8b8 | swiglu.py | ardywibowo/triton-mode | kernels/swiglu.py | 5cd773ec95e25e23c6b75e312c7a9a1c6eb650b1 | 0 | @triton.jit
def triton_swiglu_backward(grad_output_ptr, input_a_ptr, input_b_ptr,
row_stride, num_columns: tl.constexpr, BLOCK_SIZE: tl.constexpr):
prog_id = tl.program_id(0).to(tl.int64)
grad_output_ptr += prog_id * row_stride
input_a_ptr += prog_id * row_stride
input_b_ptr += prog_id * row_stride
... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Activation Functions",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/ardywibowo/triton-mode/blob/5cd773ec95e25e23c6b75e312c7a9a1c6eb650b1/kernels/swiglu.py |
c669de30-862b-4b20-b39f-b1ab212762b0 | test_triton_basics.py | tucommenceapousser/xformers | tests/test_triton_basics.py | c97e3d917cfdad4a38acd4e9d776030d25ab9141 | 0 | @triton.jit
def k_rand(X, Y, SEED_X, SEED_Y, stride_x, stride_y, N: tl.constexpr):
"""
Check the random number generation
"""
row = tl.program_id(0)
rand_offsets = tl.arange(0, N)
seed_x = tl.load(SEED_X + row)
randx, _, _, _ = tl.randint4x(seed_x, rand_offsets)
rand_offsets = tl... | {
"Data Type": [],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/tucommenceapousser/xformers/blob/c97e3d917cfdad4a38acd4e9d776030d25ab9141/tests/test_triton_basics.py |
1f159cd8-6426-4d71-9d99-6e0ba4030389 | matrix-vector-multiplication.py | northstreet12/triton-cpu | python/tutorials/matrix-vector-multiplication.py | bfb302ffc5fde3b9efe040cb452ddac0454dbb98 | 0 | @triton.jit
def gemv_kernel(Y, A, X, M, N, stride_am, BLOCK_SIZE_M: tl.constexpr,
BLOCK_SIZE_N: tl.constexpr):
start_m = tl.program_id(0)
rm = start_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M)
rn = tl.arange(0, BLOCK_SIZE_N)
A = A + (rm[:, None] * stride_am + rn[None, :])
X = X + rn
acc = ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/northstreet12/triton-cpu/blob/bfb302ffc5fde3b9efe040cb452ddac0454dbb98/python/tutorials/matrix-vector-multiplication.py |
36107a2c-caa6-4ebc-98a8-495698ac5780 | multi_head_attention_kernels.py | BobMcDear/attorch | attorch/multi_head_attention_kernels.py | da06cb6236bb47195e33fe3986ed21c675ed94cc | 0 | @triton.jit
def _bwd_kernel_one_col_block(Q, K, V, sm_scale, qk_scale, Out, DO, DQ, DK,
DV, L, D, Q_block_ptr, K_block_ptr, V_block_ptr, DO_block_ptr,
DQ_block_ptr, DK_block_ptr, DV_block_ptr, stride_dqa, stride_qz,
stride_qh, stride_qm, stride_qk, stride_kz, stride_kh, stride_kn,
stride_kk, stride_vz, ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/BobMcDear/attorch/blob/da06cb6236bb47195e33fe3986ed21c675ed94cc/attorch/multi_head_attention_kernels.py |
a03e38da-ffa6-4c28-bae7-c2831152756e | bwd_kernel_dq.py | ROCm/aotriton | tritonsrc/bwd_kernel_dq.py | 016f733e8ff746450e066f78bed68709ccd93e60 | 0 | @triton.jit
def bwd_kernel_dq(Q, K, V, B, sm_scale, Out, DO, DQ, DB, L, D, stride_qz,
stride_qh, stride_qm, stride_qk, stride_kz, stride_kh, stride_kn,
stride_kk, stride_vz, stride_vh, stride_vk, stride_vn, stride_bz,
stride_bh, stride_bm, stride_bn, stride_oz, stride_oh, stride_om,
stride_ok, stride_dq... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/ROCm/aotriton/blob/016f733e8ff746450e066f78bed68709ccd93e60/tritonsrc/bwd_kernel_dq.py |
1bc0dab2-df5d-49d7-8357-25c023511ef4 | fused_recurrent.py | sustcsonglin/flash-linear-attention | fla/ops/hgrn/fused_recurrent.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_INITIAL_STATE': lambda args: args['h0'] is not
None, 'USE_FINAL_STATE_GRADIENT': lambda args: args['dht'] is not None,
'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.autotune(configs=[triton.Config({'BD': BD}, num_warps=num_warps) for
BD in [32, 64, 128] for num_w... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/hgrn/fused_recurrent.py |
4f77ab02-60d6-4972-ba32-de199f864ca3 | blocksparse_logsumexp.py | kimiasa/Experiments | src/models/attention/blocksparse_logsumexp.py | c4e73bfefd8290695ec52b6386b6b81838ca94a1 | 0 | @triton.heuristics({'num_warps': lambda *args, **meta: num_warps(args[5] *
meta['BLOCK'])})
@triton.heuristics({'TN': lambda *args, **meta: next_power_of_2(args[5]) *
meta['BLOCK']})
@triton.jit
def _backward(X, OUT, DX, DOUT, LUT, sizemax, stride_zx, stride_zout,
stride_hout, stride_zdx, stride_zdout, stri... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Softmax",
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"Apache"
] | https://github.com/kimiasa/Experiments/blob/c4e73bfefd8290695ec52b6386b6b81838ca94a1/src/models/attention/blocksparse_logsumexp.py |
97d8600e-0e67-46a3-81b1-9dc82a69f084 | vector_add3.py | danielpyon/ml-kernels | triton/vector_add3.py | 506186b419335b590da538ffb388aea2c7c26c03 | 0 | @triton.jit
def add_kernel(x, y, out, n, BLOCK_SIZE: tl.constexpr):
start = BLOCK_SIZE * tl.program_id(axis=0)
offsets = start + tl.arange(0, BLOCK_SIZE)
mask = offsets < n
xs = tl.load(x + offsets, mask=mask)
ys = tl.load(y + offsets, mask=mask)
tl.store(out + offsets, xs + ys, mask=mask)
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT",
"BSD"
] | https://github.com/danielpyon/ml-kernels/blob/506186b419335b590da538ffb388aea2c7c26c03/triton/vector_add3.py |
965bd139-0aa6-4b52-b2f1-093fcc0ab9b0 | parallel.py | sustcsonglin/flash-linear-attention | fla/ops/rebased/parallel.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def _parallel_rebased_bwd_dq(i_bh, i_c, i_k, i_v, i_h, q, k, v, do, dz, dq,
s_k_h, s_k_t, s_k_d, s_v_h, s_v_t, s_v_d, scale, B: tl.constexpr, H: tl
.constexpr, T: tl.constexpr, K: tl.constexpr, V: tl.constexpr, BTL: tl.
constexpr, BTS: tl.constexpr, BK: tl.constexpr, BV: tl.constexpr):
p_do ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access",
"Coalesced"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/rebased/parallel.py |
30b6c5be-8933-4c72-b749-323b8c021e41 | fused_recurrent.py | sustcsonglin/flash-linear-attention | fla/ops/retention/fused_recurrent.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.heuristics({'USE_INITIAL_STATE': lambda args: args['h0'] is not
None, 'USE_FINAL_STATE_GRADIENT': lambda args: args['dht'] is not None,
'USE_OFFSETS': lambda args: args['offsets'] is not None})
@triton.jit
def fused_recurrent_retention_bwd_kernel(q, k, v, h0, do, dq, dk, dv, dh0,
dht, offsets, scale... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/retention/fused_recurrent.py |
256c710f-0067-4c80-b37c-d4bbf785d671 | block_offsets.py | Forkxz/TritonDeepLearningKernel | kernel/block_offsets.py | add54b6318e8fa5fdbf8c7b47659de9fceaa5691 | 0 | @triton.jit
def block_offsets_3d(shape_x, shape_y, shape_z, stride_x, stride_y,
stride_z, offset_x, offset_y, offset_z, block_shape_x, block_shape_y,
block_shape_z, require_mask=False):
offs_x = tl.arange(0, block_shape_x) + offset_x
offs_y = tl.arange(0, block_shape_y) + offset_y
offs_z = tl.arange... | {
"Data Type": [],
"Functionality": [],
"Memory Access Pattern": [
"Strided Access",
"Tiled"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/Forkxz/TritonDeepLearningKernel/blob/add54b6318e8fa5fdbf8c7b47659de9fceaa5691/kernel/block_offsets.py |
a0e121c3-7ebc-4eb8-bdeb-cb903a4b9850 | softmax.py | Nagi-ovo/diy | OpenAI-Triton/softmax.py | d7c119aa762b9103109d29abaebee345246fe5d7 | 0 | @triton.jit
def _softmax_fwd_kernel(output_ptr, stride_output_rop, input_ptr,
stride_input_row, num_cols, block_size: tl.constexpr):
row_index = tl.program_id(0)
row_start_ptr = input_ptr + row_index * stride_input_row
col_offsets = tl.arange(0, block_size)
input_pointers = row_start_ptr + col_offse... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Softmax"
],
"Memory Access Pattern": [
"Strided Access",
"Coalesced"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/Nagi-ovo/diy/blob/d7c119aa762b9103109d29abaebee345246fe5d7/OpenAI-Triton/softmax.py |
735e0114-467d-4933-bae8-e10228aac0d5 | chunk.py | sustcsonglin/flash-linear-attention | fla/ops/abc/chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def chunk_abc_bwd_kernel_rcum_intra(s, z, ss, doo, s_s_h, s_s_t, s_s_d, T:
tl.constexpr, S: tl.constexpr, BT: tl.constexpr, BC: tl.constexpr, BS:
tl.constexpr, NC: tl.constexpr):
i_s, i_c, i_bh = tl.program_id(0), tl.program_id(1), tl.program_id(2)
i_t, i_i = i_c // NC, i_c % NC
o_i = tl... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/abc/chunk.py |
e64784a5-f146-4390-946f-2befee210aea | triton_jagged_tensor_ops.py | pytorch/FBGEMM | fbgemm_gpu/fbgemm_gpu/triton/jagged/triton_jagged_tensor_ops.py | fe980ab54a6e28818d81c8694b6564e7f804418b | 0 | @triton.jit
def triton_batched_dense_vec_jagged_2d_matmul(jagged_tensor_ptr, dense_ptr,
jagged_offset, thread_block_col_size: tl.constexpr, dense_row_stride,
jagged_value_row_stride, D, H: tl.constexpr, output_ptr) ->None:
pid = tl.program_id(0)
GRID_DIM_COL = (D + thread_block_col_size - 1) // thread_b... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Strided Access",
"Blocked Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"BSD",
"MIT"
] | https://github.com/pytorch/FBGEMM/blob/fe980ab54a6e28818d81c8694b6564e7f804418b/fbgemm_gpu/fbgemm_gpu/triton/jagged/triton_jagged_tensor_ops.py |
fae6dfee-0856-48f2-8c09-198c2bf008d0 | mse.py | l1351868270/implicit_gemm.triton | triton_kernel/mse.py | 64eb8548ccf4576883c928f6315be8b24680a455 | 0 | @triton.jit
def _ld_mse_bwd_kernel(grad_ptr, input_ptr, target_ptr, grad_output,
grad_row_stride, input_row_stride, target_row_stride, n_rows, n_cols,
BLOCK_SIZE: tl.constexpr):
pid = tl.program_id(0)
col_offsets = tl.arange(0, BLOCK_SIZE)
mask = col_offsets < n_cols
grad_ptrs = grad_ptr + pid *... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/l1351868270/implicit_gemm.triton/blob/64eb8548ccf4576883c928f6315be8b24680a455/triton_kernel/mse.py |
d2319479-4740-45ba-a17c-d0a3e92ef405 | fused_chunk.py | sustcsonglin/flash-linear-attention | fla/ops/gla/fused_chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def bwd_decay_global_cumsum(dq_inner, dq_inter, dk_inner, dk_inter, q, k, g,
dg, s_k_h, BT: tl.constexpr, BK: tl.constexpr, K: tl.constexpr):
i_k, i_c, i_bh = tl.program_id(0), tl.program_id(1), tl.program_id(2)
p_q = q + i_bh * s_k_h + i_k * BK + tl.arange(0, BK) + (i_c * BT + BT - 1
) ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/gla/fused_chunk.py |
c043b3cc-fffa-49f1-90d0-c95423a99f18 | kernels.py | pytorch-labs/tritonbench | tritonbench/operators/sum/kernels.py | 3a5dccb159834968567a2e45e561dc1aeaa8f8a8 | 0 | @triton.autotune(configs=[triton.Config({'BLOCK_SIZE_NON_REDUCE_DIM': b,
'BLOCK_SIZE_REDUCE_DIM': b}, num_warps=w) for b, w in itertools.product
([2, 4, 8, 16], [2, 4, 8])], key=['M', 'N'])
@triton.jit
def triton_sum_kernel_1D_result_buffer_then_sum(input_ptr, output_ptr, M, N,
BLOCK_SIZE_NON_REDUCE_DIM: tl... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access",
"Blocked Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/pytorch-labs/tritonbench/blob/3a5dccb159834968567a2e45e561dc1aeaa8f8a8/tritonbench/operators/sum/kernels.py |
1204a122-b1ff-4519-8d58-a59f218f6150 | batched_matmul.py | MichaelWei7/torch | _inductor/triton_ops/batched_matmul.py | 4bfe6988308edc9544ddae94bfdcf83a4326b04a | 0 | @triton.heuristics({'EVEN_K': lambda args: args['K'] % (args['BLOCK_K'] *
args['SPLIT_K']) == 0})
@triton.autotune(configs=[triton.Config({'BLOCK_M': 128, 'BLOCK_N': 256,
'BLOCK_K': 32, 'SPLIT_K': 1}, num_stages=3, num_warps=8), triton.Config
({'BLOCK_M': 256, 'BLOCK_N': 128, 'BLOCK_K': 32, 'SPLIT_K': 1},
... | {
"Data Type": [
"fp32",
"int32"
],
"Functionality": [
"Matrix Multiplication"
],
"Memory Access Pattern": [
"Tiled",
"Blocked Access"
],
"Parallelization Strategy": [
"Persistent Kernels"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/MichaelWei7/torch/blob/4bfe6988308edc9544ddae94bfdcf83a4326b04a/_inductor/triton_ops/batched_matmul.py |
b5fecd23-5b89-4b3c-8fad-037f53bf7408 | prefix_sums.py | intel/intel-xpu-backend-for-triton | benchmarks/triton_kernels_benchmark/prefix_sums.py | 6ee08cd29ec3cd8b8eb3f92b9c93977fc6f6e5c2 | 0 | @triton.jit
def scan_kernel(x_ptr, BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.
constexpr, AXIS: tl.constexpr):
range_m = tl.arange(0, BLOCK_SIZE_M)
range_n = tl.arange(0, BLOCK_SIZE_N)
x = tl.load(x_ptr + range_m[:, None] * BLOCK_SIZE_N + range_n[None, :])
x = tl.cumsum(x, axis=AXIS)
tl.store(... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/intel/intel-xpu-backend-for-triton/blob/6ee08cd29ec3cd8b8eb3f92b9c93977fc6f6e5c2/benchmarks/triton_kernels_benchmark/prefix_sums.py |
3a506554-8ef0-4725-a568-9de1c8c01198 | layer_norm_kernels.py | BobMcDear/attorch | attorch/layer_norm_kernels.py | da06cb6236bb47195e33fe3986ed21c675ed94cc | 0 | @triton.autotune(configs=warps_kernel_configs(), key=['batch_dim', 'feat_dim'])
@triton.heuristics({'BLOCK_SIZE_BATCH': BLOCK_SIZE_BATCH_heuristic,
'BLOCK_SIZE_FEAT': lambda args: next_power_of_2(args['feat_dim'])})
@triton.jit
def layer_norm_forward_kernel(input_pointer, weight_pointer, bias_pointer,
mean_poin... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Normalization"
],
"Memory Access Pattern": [
"Strided Access",
"Coalesced"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput",
"Compute Bound"
]
} | [
"MIT"
] | https://github.com/BobMcDear/attorch/blob/da06cb6236bb47195e33fe3986ed21c675ed94cc/attorch/layer_norm_kernels.py |
77b783f4-944a-4989-ab38-630883cdbda5 | fused_chunk.py | sustcsonglin/flash-linear-attention | fla/ops/gla/fused_chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def fwd_inner_chunk(q, k, g, A, s_k_h, s_k_t, s_k_d, scale, B: tl.constexpr,
H: tl.constexpr, T: tl.constexpr, K: tl.constexpr, BT: tl.constexpr, BK:
tl.constexpr):
i_k, i_t, i_bh = tl.program_id(0), tl.program_id(1), tl.program_id(2)
p_k = tl.make_block_ptr(k + i_bh * s_k_h, (T, K), (s_k_t,... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/gla/fused_chunk.py |
034eebc4-faf8-4f0a-b847-5d898fd31da7 | lstm_bw.py | NX-AI/flashrnn | flashrnn/flashrnn/triton_fused/lstm_bw.py | 3fca666a81c8740af4878d7bc5e2a51900e4fe14 | 0 | @triton.jit
def triton_tanh(x):
return (1.0 - tl.exp(-2.0 * x)) / (1.0 + tl.exp(-2.0 * x))
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Activation Functions"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT",
"BSD"
] | https://github.com/NX-AI/flashrnn/blob/3fca666a81c8740af4878d7bc5e2a51900e4fe14/flashrnn/flashrnn/triton_fused/lstm_bw.py |
33a2ed2a-c830-4a48-9359-fe4d01c30f36 | causal_conv1d_varlen.py | shaielc/MambaLinearCode | causal-conv1d/causal_conv1d/causal_conv1d_varlen.py | 567fc4ae197064540c1a558bbb60c78f55b95fef | 0 | @triton.jit
def _causal_conv1d_varlen_states(X, CU_SEQLENS, STATES, state_len, dim,
stride_x_seqlen, stride_x_dim, stride_states_batch,
stride_states_seqlen, stride_states_dim, BLOCK_M: tl.constexpr, BLOCK_N:
tl.constexpr):
batch_idx = tl.program_id(2)
STATES += batch_idx * stride_states_batch
e... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Recurrent Neural Networks"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"BSD",
"Apache"
] | https://github.com/shaielc/MambaLinearCode/blob/567fc4ae197064540c1a558bbb60c78f55b95fef/causal-conv1d/causal_conv1d/causal_conv1d_varlen.py |
fc92abc9-d8fd-4398-8a22-d121aebc63d3 | logcumsumexp.py | sustcsonglin/flash-linear-attention | fla/ops/utils/logcumsumexp.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.autotune(configs=[triton.Config({'BT': 16}, num_warps=2), triton.
Config({'BT': 16}, num_warps=4), triton.Config({'BT': 16}, num_warps=8),
triton.Config({'BT': 32}, num_warps=2), triton.Config({'BT': 32},
num_warps=4), triton.Config({'BT': 32}, num_warps=8), triton.Config({
'BT': 64}, num_warps=... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Softmax"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/utils/logcumsumexp.py |
bea526aa-fd9a-4f16-8749-f490743aecce | attn_qk_int8_per_block_h64.py | rodjjo/editorium | editorium/app/server/pipelines/cogvideo/sageattention/attn_qk_int8_per_block_h64.py | 7b92e2c92a144bf23bbe6fe88e3d513ffcf7d694 | 0 | @triton.jit
def _attn_fwd_inner(acc, l_i, m_i, q, q_scale, K_ptrs, K_scale_ptr, V_ptrs,
start_m, BLOCK_M: tl.constexpr, HEAD_DIM: tl.constexpr, BLOCK_N: tl.
constexpr, STAGE: tl.constexpr, offs_m: tl.constexpr, offs_n: tl.
constexpr, N_CTX: tl.constexpr):
lo, hi = 0, N_CTX
for start_n in range(lo, h... | {
"Data Type": [
"fp16"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"Apache"
] | https://github.com/rodjjo/editorium/blob/7b92e2c92a144bf23bbe6fe88e3d513ffcf7d694/editorium/app/server/pipelines/cogvideo/sageattention/attn_qk_int8_per_block_h64.py |
eef6506d-e789-4c85-8695-427fcf745d3f | atomic.py | daemyung/practice-triton | atomic.py | 27f727726f1507c8380a1c11751d851c7c4a07ce | 0 | @triton.jit
def atomic_kernel(x_ptr, increment):
tl.atomic_add(x_ptr, increment)
| {
"Data Type": [
"uint8"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/daemyung/practice-triton/blob/27f727726f1507c8380a1c11751d851c7c4a07ce/atomic.py |
c87e2484-0947-436e-9ac0-d1273f24b0a3 | rmsnorm.py | ardywibowo/triton-mode | kernels/rmsnorm.py | 5cd773ec95e25e23c6b75e312c7a9a1c6eb650b1 | 0 | @triton.jit
def triton_rmsnorm_backward(dY_ptr, dY_row_stride, X_ptr, X_row_stride,
X_dtype: tl.constexpr, W_ptr, RSTD_ptr, RSTD_row_stride, dW_ptr,
dW_row_stride, n_rows, n_cols, offset, rows_per_program: tl.constexpr,
BLOCK_SIZE: tl.constexpr):
row_block_id = tl.program_id(0)
row_start = row_block... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation",
"Normalization"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/ardywibowo/triton-mode/blob/5cd773ec95e25e23c6b75e312c7a9a1c6eb650b1/kernels/rmsnorm.py |
61fe3795-54b0-4858-973e-4e780e63884b | fused_chunk.py | sustcsonglin/flash-linear-attention | fla/ops/based/fused_chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def fused_chunk_based_bwd_kernel(q, k, v, do, dz, dq, dk, dv, s_k_h, s_k_t,
s_k_d, s_v_h, s_v_t, s_v_d, scale, B: tl.constexpr, H: tl.constexpr, T:
tl.constexpr, K: tl.constexpr, V: tl.constexpr, BT: tl.constexpr, BK:
tl.constexpr, BV: tl.constexpr):
i_v, i_k, i_bh = tl.program_id(0), tl.pro... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/based/fused_chunk.py |
f8d8edc6-bf70-4ed3-b262-9a5b4a3846e7 | parallel.py | sustcsonglin/flash-linear-attention | fla/ops/simple_gla/parallel.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def parallel_simple_gla_bwd_kernel_dkv(i_bh, i_t, i_k, i_v, i_kv, q, k, v,
g, do, dk, dv, dg, s_k_h, s_k_t, s_v_h, s_v_t, scale, B: tl.constexpr,
H: tl.constexpr, T: tl.constexpr, K: tl.constexpr, V: tl.constexpr, BT:
tl.constexpr, BS: tl.constexpr, BK: tl.constexpr, BV: tl.constexpr):
p_k =... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/simple_gla/parallel.py |
eb17d738-56f7-4b95-9035-3e3775974f90 | fused_chunk.py | sustcsonglin/flash-linear-attention | fla/ops/retention/fused_chunk.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.jit
def fused_chunk_retention_bwd_kernel(q, k, v, do, dq, dk, dv, h0, scale, B:
tl.constexpr, H: tl.constexpr, T: tl.constexpr, K: tl.constexpr, V: tl.
constexpr, BT: tl.constexpr, BK: tl.constexpr, BV: tl.constexpr,
USE_INITIAL_STATE: tl.constexpr, CHECK: tl.constexpr):
i_v, i_k, i_bh = tl.prog... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Backpropagation"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/retention/fused_chunk.py |
fdc8c514-97dc-4a5b-b5ee-8cb84a245397 | lightseq_async_attn.py | EvolvingLMMs-Lab/LongVA | easy_context/dist_flash_attn/lightseq_async_attn.py | 76b7c33946936361eeb5a18b2c9fcc5fe63e9434 | 0 | @triton.jit
def _rescale_kernel(peer_m, m, peer_l, l, peer_o, o, L, stride_oz,
stride_oh, stride_om, stride_on, Z, H, N_CTX, BLOCK_M: tl.constexpr,
BLOCK_DMODEL: tl.constexpr, BLOCK_N: tl.constexpr, LAST_STEP: tl.constexpr
):
start_m = tl.program_id(0)
off_hz = tl.program_id(1)
o_offset = off_hz... | {
"Data Type": [
"fp32",
"bf16"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"Apache"
] | https://github.com/EvolvingLMMs-Lab/LongVA/blob/76b7c33946936361eeb5a18b2c9fcc5fe63e9434/easy_context/dist_flash_attn/lightseq_async_attn.py |
04b500e9-43c3-4a8d-8bdf-3fa2cecce9bc | prefix_prefill.py | IBM/vllm | vllm/attention/ops/prefix_prefill.py | 99523dd62be2ecf6c6db15e8133aaaf7855e7e86 | 0 | @triton.jit
def _fwd_kernel(Q, K, V, K_cache, V_cache, B_Loc, sm_scale, k_scale,
v_scale, B_Start_Loc, B_Seqlen, B_Ctxlen, block_size, x, Out,
stride_b_loc_b, stride_b_loc_s, stride_qbs, stride_qh, stride_qd,
stride_kbs, stride_kh, stride_kd, stride_vbs, stride_vh, stride_vd,
stride_obs, stride_oh, stri... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"Apache"
] | https://github.com/IBM/vllm/blob/99523dd62be2ecf6c6db15e8133aaaf7855e7e86/vllm/attention/ops/prefix_prefill.py |
2f8b0d83-5616-4c9c-832e-4472431e9e84 | paged_attn.py | AlibabaPAI/FLASHNN | flashnn/triton_kernels/paged_attn.py | 528a9301587f5fb135b25d973a87ba0a40a703a7 | 0 | @triton.jit
def _inner_paged_attn_unroll_0_kernel(q, k_cache, v_cache, stride_km,
block_base_ptrs, base_offs_kv, alibi_slope, block_offs, seq_len, qkv,
qk_max, exp_sum, BLOCK_SIZE: tl.constexpr, LO: tl.constexpr, HI: tl.
constexpr):
for block_idx in range(LO, HI, 1):
offs_kv_0 = tl.load(block_ba... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"Apache"
] | https://github.com/AlibabaPAI/FLASHNN/blob/528a9301587f5fb135b25d973a87ba0a40a703a7/flashnn/triton_kernels/paged_attn.py |
5ae29aea-e9ab-4b04-990c-d208c7ac02ac | kernels.py | pytorch-labs/tritonbench | tritonbench/operators/sum/kernels.py | 3a5dccb159834968567a2e45e561dc1aeaa8f8a8 | 0 | @triton.jit
def triton_sum_kernel_scalar_result(input_ptr, output_ptr, M, BLOCK_SIZE_M:
tl.constexpr):
pid = tl.program_id(axis=0)
block_start = pid * BLOCK_SIZE_M
offsets = block_start + tl.arange(0, BLOCK_SIZE_M)
mask = offsets < M
x = tl.load(input_ptr + offsets, mask=mask, other=mask)
ou... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/pytorch-labs/tritonbench/blob/3a5dccb159834968567a2e45e561dc1aeaa8f8a8/tritonbench/operators/sum/kernels.py |
09deca13-45a1-459d-85c5-acec7312d548 | parallel.py | sustcsonglin/flash-linear-attention | fla/ops/delta_rule/parallel.py | 5968de9a22c096326b19859cfe05dac36155c31d | 0 | @triton.autotune(configs=[triton.Config({}, num_warps=1), triton.Config({},
num_warps=2)], key=['BT'])
@triton.jit
def save_intra_chunk_attn(A, A_local, T: tl.constexpr, BT: tl.constexpr):
i_t, i_bh = tl.program_id(0), tl.program_id(1)
p_A = tl.make_block_ptr(A + i_bh * T * T, (T, T), (T, 1), (i_t * BT,
... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms"
],
"Memory Access Pattern": [
"Coalesced"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Memory-Bound"
]
} | [
"MIT"
] | https://github.com/sustcsonglin/flash-linear-attention/blob/5968de9a22c096326b19859cfe05dac36155c31d/fla/ops/delta_rule/parallel.py |
9c1a7f44-002d-4db7-b1da-ef6ca965c300 | blocksparse_sum.py | kimiasa/Experiments | src/models/attention/blocksparse_sum.py | c4e73bfefd8290695ec52b6386b6b81838ca94a1 | 0 | @triton.heuristics({'num_warps': lambda *args, **meta: num_warps(args[3] *
meta['BLOCK'])})
@triton.heuristics({'TN': lambda *args, **meta: next_power_of_2(args[3] *
meta['BLOCK'])})
@triton.jit
def _forward(X, OUT, LUT, sizemax, stride_zx, stride_zout, stride_hout, **meta
):
TN = meta['TN']
BLOCK =... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"Apache"
] | https://github.com/kimiasa/Experiments/blob/c4e73bfefd8290695ec52b6386b6b81838ca94a1/src/models/attention/blocksparse_sum.py |
3d84e0a7-71fe-46f5-a28a-531bf86d60ad | 06-fused-attention.py | 2lambda123/triton | python/tutorials/06-fused-attention.py | 09e27725b89043a07f49c440db6a9aedcfba8432 | 0 | @triton.jit
def _bwd_kernel(Q, K, V, sm_scale, Out, DO, DQ, DK, DV, L, D, stride_qz,
stride_qh, stride_qm, stride_qk, stride_kz, stride_kh, stride_kn,
stride_kk, stride_vz, stride_vh, stride_vk, stride_vn, Z, H, N_CTX,
num_block, BLOCK_M: tl.constexpr, BLOCK_DMODEL: tl.constexpr, BLOCK_N:
tl.constexpr, ... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Backpropagation"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Thread-Block Mappings"
],
"Performance Objective": [
"Compute Bound",
"High Throughput"
]
} | [
"MIT"
] | https://github.com/2lambda123/triton/blob/09e27725b89043a07f49c440db6a9aedcfba8432/python/tutorials/06-fused-attention.py |
02bde305-1b40-42a5-b808-be8ee0f8f362 | outer_softmax_online.py | iclementine/optimize_softmax | outer_softmax_online.py | 6ddeee3481dd5e63f4a30b946c417e97bc4494bf | 0 | @triton.jit
def next_multiple_of(a, b):
return tl.cidv(a, b) * b
| {
"Data Type": [
"int8"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"Compute Bound"
]
} | [
"BSD"
] | https://github.com/iclementine/optimize_softmax/blob/6ddeee3481dd5e63f4a30b946c417e97bc4494bf/outer_softmax_online.py |
35ba6a63-cf05-402d-aa41-8b691e1e0c2e | flash_attention.py | falkaer/multi-scale-music | seq/flash_attention.py | a7794ddfb3bbd95b70acf3fe72a08d8a1d47564d | 0 | @triton.jit
def bounds_mask(offs_m, offs_n, M, N, EVEN_M: tl.constexpr, EVEN_N: tl.
constexpr):
if EVEN_M & EVEN_N:
val = 0
else:
mask = make_bounds(offs_m, offs_n, M, N, EVEN_M, EVEN_N)
val = tl.where(mask, 0, float('-inf'))
return val
| {
"Data Type": [
"fp32"
],
"Functionality": [
"Attention Mechanisms",
"Elementwise Operations"
],
"Memory Access Pattern": [
"Strided Access"
],
"Parallelization Strategy": [],
"Performance Objective": [
"Latency Sensitive"
]
} | [
"MIT"
] | https://github.com/falkaer/multi-scale-music/blob/a7794ddfb3bbd95b70acf3fe72a08d8a1d47564d/seq/flash_attention.py |
e0ec9d80-09d9-4544-b5fb-203ac2fa2c98 | test_inductor.py | triton-lang/kernels | test/test_inductor.py | eeeebdd8be7d13629de22d600621e6234057eed3 | 0 | @triton.jit
def fn(out_ptr0, rnumel, RBLOCK: tl.constexpr):
rbase = tl.arange(0, RBLOCK)[None, :]
for roffset in range(0, rnumel, RBLOCK):
rindex = roffset + rbase
rmask = rindex < rnumel
tmp3 = tl.where(rmask, 1, 0)
tmp6 = tl.cumsum(tmp3, 1)
tl.store(out_ptr0 + rindex, t... | {
"Data Type": [
"fp32"
],
"Functionality": [
"Elementwise Operations"
],
"Memory Access Pattern": [],
"Parallelization Strategy": [
"Grid-Stride Loops"
],
"Performance Objective": [
"High Throughput"
]
} | [
"MIT"
] | https://github.com/triton-lang/kernels/blob/eeeebdd8be7d13629de22d600621e6234057eed3/test/test_inductor.py |
c629a162-a019-40d7-b34a-4b77786b3e07 | RzLinearIdx.py | apd10/RzLinear | python/rz_linear/impl/RzLinearIdx.py | eb56657b2de0a97f398f88af421b0fbcbc5469c9 | 0 | @triton.jit
def rz_linear_idx_kernel(bh_ptr, b_ptr, K, N, H, R3, R2, R1, R0, stride_bk,
stride_bn, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr):
pid = tl.program_id(axis=0)
grid_n = tl.cdiv(N, BLOCK_SIZE_N)
pid_k = pid // grid_n
pid_n = pid % grid_n
bh_offset = bh_ptr + tl.arange(0, B... | {
"Data Type": [
"fp32"
],
"Functionality": [],
"Memory Access Pattern": [
"Transposed Access",
"Blocked Access"
],
"Parallelization Strategy": [],
"Performance Objective": []
} | [
"MIT"
] | https://github.com/apd10/RzLinear/blob/eb56657b2de0a97f398f88af421b0fbcbc5469c9/python/rz_linear/impl/RzLinearIdx.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.