Sig combine functions#

sig_combine_cuda#

int sig_combine_cuda_f(const float *sig1, const float *sig2, float *out, uint64_t dimension, uint64_t degree) noexcept#

Combines two truncated signatures on the GPU using Chen’s identity (tensor product).

Given two signatures S(x1) and S(x2), computes S(x1) ⊗ S(x2) = S(x1 * x2), where x1 * x2 is the concatenation of paths x1 and x2.

Parameters:
  • sig1 – Pointer to first signature (row-major, on device), size = sig_length(dimension, degree).

  • sig2 – Pointer to second signature (row-major, on device), same size as sig1.

  • out – Pointer to output buffer (row-major, preallocated, on device), same size as sig1.

  • dimension – Dimension of the underlying path space.

  • degree – Truncation degree of the signatures.

Returns:

Status code (0 = success).

int sig_combine_cuda_d(const double *sig1, const double *sig2, double *out, uint64_t dimension, uint64_t degree) noexcept#

batch_sig_combine_cuda#

int batch_sig_combine_cuda_f(const float *sig1, const float *sig2, float *out, uint64_t batch_size, uint64_t dimension, uint64_t degree) noexcept#

Combines batches of truncated signatures on the GPU using Chen’s identity.

Parameters:
  • sig1 – Pointer to batch of first signatures (row-major, on device), size = batch_size * sig_length(dimension, degree).

  • sig2 – Pointer to batch of second signatures (row-major, on device), same size as sig1.

  • out – Pointer to output buffer (row-major, preallocated, on device), same size as sig1.

  • batch_size – Batch size.

  • dimension – Dimension of the underlying path space.

  • degree – Truncation degree of the signatures.

Returns:

Status code (0 = success).

int batch_sig_combine_cuda_d(const double *sig1, const double *sig2, double *out, uint64_t batch_size, uint64_t dimension, uint64_t degree) noexcept#

sig_combine_backprop_cuda#

int sig_combine_backprop_cuda_f(const float *sig_combined_deriv, float *sig1_deriv, float *sig2_deriv, const float *sig1, const float *sig2, uint64_t dimension, uint64_t degree) noexcept#

Backpropagation through sig_combine on the GPU.

Given dF/d(sig_combine(sig1, sig2)), computes dF/d(sig1) and dF/d(sig2).

Parameters:
  • sig_combined_deriv – Pointer to input derivatives (on device), size = sig_length(dimension, degree).

  • sig1_deriv – Pointer to output sig1 derivatives (on device, preallocated).

  • sig2_deriv – Pointer to output sig2 derivatives (on device, preallocated).

  • sig1 – Pointer to first signature (on device).

  • sig2 – Pointer to second signature (on device).

  • dimension – Dimension of the underlying path space.

  • degree – Truncation degree of the signatures.

Returns:

Status code (0 = success).

int sig_combine_backprop_cuda_d(const double *sig_combined_deriv, double *sig1_deriv, double *sig2_deriv, const double *sig1, const double *sig2, uint64_t dimension, uint64_t degree) noexcept#

batch_sig_combine_backprop_cuda#

int batch_sig_combine_backprop_cuda_f(const float *sig_combined_deriv, float *sig1_deriv, float *sig2_deriv, const float *sig1, const float *sig2, uint64_t batch_size, uint64_t dimension, uint64_t degree) noexcept#

Batch backpropagation through sig_combine on the GPU.

Parameters:
  • sig_combined_deriv – Pointer to input derivatives (on device), size = batch_size * sig_length(dimension, degree).

  • sig1_deriv – Pointer to output sig1 derivatives (on device, preallocated).

  • sig2_deriv – Pointer to output sig2 derivatives (on device, preallocated).

  • sig1 – Pointer to first signatures (on device).

  • sig2 – Pointer to second signatures (on device).

  • batch_size – Batch size.

  • dimension – Dimension of the underlying path space.

  • degree – Truncation degree of the signatures.

Returns:

Status code (0 = success).

int batch_sig_combine_backprop_cuda_d(const double *sig_combined_deriv, double *sig1_deriv, double *sig2_deriv, const double *sig1, const double *sig2, uint64_t batch_size, uint64_t dimension, uint64_t degree) noexcept#

Citation#

If you found this library useful in your research, please consider citing the paper:

@article{shmelev2025pysiglib,
  title={pySigLib-Fast Signature-Based Computations on CPU and GPU},
  author={Shmelev, Daniil and Salvi, Cristopher},
  journal={arXiv preprint arXiv:2509.10613},
  year={2025}
}