
I just published Handwriting PTX for matrix multiplication (part 2) medium.com/@incredibleswasti…
1
23
Make sure you understand PTX and GPU architecture before touching this blog...
Part 2 on Handwriting PTX for matrix multiplication is out.
I know the audience is less, as very less go in such depth..
Happy reading
swastic-7.github.io/sw4sy-Bl…
2
59
If you've ever been curious about what happens before the operating system, this one's for you.
Read this blog out
swastic-7.github.io/sw4sy-Bl…
1
41
Swastic retweeted
my jee instinct without solving this question is saying answer will be either 1, 0 or -1
I am still loosing....
I have completed writing MLP using my PTX library and native cuda kernels. My PTX is giving accurate results still there is huge time gap, native cuda kernels are outperforming. Majorly issue is in my matmul as while i was writing blog i figured out thread tiling was doing no good on my GPU (RTX 3050).
> Need to figure out auto tuning for matmul in my library so that best results can be achieved.
> Also need to check my PTX where i can optimize it more
I am still loosing....
I have completed writing MLP using my PTX library and native cuda kernels. My PTX is giving accurate results still there is huge time gap, native cuda kernels are outperforming. Majorly issue is in my matmul as while i was writing blog i figured out thread tiling was doing no good on my GPU (RTX 3050).
> Need to figure out auto tuning for matmul in my library so that best results can be achieved.
> Also need to check my PTX where i can optimize it more
Loved this blog.
A new way to learn via interacting.
Quantization can make an LLM 4x smaller and 2x faster, with barely any quality loss. But what *is* it? @samwhoo crafted a beautiful interactive essay explaining it from first principles, aimed at coders, not mathematicians.
ngrok.com/blog/quantization
2
66
Making GPU go brrr!!!
This article shows trade-off on compute bound and memory bound. We have to maintain both, We want faster compute but what if I could get data before its execution (i.e. when required).
horace.io/brrr_intro.html
1
53
Swastic retweeted
🚨 Andrej Karpathy just explained the scariest thing happening in software right now..
someone poisoned a Python package that gets 97 million downloads a month.. and a simple pip install was enough to steal everything on your machine..
SSH keys.. AWS credentials.. crypto wallets.. database passwords.. git credentials.. shell history.. SSL private keys.. everything..
and here's the part that should terrify every developer alive..
the attack was only discovered because the attacker wrote sloppy code.. the malware used so much RAM that it crashed someone's computer.. if the attacker had been better at coding.. nobody would have noticed for weeks..
one developer.. using Cursor with an MCP plugin.. had litellm pulled in as a dependency they didn't even know about.. their machine crashed.. and that crash saved thousands of companies from getting their entire infrastructure stolen..
Karpathy's take is the real wake up call.. every time you install any package you're trusting every single dependency in its tree.. and any one of them could be poisoned..
vibe coding saved us this time.. the attacker vibe coded the attack and it was too sloppy to work quietly.. next time they won't make that mistake.
Software horror: litellm PyPI supply chain attack.
Simple `pip install litellm` was enough to exfiltrate SSH keys, AWS/GCP/Azure creds, Kubernetes configs, git credentials, env vars (all your API keys), shell history, crypto wallets, SSL private keys, CI/CD secrets, database passwords.
LiteLLM itself has 97 million downloads per month which is already terrible, but much worse, the contagion spreads to any project that depends on litellm. For example, if you did `pip install dspy` (which depended on litellm>=1.64.0), you'd also be pwnd. Same for any other large project that depended on litellm.
Afaict the poisoned version was up for only less than ~1 hour. The attack had a bug which led to its discovery - Callum McMahon was using an MCP plugin inside Cursor that pulled in litellm as a transitive dependency. When litellm 1.82.8 installed, their machine ran out of RAM and crashed. So if the attacker didn't vibe code this attack it could have been undetected for many days or weeks.
Supply chain attacks like this are basically the scariest thing imaginable in modern software. Every time you install any depedency you could be pulling in a poisoned package anywhere deep inside its entire depedency tree. This is especially risky with large projects that might have lots and lots of dependencies. The credentials that do get stolen in each attack can then be used to take over more accounts and compromise more packages.
Classical software engineering would have you believe that dependencies are good (we're building pyramids from bricks), but imo this has to be re-evaluated, and it's why I've been so growingly averse to them, preferring to use LLMs to "yoink" functionality when it's simple enough and possible.
Swastic retweeted
Replying to @Kekius_Sage
Someone cannot know or explain something fully if she/he is part of that thing.
It’s like uncertainty principle
Swastic retweeted
a complete architectural breakdown of transformers with intuitive visualizations.
vizuaranewsletter.com/p/the-…
NEW BLOG OUT!!!!
Handwriting PTX for Matrix Multiplication.
swastic-7.github.io/sw4sy-Bl…
Completed with the thread tiling on my MATMUL implementation using PTX.
Threads are tiled into separate pieces where each piece computes the single element of output matrix C (A*B=C). In easier words no of tiles in a thread is no of output elements a thread compute.
Below is the visualization of this.
I am writing the blog on this. Stay tuned...
NEW BLOG OUT!!!!
Handwriting PTX for Matrix Multiplication.
swastic-7.github.io/sw4sy-Bl…
Completed with the thread tiling on my MATMUL implementation using PTX.
Threads are tiled into separate pieces where each piece computes the single element of output matrix C (A*B=C). In easier words no of tiles in a thread is no of output elements a thread compute.
Below is the visualization of this.
I am writing the blog on this. Stay tuned...




















