
CSE'29 🇮🇳 | Documenting my journey in Robotics, Hardware, Software, AI ML, Devops, Chips, in pursuit of being 'cracked'.
India
Joined May 2023
- Tweets2.5K
- Following446
- Followers144
- Likes6K
a goated video for anyone looking to go deep in distrusted training
youtu.be/XoGvCBRnwLs?si=ntvb…
Back to JAX Learning.
Today I was reading more about shard maps. All devices run the same program, potentially on different data (SPMD), and we have to explicitly write our own collectives. I'm not going too deep into shard maps in this post.
JAX tracks a type for every value on a device called VMA (Varying Manual Axes): the set of mesh axes along which copies of a value might differ.
Inputs split along a mesh axis vary along that axis. Replicated inputs and constants, on the other hand, don't vary along the respective axes.
There are a couple of reasons why tracking VMA is useful. One of them is how it helps with the backward pass.
A gradient has the same VMA type as the value it's the gradient of. If necessary, autodiff inserts collectives to ensure this property holds.
Let's take data parallelism as an example.
Across devices, weight matrices w are replicated, while the input data is different. Consequently, operations involving w and the data produce different values across devices, including the loss.
During the backward pass, the partial gradients of the loss with respect to w will also differ across devices because each device has processed different data.
But w is replicated, so its gradient must also be replicated. We therefore need an explicit psum across devices to aggregate the partial gradients and ensure every device gets the same gradient.
How does JAX implement this?
It does something interesting: internally, it makes w a varying value using pvary, rather than treating it as non-varying.
The transpose of pvary is psum. So, when autodiff computes the backward pass, the transpose rule for pvary introduces the required collective automatically.
That's how VMA tracking helps JAX ensure that gradients respect the sharding and replication constraints of the original values.
1
4
195
Replying to @GonnabeNikhil
Looped transformers are future of transformers, check out Py's video on it youtu.be/UFTk5HBCtoo?si=UMZw…
1
2
116
a nice video by nvidia on how to tackle ai memory wall :
youtu.be/Ud3gdKrbdgw?si=hLuK…
3
217
I have upgraded my laptop from Dell Inspiron 5593 i5 8gb ram to HP Omnibook X 14, RTX Spark 64gb memory 2tb SSD.
Thank you very much to my parents🙏🙏 for gifting me this absolute beast laptop, forever grateful🙏🙏.
max vram : 55.3gb (max dedicated : 48gb)
max ram : 58.5
3
11
383
And if you can't read and need to watch a video : youtube.com/watch?v=UFTk5HBC…
1
44












