<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: AymanB</title><link>https://news.ycombinator.com/user?id=AymanB</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 18 Apr 2026 14:09:32 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=AymanB" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by AymanB in "Tracking down a 25% Regression on LLVM RISC-V"]]></title><description><![CDATA[
<p>Thanks for the blog, I really enjoyed it. Good work.
This just makes me appreciate and love compilers even more, they are a fascinating piece of software.</p>
]]></description><pubDate>Mon, 13 Apr 2026 21:46:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=47758236</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=47758236</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47758236</guid></item><item><title><![CDATA[New comment by AymanB in "From Unemployment to Lisp: Running GPT-2 on a Teen's Deep Learning Compiler"]]></title><description><![CDATA[
<p>Hello, it is the same idea as tinygrad and apache tvm but in common lisp.<p>So yes, you could call it a lisp ml framework.</p>
]]></description><pubDate>Wed, 11 Dec 2024 13:47:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=42387629</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=42387629</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42387629</guid></item><item><title><![CDATA[New comment by AymanB in "From Unemployment to Lisp: Running GPT-2 on a Teen's Deep Learning Compiler"]]></title><description><![CDATA[
<p>Hello! Thanks for your question.<p>First of all, there are three layers of abstraction within Caten:<p>1. caten/apis | High-Level Graph Interface  
2. caten/air | Low-Level Graph Interface  
3. caten/codegen | AIR Graph => Kernel Generator<p>The inputs of the compiler are just Common Lisp classes (similar to torch modules). For example, in Common Lisp, we could create a module that does SinCos:<p><pre><code>    (defclass SinCos (Func) nil
      (:documentation "The func SinCos computes sin(cos(x))"))

    ;; Forward creates a lazy tensor for the next computation.
    ;; You can skip this process by using the `st` macro.
    (defmethod forward ((op SinCos) &rest tensors)
      (st "A[~] -> A[~]" (tensors)))

    ;; Backward is optional (skipped this time)
    (defmethod backward ((op SinCos) &optional prev-grad)
      (declare (ignore prev-grad))
      nil)

    ;; Lower describes the lowered expression of `SinCos`
    (defmethod lower ((op SinCos) &rest inputs)
      (let ((x (car inputs)))
        (with-context
          (a (%sin (%add x (%fconst (/ pi 2)))))
          (b (%sin a)))))
</code></pre>
The `apis` layer is the high-level interface, while the `lower` method is the lower-level step before code generation.<p>Next, the framework generates an Abstract VM (AVM) representation:<p><pre><code>    #S(AVM :GRAPH Graph[seen=NIL, outputs=(STC6466_1)] {
      <ALLOCATE : TID6464 <- (shape=(1), stride=(1)) where :dtype=FLOAT32>
      <Node[BUFFER] ALLOCATE(NID6480) : SID6479* <- ()>
      <Node[BINARYOPS] ADD(NID6484) : BID6483* <- (TID6464, LID6481)>
      <Node[UNARYOPS] SIN(NID6486) : UID6485* <- (BID6483)>
      <Node[UNARYOPS] SIN(NID6488) : UID6487* <- (UID6485)>
      <Node[SPECIAL/VM] PAUSE/BACKWARD(NID6501) : STC6466_1* <- (UID6487)>
    })
</code></pre>
Then, the computation graph is translated into schedule items:<p><pre><code>    FastGraph[outputs=(val_6)] {
      { Allocate } : [ val_0 <- (1) ]
      { KERNEL } : [ val_5 <- val_1, val_0 :name=FUSED_SIN_SIN_ADD_LOAD6511]
    }
</code></pre>
Finally, the code generation step produces the following C code:<p><pre><code>    void fused_sin_sin_add_load6511(float* val_5, const float* restrict val_0);
    void fused_sin_sin_add_load6511(float* val_5, const float* restrict val_0) {
        val_5[0] = sin(sin((val_0[0] + 1.5707964)));
    }
</code></pre>
This C code is compiled by a C compiler and executed.<p>So to answer your question: the compiler takes Common Lisp code and generates C functions.</p>
]]></description><pubDate>Wed, 11 Dec 2024 13:42:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=42387585</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=42387585</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42387585</guid></item><item><title><![CDATA[New comment by AymanB in "From Unemployment to Lisp: Running GPT-2 on a Teen's Deep Learning Compiler"]]></title><description><![CDATA[
<p>A couple months ago I found myself unemployed, uncertain about what to do next. I wanted to learn more about deep learning, but from a systems prespective. Coming from Andrew's Ng course on supervised learning, I was eager to learn more about how deep learning frameworks (or deep learning compilers) like Pytorch or Tinygrad.<p>I started to poke around Tinygrad, learning from the tutorials I found online, and I found it fascinating because it was an actual compiler, it took conventional python code and translated them into an Abstract Syntax Tree that was parsed into UOps and ScheduleItems, to finally have a codegen layer. While the design was interesting, the code was hard to read.<p>That's when I stumbled across something completly unexpected, A deep learning compiler built on Common Lisp, maintained by a Japanese 18-year-old during his gap year. And currently we have acomplished something great, it can run gpt2!<p>For now, it just generates C-kernels, but in the future we would like to support cuda codegen as well as many other features, and serve as a learning tool for anyone who would like to get to work on deep learning compilers in Common Lisp.</p>
]]></description><pubDate>Tue, 10 Dec 2024 16:12:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=42378195</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=42378195</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42378195</guid></item><item><title><![CDATA[From Unemployment to Lisp: Running GPT-2 on a Teen's Deep Learning Compiler]]></title><description><![CDATA[
<p>Article URL: <a href="https://github.com/hikettei/Caten">https://github.com/hikettei/Caten</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=42378194">https://news.ycombinator.com/item?id=42378194</a></p>
<p>Points: 116</p>
<p># Comments: 6</p>
]]></description><pubDate>Tue, 10 Dec 2024 16:12:10 +0000</pubDate><link>https://github.com/hikettei/Caten</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=42378194</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42378194</guid></item><item><title><![CDATA[New comment by AymanB in "Is MathAcademy Worth It? Thoughts After 2k Experience Points (XP)"]]></title><description><![CDATA[
<p>If someone wants an idea, something like this for ds/algorithms would do wonders</p>
]]></description><pubDate>Mon, 16 Sep 2024 13:42:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=41555985</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=41555985</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41555985</guid></item><item><title><![CDATA[New comment by AymanB in "Bytehound: Memory Profiler for Linux"]]></title><description><![CDATA[
<p>I was wondering, any way to use it with distributed systems for data analytics?<p>Imagine a set of workers that ingest data in parallel, would that work?<p>Currently it's pretty simple and i am spawning a process within the worker so it reads some stuff such as memory usage, cpu usage etc... But I would like to improve it.</p>
]]></description><pubDate>Thu, 23 May 2024 18:14:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=40457969</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=40457969</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40457969</guid></item><item><title><![CDATA[New comment by AymanB in "How the brain responds to reward is linked to socioeconomic background"]]></title><description><![CDATA[
<p>This is really interesting</p>
]]></description><pubDate>Sun, 28 Jan 2024 19:23:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=39168943</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=39168943</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39168943</guid></item><item><title><![CDATA[New comment by AymanB in "Show HN: I made a website to find best bus seat to avoid the sun while traveling"]]></title><description><![CDATA[
<p>I asked myself the same question a couple times, but never thought of make an app out of it. Well done!</p>
]]></description><pubDate>Wed, 17 Jan 2024 09:53:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=39025653</link><dc:creator>AymanB</dc:creator><comments>https://news.ycombinator.com/item?id=39025653</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39025653</guid></item></channel></rss>