HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
glassroom
heinsen_sequence
AI & Machine Learning2023–2023
glassroom / heinsen_sequence

heinsen_sequence

Code implementing "Efficient Parallelization of a Ubiquitious Sequential Computation" (Heinsen, 2023)

2Distinct people
3Mentions
0Explicit recommenders
97GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Code implementing "Efficient Parallelization of a Ubiquitious Sequential Computation" (Heinsen, 2023)

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by day3 dated mentions

Observed mentions: 2023-12-07 17:15:23 UTC to 2023-12-20 15:14:47 UTC.

0122023-12-07 00:00:00 UTC to 2023-12-08 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsDec 72023-12-08 00:00:00 UTC to 2023-12-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-09 00:00:00 UTC to 2023-12-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-10 00:00:00 UTC to 2023-12-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-11 00:00:00 UTC to 2023-12-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-12 00:00:00 UTC to 2023-12-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-13 00:00:00 UTC to 2023-12-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsDec 132023-12-14 00:00:00 UTC to 2023-12-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-15 00:00:00 UTC to 2023-12-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-16 00:00:00 UTC to 2023-12-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-17 00:00:00 UTC to 2023-12-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-18 00:00:00 UTC to 2023-12-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-19 00:00:00 UTC to 2023-12-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-20 00:00:00 UTC to 2023-12-21 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsDec 20

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Dec 72023-12-07 00:00:00 UTC2023-12-08 00:00:00 UTC202
Dec 82023-12-08 00:00:00 UTC2023-12-09 00:00:00 UTC000
Dec 92023-12-09 00:00:00 UTC2023-12-10 00:00:00 UTC000
Dec 102023-12-10 00:00:00 UTC2023-12-11 00:00:00 UTC000
Dec 112023-12-11 00:00:00 UTC2023-12-12 00:00:00 UTC000
Dec 122023-12-12 00:00:00 UTC2023-12-13 00:00:00 UTC000
Dec 132023-12-13 00:00:00 UTC2023-12-14 00:00:00 UTC000
Dec 142023-12-14 00:00:00 UTC2023-12-15 00:00:00 UTC000
Dec 152023-12-15 00:00:00 UTC2023-12-16 00:00:00 UTC000
Dec 162023-12-16 00:00:00 UTC2023-12-17 00:00:00 UTC000
Dec 172023-12-17 00:00:00 UTC2023-12-18 00:00:00 UTC000
Dec 182023-12-18 00:00:00 UTC2023-12-19 00:00:00 UTC000
Dec 192023-12-19 00:00:00 UTC2023-12-20 00:00:00 UTC000
Dec 202023-12-20 00:00:00 UTC2023-12-21 00:00:00 UTC101

What Hacker News says

3 sources
This looks really nice. Thank you for sharing it on HN! In case you didn't know, you can parallelize the slow Python loop in selective_scan that computes all the x's: x = torch.zeros((b, d_in, n)) for i in range(l): x = deltaA[:, :, i] * x + deltaB_u[:, :, i] ⋮ with only two calls to the PyTorch API. See the examples here: https://github.com/glassroom/heinsen_sequence/blob/main/READ... .[a] You can then compute all the y's with one einsum, instead of l sequential einsums. --- [a] Previous discussion on HN: https://news.ycombinator.com/item?id=38556669
In Implementation of Mamba in one file of PyTorch
It's worth noting that you can solve these linear recurrences, `x(t) = a(t)x(t-1) + b(t)`, using a single parallel prefix sum where the elements are the input tuples `(a(t), b(t))`. The following operator called `combine` works. It's associative over these tuples; the final result will be the final value of the second component. Altogether, this gives you O(n) work and O(log n) span, but using just a single parallel prefix kernel, which may be more efficient in practice. combine ((a1, b1), (a2, b2)) = (a1 * a2, b1 * a2 + b2) For example, here's a C++ implementation: https://github.com/MPLLang/parallel-ml-bench/blob/main/cpp/l... And, here's an implementation in a functional language: https://github.com/MPLLang/parallel-ml-bench/blob/main/mpl/b... I'm pretty sure this generalizes, too, to abstract multiplications and additions in a
Read the rest
ny field (at first glance, seems like it should but I haven't done the formal proof yet). Anyway, it would be interesting to compare this against the solution in the arxiv paper. ---- EDIT: ah, good, this is already being discussed here: https://github.com/glassroom/heinsen_sequence/issues/1 And, for reference, I learned this algorithm from Guy Blelloch; see Sec 1.4.1 of https://www.cs.cmu.edu/~guyb/papers/Ble93.pdf
In Efficient parallelization of an ubiquitous sequential computation

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.