Skip to main content

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]

Metadata

Release files for causal-conv1d 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for causal-conv1d 1.1.1
File Size Uploaded
causal_conv1d-1.1.1.tar.gz 6.6 kB Details

Release files / causal_conv1d-1.1.1.tar.gz

Download URL causal_conv1d-1.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cbbe1c399af13144b18d72345143aec84b1e7797b836465da0307b19eb6cbc0c
BLAKE2b-256 checksum
How to use checksums
52a576455f95cc4ec73c8387f3ea3fcb63256ca98d8bab2b16cf140edb5407e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page