flashinfer.cake_causal_conv1d_nondet_train.cake_causal_conv1d_nondet_train_forward

flashinfer.cake_causal_conv1d_nondet_train.cake_causal_conv1d_nondet_train_forward(x: Tensor, weight: Tensor, cu_seqlens: Tensor, *, bias: Tensor | None = None, out: Tensor | None = None, workspace: Tensor | None = None) → Tensor

Packed width-4 depthwise causal convolution + SiLU, training forward.

The package’s copy of the deterministic forward programs: y is bitwise the deterministic package’s, and the forward runs (without an alert) under torch’s deterministic mode.

Parameters:
  • x (torch.Tensor) – BF16 [S, C] or [1, S, C] contiguous packed activations of every document; C is a multiple of 8.

  • weight (torch.Tensor) – FP32 or BF16 [C, 4] contiguous taps; weight[c, 3] multiplies the current token.

  • cu_seqlens (torch.Tensor) – int32 [num_docs + 1] contiguous device prefix sums of the document lengths; the host reads its metadata only.

  • bias (torch.Tensor, optional) – FP32 or BF16 [C] contiguous per-channel bias, added after the taps.

  • out (torch.Tensor, optional) – Preallocated BF16 output of x’s shape, contiguous.

  • workspace (torch.Tensor, optional) – Caller-owned zeroed int32 buffer from cake_causal_conv1d_nondet_train_forward_workspace().

Returns:

BF16 y of x’s shape.

Return type:

torch.Tensor