Causal depthwise conv1d in CUDA, with a PyTorch interface
Project description
Causal depthwise conv1d in CUDA with a PyTorch interface
Features:
- Support fp32, fp16, bf16.
- Kernel size 2, 3, 4.
How to use
from causal_conv1d import causal_conv1d_fn
def causal_conv1d_fn(x, weight, bias=None, activation=None):
"""
x: (batch, dim, seqlen)
weight: (dim, width)
bias: (dim,)
activation: either None or "silu" or "swish"
out: (batch, dim, seqlen)
"""
Equivalent to:
import torch.nn.functional as F
F.conv1d(x, weight.unsqueeze(1), bias, padding=width - 1, groups=dim)[..., :seqlen]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for causal_conv1d-1.2.0.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e0ff303383c5382e81da1b3ae781488ec86b761d803fbf7999b94ef5cadc5e |
|
MD5 | 2622cadc868e061738532627f72f7b2a |
|
BLAKE2b-256 | 5b60d0c1d2f15206406d67e60499172450c28d43abad6d45158242f9f4e2d443 |