Skip to main content

Module ptx_kernels

Module ptx_kernels 

Source
Expand description

GPU PTX kernels for Sequence Models & Structured Prediction.

Each kernel is emitted as a self-contained PTX module string, parameterised on the SM version. PTX ISA selection by SM: SM≥100 → 8.7 (Blackwell), SM≥90 → 8.4 (Hopper), SM≥80 → 8.0 (Ampere), else → 7.5 (Turing).

IMPORTANT: PTX kernel bodies use string concatenation (NOT format!()) for sections containing %rd, %r, %f register names, which Rust’s format! macro would reject as malformed positional specifiers in edition 2024.

Functions§

beam_topk_ptx
Beam top-k partial-sort kernel (one-pass rank approximation).
crf_features_ptx
CRF feature-score kernel.
edit_dist_ptx
Edit-distance anti-diagonal cell update kernel.
forward_pass_ptx
HMM forward-pass kernel (log-space).
kalman_predict_ptx
Kalman predict step kernel (matrix-vector + covariance update).
mrf_gibbs_ptx
Gibbs-sampling Ising MRF kernel: per-site conditional resample given neighbours.
viterbi_step_ptx
Viterbi step kernel (log-space, with argmax storage).