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.1.3.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fabb73ca05101cc8afdbb5afe40d54411ca4a7741d988368c9f4ee0c2a4a0e22 |
|
MD5 | 13415e3b0382e9b09004baf63285a87b |
|
BLAKE2b-256 | 8887b1aaa3a9a81eab28622b2a809d5f91ddf742e4116b1115fd66ca95c85307 |