Matrix Operations#

CSR Operations#

Binary matrix-vector / matrix-matrix multiplication.

binary_csrmv

Product of a CSR sparse matrix and a dense vector using event-driven (binary) computation.

binary_csrmv_p

Low-level XLA custom-kernel primitive for binary_csrmv.

binary_csrmm

Product of a CSR sparse matrix and a dense matrix using event-driven (binary) computation.

binary_csrmm_p

Low-level XLA custom-kernel primitive for binary_csrmm.

Binary multiplication with a fused weight gather (indexed weights).

binary_csrmv_indexed

Event-driven CSR matrix-vector product with a fused weight gather index.

binary_csrmv_indexed_p

Low-level XLA custom-kernel primitive for binary_csrmv_indexed.

binary_csrmm_indexed

Event-driven CSR matrix-matrix product with a fused weight gather index.

binary_csrmm_indexed_p

Low-level XLA custom-kernel primitive for binary_csrmm_indexed.

Float matrix-vector / matrix-matrix multiplication.

csrmv

Product of a CSR sparse matrix and a dense vector.

csrmv_p

Low-level XLA custom-kernel primitive for csrmv.

csrmm

Product of a CSR sparse matrix and a dense matrix.

csrmm_p

Low-level XLA custom-kernel primitive for csrmm.

csrmv_dt2t

Element-wise product of a vector and CSR weights, indexed by CSR structure.

cscmv_dt2t(y, w, indices, indptr, *, shape)

Element-wise product of a vector and CSC weights, indexed by CSC structure.

csrmv_dt2t_p

Low-level XLA custom-kernel primitive for csrmv_dt2t.

csrmm_dt2t

Batched element-wise product of dense vectors and CSR weights, indexed by CSR structure.

cscmm_dt2t(y, w, indices, indptr, *, shape)

Batched element-wise product of dense vectors and CSC weights, indexed by CSC structure.

csrmm_dt2t_p

Low-level XLA custom-kernel primitive for csrmm_dt2t.

Plasticity operations.

update_csr_on_binary_pre

Update CSR synaptic weights triggered by presynaptic binary spike events.

update_csr_on_binary_pre_p

Low-level XLA custom-kernel primitive for update_csr_on_binary_pre.

update_csr_on_binary_post

Update CSR synaptic weights triggered by postsynaptic binary spike events.

update_csr_on_binary_post_p

Low-level XLA custom-kernel primitive for update_csr_on_binary_post.

update_csc_on_binary_pre(weight, indices, ...)

Update CSC synaptic weights triggered by presynaptic binary spike events.

update_csc_on_binary_post(weight, indices, ...)

Update CSC synaptic weights triggered by postsynaptic binary spike events.

Row slicing.

csr_slice_rows

Extract selected rows from a CSR matrix as a dense submatrix.

csr_slice_rows_p

Low-level XLA custom-kernel primitive for csr_slice_rows.

Dense Operations#

Dense-matrix @ binary-vector / binary-matrix.

binary_densemv

Perform event-driven dense matrix-vector multiplication with binary spikes.

binary_densemv_p

Low-level XLA custom-kernel primitive for binary_densemv.

binary_densemm

Perform event-driven dense matrix-matrix multiplication with binary spikes.

binary_densemm_p

Low-level XLA custom-kernel primitive for binary_densemm.

Plasticity operations.

update_dense_on_binary_pre

Update synaptic weights based on presynaptic spike events and postsynaptic traces.

update_dense_on_binary_pre_p

Low-level XLA custom-kernel primitive for update_dense_on_binary_pre.

update_dense_on_binary_post

Update synaptic weights based on postsynaptic spike events and presynaptic traces.

update_dense_on_binary_post_p

Low-level XLA custom-kernel primitive for update_dense_on_binary_post.

JITC Scalar Operations#

Binary matrix-vector / matrix-matrix multiplication.

binary_jitsmv

Perform the \(y=M@v\) or \(y=M.T@v\) operation, where \(M\) is just-in-time randomly generated with a scalar weight at each position.

binary_jitsmv_p

Low-level XLA custom-kernel primitive for binary_jitsmv.

binary_jitsmm

Perform the \(y=M@B\) or \(y=M.T@B\) operation, where \(M\) is just-in-time randomly generated with a scalar weight at each position.

binary_jitsmm_p

Low-level XLA custom-kernel primitive for binary_jitsmm.

