Registry / llm-agents / causal-conv1d

causal-conv1d

JSON →
library1.6.1pypypiunverified

Causal depthwise 1D convolution CUDA kernel with PyTorch interface, commonly used as a building block for state-space models like Mamba. Current version: 1.6.1. Active development; breaking API changes between v1.x versions.

pip install causal-conv1d
INSTALL
IMPORT
SIG · CAUSAL-CONV1D
C
causal-conv1d
llm-agentspythonv1.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

causal_conv1d_fn
✓ from causal_conv1d import causal_conv1d_fn
✗ from causal_conv1d.causal_conv1d import causal_conv1d_fn
Not a submodule; direct import from package top-level.
CausalConv1dFn
✓ from causal_conv1d import CausalConv1dFn
✗ from causal_conv1d import CausalConv1d
CausalConv1d class never existed; use CausalConv1dFn.

Basic usage: apply causal depthwise conv1d on CUDA tensor.

import torch from causal_conv1d import causal_conv1d_fn x = torch.randn(2, 64, 128, device='cuda') weight = torch.randn(64, 3, device='cuda') # depthwise, kernel_size=3 bias = torch.randn(64, device='cuda') out = causal_conv1d_fn(x, weight, bias, activation='silu') print(out.shape) # torch.Size([2, 64, 128])
Debug
Known issues
breakingIn v1.4.0, the function signature changed: activation parameter must be passed as a string (e.g., 'silu') instead of None or torch.nn.SiLU. Also dims argument was removed.
fix
Update calls: use activation='silu' (or None) and remove dims from kwargs.
affects: >=1.4.0
gotchaThe kernel only supports CUDA. Passing CPU tensors will raise a RuntimeError. Always ensure inputs are on CUDA device.
fix
Move tensors to CUDA: x = x.cuda() before calling causal_conv1d_fn.
affects: all
gotchaWeight tensor must be 2D (out_channels, kernel_size) for depthwise convolution. Using 1D or transposed dimensions causes silent shape errors or kernel launch failures.
fix
Verify weight shape: weight.shape should be (C, K) where C is channels and K is kernel size (odd).
affects: all
deprecatedThe old import path causal_conv1d.causal_conv1d_interface is deprecated since v1.2.0. Use causal_conv1d directly.
fix
Change import to: from causal_conv1d import causal_conv1d_fn
affects: >=1.2.0
Upgrade
Version history
1.6.1latest on PyPI · released Mar 10, 2026
Audit
Dependencies
torchrequiredCore dependency; provides tensor types and CUDA support
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources