entry_point stringlengths 1 65 | original_triton_python_code stringlengths 208 619k | optimised_triton_code stringlengths 1.15k 275k | repo_name stringlengths 7 115 | module_name stringlengths 1 65 | synthetic bool 1
class | uuid int64 0 18.5k | licenses listlengths 1 6 | stars int64 0 19.8k | sha stringlengths 40 40 | repo_link stringlengths 72 180 |
|---|---|---|---|---|---|---|---|---|---|---|
RAddInt | import torch
class RAddInt(torch.nn.Module):
def __init__(self):
super(RAddInt, self).__init__()
def forward(self, x):
return 1 + x
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | RAddInt | false | 18,430 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TensorClampOptionMin | import torch
class TensorClampOptionMin(torch.nn.Module):
def forward(self, x):
return x.clamp(min=-0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Akababa/torch2trt | TensorClampOptionMin | false | 18,431 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TorchDiv | import torch
class TorchDiv(torch.nn.Module):
def __init__(self):
super(TorchDiv, self).__init__()
def forward(self, x, y):
return torch.div(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | TorchDiv | false | 18,432 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TorchSub | import torch
class TorchSub(torch.nn.Module):
def __init__(self):
super(TorchSub, self).__init__()
def forward(self, x, y):
return torch.sub(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | TorchSub | false | 18,433 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
MLPDecoder | import torch
import torch.nn as nn
class MLPDecoder(nn.Module):
"""
MLP based decoder model for edge prediction.
"""
def __init__(self, input_dim, num_classes, dropout=0.0, bias=False,
init='xav_uniform'):
super(MLPDecoder, self).__init__()
assert init in ('xav_uniform', 'kaim... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.... | AlenUbuntu/Fashion-AI | MLPDecoder | false | 18,434 | [
"Apache-2.0"
] | 3 | d0e77cea81448fb20697828ee12fa57889df302c | https://github.com/AlenUbuntu/Fashion-AI/tree/d0e77cea81448fb20697828ee12fa57889df302c |
LinearWeightNorm | import torch
from torch.nn.parameter import Parameter
import torch.nn.functional as F
class LinearWeightNorm(torch.nn.Module):
def __init__(self, in_features, out_features, bias=True, weight_scale=
None, weight_init_stdv=0.1):
super(LinearWeightNorm, self).__init__()
self.in_features = in... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch.nn.param... | Akash-Sharma-1/Training-Triplet-Networks-with-GAN | LinearWeightNorm | false | 18,435 | [
"MIT"
] | 2 | b4b1e683162908f243c4f1ba4ec9cda2314fbadc | https://github.com/Akash-Sharma-1/Training-Triplet-Networks-with-GAN/tree/b4b1e683162908f243c4f1ba4ec9cda2314fbadc |
TensorClampMax | import torch
class TensorClampMax(torch.nn.Module):
def forward(self, x):
return x.clamp_max(0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Akababa/torch2trt | TensorClampMax | false | 18,436 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
Sub | import torch
class Sub(torch.nn.Module):
def __init__(self):
super(Sub, self).__init__()
def forward(self, x, y):
return x - y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | Sub | false | 18,437 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TensorClampMin | import torch
class TensorClampMin(torch.nn.Module):
def forward(self, x):
return x.clamp_min(-0.1)
def get_inputs():
return [torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torc... | Akababa/torch2trt | TensorClampMin | false | 18,438 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
Add | import torch
class Add(torch.nn.Module):
def __init__(self):
super(Add, self).__init__()
def forward(self, x, y):
return x + y
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | Add | false | 18,439 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TorchMul | import torch
class TorchMul(torch.nn.Module):
def __init__(self):
super(TorchMul, self).__init__()
def forward(self, x, y):
return torch.mul(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
@triton.j... | Akababa/torch2trt | TorchMul | false | 18,440 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
TorchPow | import torch
class TorchPow(torch.nn.Module):
def __init__(self):
super(TorchPow, self).__init__()
def forward(self, x, y):
return torch.pow(x, y)
def get_inputs():
return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4])]
def get_init_inputs():
return [[], {}]
| import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_c... | Akababa/torch2trt | TorchPow | false | 18,441 | [
"MIT"
] | 2 | 03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 | https://github.com/Akababa/torch2trt/tree/03063b74a7eb40f5aac88d49be6b8b5e4e4e92d7 |
EQConv2D | import torch
import torch.nn as nn
class EQConv2D(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,
padding=1, gain=2):
super().__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size,
stride, padding)
self.scale = (gain... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_s... | AjaybirRandhawa/Face-Generator | EQConv2D | false | 18,442 | [
"Apache-2.0"
] | 2 | 9cac0822b6e6337c3599e949154ce44eeae5746b | https://github.com/AjaybirRandhawa/Face-Generator/tree/9cac0822b6e6337c3599e949154ce44eeae5746b |
LayerNorm | from _paritybench_helpers import _mock_config
import torch
import torch.nn as nn
class LayerNorm(nn.Module):
"""A layernorm module in the TF style (epsilon inside the square root)."""
def __init__(self, cfg, variance_epsilon=1e-12):
super().__init__()
self.gamma = nn.Parameter(torch.ones(cfg.... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_... | AWarno/CodeHateChallenge | LayerNorm | false | 18,443 | [
"MIT"
] | 3 | f02bab7ca93a2441b7b2901094bedee72830b266 | https://github.com/AWarno/CodeHateChallenge/tree/f02bab7ca93a2441b7b2901094bedee72830b266 |
ClassHead | import torch
import torch.nn as nn
from itertools import product as product
class ClassHead(nn.Module):
def __init__(self, inchannels=512, num_anchors=3):
super(ClassHead, self).__init__()
self.num_anchors = num_anchors
self.conv1x1 = nn.Conv2d(inchannels, self.num_anchors * 2,
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from itertools import product as product
assert_size_strid... | Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition | ClassHead | false | 18,444 | [
"MIT"
] | 2 | a52ca53e15332ab706f6ed23045b38ea6d38dfd9 | https://github.com/Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition/tree/a52ca53e15332ab706f6ed23045b38ea6d38dfd9 |
BboxHead | import torch
import torch.nn as nn
from itertools import product as product
class BboxHead(nn.Module):
def __init__(self, inchannels=512, num_anchors=3):
super(BboxHead, self).__init__()
self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 4, kernel_size=(
1, 1), stride=1, padding=0)
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from itertools import product as product
assert_size_strid... | Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition | BboxHead | false | 18,445 | [
"MIT"
] | 2 | a52ca53e15332ab706f6ed23045b38ea6d38dfd9 | https://github.com/Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition/tree/a52ca53e15332ab706f6ed23045b38ea6d38dfd9 |
LandmarkHead | import torch
import torch.nn as nn
from itertools import product as product
class LandmarkHead(nn.Module):
def __init__(self, inchannels=512, num_anchors=3):
super(LandmarkHead, self).__init__()
self.conv1x1 = nn.Conv2d(inchannels, num_anchors * 10, kernel_size=
(1, 1), stride=1, padd... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
from itertools import product as product
assert_size_strid... | Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition | LandmarkHead | false | 18,446 | [
"MIT"
] | 2 | a52ca53e15332ab706f6ed23045b38ea6d38dfd9 | https://github.com/Akshobhya2018eeb1137/Attendance_System_Using_Face_Recognition/tree/a52ca53e15332ab706f6ed23045b38ea6d38dfd9 |
Attention | import torch
import torch.optim
import torch.utils.data
from torch import nn
class Attention(nn.Module):
"""
Attention Network.
"""
def __init__(self, encoder_dim, decoder_dim, attention_dim):
"""
:param encoder_dim: feature size of encoded images
:param decoder_dim: size of d... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Afosado/180b_capstone_xai | Attention | false | 18,447 | [
"MIT"
] | 2 | 808768e8fc73d260845921e8174b69286c066eca | https://github.com/Afosado/180b_capstone_xai/tree/808768e8fc73d260845921e8174b69286c066eca |
BertPooler | from _paritybench_helpers import _mock_config
import torch
from torch import nn
class BertPooler(nn.Module):
def __init__(self, config):
super(BertPooler, self).__init__()
self.dense = nn.Linear(config.hidden_size, config.hidden_size)
self.activation = nn.Tanh()
def forward(self, hid... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
from torch import n... | Albert-Ma/bert-fine-tuned-gain | BertPooler | false | 18,448 | [
"Apache-2.0"
] | 2 | f752c1182f1c800f5f56998e13fd6115929df655 | https://github.com/Albert-Ma/bert-fine-tuned-gain/tree/f752c1182f1c800f5f56998e13fd6115929df655 |
SequenceCrossEntropyLoss | import torch
import torch.utils.data
from torch import nn
from torch.nn.utils.rnn import *
from sklearn.metrics import *
class SequenceCrossEntropyLoss(nn.Module):
def __init__(self):
super(SequenceCrossEntropyLoss, self).__init__()
self.criterion = nn.CrossEntropyLoss(reduce=False)
def forw... | import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.utils.dat... | APMplusplus/falkon | SequenceCrossEntropyLoss | false | 18,449 | [
"Apache-2.0"
] | 2 | 95708ed0b28c4ec0f611446a478e9c3445eb3508 | https://github.com/APMplusplus/falkon/tree/95708ed0b28c4ec0f611446a478e9c3445eb3508 |
ResidualBlock | import torch
class ConvLayer(torch.nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride):
super(ConvLayer, self).__init__()
reflection_padding = kernel_size // 2
self.reflection_pad = torch.nn.ReflectionPad2d(reflection_padding)
self.conv2d = torch.nn.Conv... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Aftaab99/pytorch-multiple-style-transfer | ResidualBlock | false | 18,450 | [
"BSD-3-Clause"
] | 3 | 172d384d8ef06d005a49715a9c75fc8f26a4e4f9 | https://github.com/Aftaab99/pytorch-multiple-style-transfer/tree/172d384d8ef06d005a49715a9c75fc8f26a4e4f9 |
BertSelfAttention | from _paritybench_helpers import _mock_config
import math
import torch
from torch import nn
class BertSelfAttention(nn.Module):
def __init__(self, config):
super(BertSelfAttention, self).__init__()
if config.hidden_size % config.num_attention_heads != 0:
raise ValueError(
... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.... | Albert-Ma/bert-fine-tuned-gain | BertSelfAttention | false | 18,451 | [
"Apache-2.0"
] | 2 | f752c1182f1c800f5f56998e13fd6115929df655 | https://github.com/Albert-Ma/bert-fine-tuned-gain/tree/f752c1182f1c800f5f56998e13fd6115929df655 |
PositionWiseFeedForward | from _paritybench_helpers import _mock_config
import math
import torch
import torch.nn as nn
def gelu(x):
"""Implementation of the gelu activation function by Hugging Face"""
return x * 0.5 * (1.0 + torch.erf(x / math.sqrt(2.0)))
class PositionWiseFeedForward(nn.Module):
""" FeedForward Neural Networks ... | import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime.triton_helpers import libdevice
import math
import ... | AWarno/CodeHateChallenge | PositionWiseFeedForward | false | 18,452 | [
"MIT"
] | 3 | f02bab7ca93a2441b7b2901094bedee72830b266 | https://github.com/AWarno/CodeHateChallenge/tree/f02bab7ca93a2441b7b2901094bedee72830b266 |
VAE | import torch
import torch.utils.data
from torch import nn
from torch.nn import functional as F
from torch.nn.utils.rnn import *
from sklearn.metrics import *
class VAE(nn.Module):
def __init__(self):
super(VAE, self).__init__()
self.encoder_fc = nn.Linear(784, 400)
self.mean_fc = nn.Linea... | import torch
from torch import device
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from... | APMplusplus/falkon | VAE | false | 18,453 | [
"Apache-2.0"
] | 2 | 95708ed0b28c4ec0f611446a478e9c3445eb3508 | https://github.com/APMplusplus/falkon/tree/95708ed0b28c4ec0f611446a478e9c3445eb3508 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.