Float matrix-vector / matrix-matrix multiplication.

jits

Generate a homogeneous sparse random matrix on-the-fly.

jits_p

Low-level XLA custom-kernel primitive for jits.

jitsmv

Perform the \(y=M@v\) or \(y=M.T@v\) operation, where \(M\) is just-in-time randomly generated with a scalar weight at each position.

jitsmv_p

Low-level XLA custom-kernel primitive for jitsmv.

jitsmm

Perform the \(y=M@B\) or \(y=M.T@B\) operation, where \(M\) is just-in-time randomly generated with a scalar weight at each position.

jitsmm_p

Low-level XLA custom-kernel primitive for jitsmm.

jitsmv_dt2t(weight, prob, y, seed, *, shape)

Generate per-synapse y * w values for a scalar JITC (mv) matrix.

JITC Normal Operations#

Binary matrix-vector / matrix-matrix multiplication.

binary_jitnmv

Event-driven matrix-vector multiplication with a JIT normal-distributed connectivity matrix.

binary_jitnmv_p

Low-level XLA custom-kernel primitive for binary_jitnmv.

binary_jitnmm(w_loc, w_scale, prob, B[, ...])

Event-driven matrix-matrix multiplication with a JIT normal-distributed connectivity matrix.

binary_jitnmm_p

Low-level XLA custom-kernel primitive for binary_jitnmm.

Float matrix-vector / matrix-matrix multiplication.

jitn

Materialise a JIT normally-distributed random connectivity matrix.

jitn_p

Low-level XLA custom-kernel primitive for jitn.

jitnmv

JIT normally-distributed matrix-vector product.

jitnmv_p

Low-level XLA custom-kernel primitive for jitnmv.

jitnmm

JIT normally-distributed matrix-matrix product.

jitnmm_p

Low-level XLA custom-kernel primitive for jitnmm.

jitnmv_dt2t(w_loc, w_scale, prob, y, seed, ...)

Generate per-synapse y * w values for a normal JITC (mv) matrix.

JITC Uniform Operations#

Binary matrix-vector / matrix-matrix multiplication.

binary_jitumv

Event-driven matrix-vector product with a JIT uniform connectivity matrix.

binary_jitumv_p

Low-level XLA custom-kernel primitive for binary_jitumv.

binary_jitumm

Event-driven matrix-matrix product with a JIT uniform connectivity matrix.

binary_jitumm_p

Low-level XLA custom-kernel primitive for binary_jitumm.

Float matrix-vector / matrix-matrix multiplication.

jitu

Materialize a JIT uniform connectivity matrix as a dense array.

jitu_p

Low-level XLA custom-kernel primitive for jitu.

jitumv

Float matrix-vector product with a JIT uniform connectivity matrix.

jitumv_p

Low-level XLA custom-kernel primitive for jitumv.

jitumm

Float matrix-matrix product with a JIT uniform connectivity matrix.

jitumm_p

Low-level XLA custom-kernel primitive for jitumm.

jitumv_dt2t(w_low, w_high, prob, y, seed, *, ...)

Generate per-synapse y * w values for a uniform JITC (mv) matrix.

Fixed Connectivity Operations#

Binary matrix-vector / matrix-matrix multiplication.

binary_fcnmv

Event-driven sparse matrix--vector product with fixed connection number.

binary_fcnmv_p

Low-level XLA custom-kernel primitive for the ELL binary_fcnmv.

binary_fcnmm

Event-driven sparse matrix--matrix product with fixed connection number.

binary_fcnmm_p

Low-level XLA custom-kernel primitive for binary_fcnmm.

Float matrix-vector / matrix-matrix multiplication.

fcnmv

Sparse matrix--vector product with fixed connection number.

fcnmm

Sparse matrix--matrix product with fixed connection number.

fcnmv_dt2t

Per-synapse element-wise product of a vector and fixed-connection weights.

fcnmm_dt2t

Batched per-synapse element-wise product of dense vectors and fixed-connection weights.

Plasticity operations.

update_fixed_pre_conn_on_binary_post

Post-spike STDP update for a FixedNumPerPost (favorable, row-driven).

update_fixed_post_conn_on_binary_pre

Pre-spike STDP update for a FixedNumPerPre (favorable, row-driven).

fcn_plasticity_row_p

Favorable (row-driven) ELL plasticity primitive.