Show HN: Glowstick – type level tensor shapes in stable rust
By
bietroi
Hi HN,
In the past few years I've become more interested in machine learning. Since I'm sure the same is true for many here, I wanted to share this project I've been working on: glowstick uses type-directed metaprogramming to keep track of tensor shapes in Rust's type system and determine which operations are permitted or not at compile time.
I find Rust has a lot of strengths when it comes to ML applications, but waiting until runtime to find shape related issues feels a bit strange since normally I don't run the code all that often while developing. Given Rust has fancy types available, I figured I'd try my hand at using them to address this.
I've added integration crates for the two ML frameworks I use most frequently, candle and burn, and included examples of implementing llama 3.2 in each using typed shapes for much of the model internals and inference loop. Mixtures of static and dynamic dimensions should be supported well enough for most applications at this point, though there are of course still improvements to be made.
Any feedback is appreciated!
Comments URL: https://news.ycombinator.com/item?id=44225922
Points: 9
# Comments: 0
You might also wanna read
Stoicism and Overthinking: How Marcus Aurelius' Private Writings Offer Ancient Tools for Modern Anxiety
This article from "The Examined Life" newsletter (Issue #4) explores Stoic philosophy through the lens of Marcus Aurelius, who wrote his fam
From Bottleneck to Empowerer: Applying the Leader-Leader Model in Engineering Management
The article discusses the common challenge engineers face when transitioning from individual contributor roles to engineering leadership pos
Sergey Brin tells Google AI staff 60-hour workweek is the 'sweet spot' for productivity
Sergey Brin, Google cofounder, wrote an internal memo to employees working on the Gemini AI products recommending a 60-hour workweek as the
Solar desalination system eliminates toxic brine while producing fresh water
Scientists have developed a solar-powered desalination system that converts seawater into fresh water without producing toxic brine, a major
A design engineer's crisis: Quitting tech amid AI disillusionment
A design engineer reflects on quitting their stable, well-paying tech job amid growing disillusionment with the industry's direction, partic
Why being skeptical of AI is a rational and necessary choice
This opinion piece argues that skepticism and criticism of AI is a healthy, rational response rather than a sign of ignorance. It pushes bac
