Skip to content

Port of causal-conv1d to run and run efficiently on AMD.

License

Notifications You must be signed in to change notification settings

lightonai/causal-conv1d-amd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Causal depthwise conv1d in CUDA with a PyTorch interface

Features:

  • Support fp32, fp16, bf16.
  • Kernel size 2, 3, 4.

Installation

This port is set up to run efficiently on AMD. It does not retain support for Nvidia. It can be installed with

pip install .

Requirements

  • ROCM 6.0+

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]

About

Port of causal-conv1d to run and run efficiently on AMD.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Cuda 52.2%
  • Python 25.3%
  • C++ 19.5%
  • C 3.0%