Prelude In this post, we're going to deep dive into one of my favourite tools that are revolutionizing how Python code is run in cloud and it's especially aimed at the computing stack for Machine Learning / Deep Learning applications, called Modal which has recently gone GA! There are almost no resources besides the official … Continue reading Modal Labs Deep Dive
Author: Ehsan
The Core of Attention is Communication
Over the past year, perhaps the most cited paper across the software industry is Attention is All You Need that is at the heart of ChatGPT and GPT transformer models. The first thing you will notice in the paper is the Attention formula: $$\text{Attention(Q, K, V)} = \text{softmax}(\frac{QK^T}{\sqrt{d_k}})V$$ Unfortunately, very few sources have delved into … Continue reading The Core of Attention is Communication
Rust and Node.js: Harmonizing Performance and Safety
Prelude In the Rust world, the interaction between Python and Rust is very well-known through the amazing PyO3 ecosystem. There is a similar relation between Python and Javascript in particular Node.js that I'm going to describe in this post. All the code is available here. Most programming language interactions happen through C layer ABI i.e. … Continue reading Rust and Node.js: Harmonizing Performance and Safety
Notes on the Current State of LLM Frameworks
This post tries to shed some light on the rapidly changing LLM frameworks in particular, LangChain (LC) and Llama-index (LI). Library vs. Framework It's tricky to draw a clear boundary between a package/library and a framework, but for the sake of discussion, let's look at some well-known examples Packages: Numpy falls into this category. It … Continue reading Notes on the Current State of LLM Frameworks
Announcement 📢 Releasing dlpackrs
DLPack is the standard in-memory data format that facilitates zero-cost tensor transfer across major Deep Learning frameworks (PyTorch, TensorFlow and TVM) and the supported Python Array processing frameworks such as Numpy, CuPy. The dlpackrs provides a safe idiomatic Rust binding where Rust ndarray and tensor frameworks can use it to gain the same kind of … Continue reading Announcement 📢 Releasing dlpackrs
Announcement 📢 Releasing smartalloc
If you happen to write unsafe code in Rust where normal static checks are not available and want better UX for detecting memory issues along side using various sanitizers, checkout my new crate smartalloc which provides idiomatic Rust binding for the original C version here. Beside the reason in README, note that MIRI can't be … Continue reading Announcement 📢 Releasing smartalloc
Announcement 📢 Create your own programming language with Rust
After almost a year from my last blog post, in this short post I'm very happy to announce that I'm writing a free online book where early chapters are available now. I've explained my motivations and goals in the introduction. The accompanying codes are also available on my GitHub. Feedbacks are welcome and happy learning. … Continue reading Announcement 📢 Create your own programming language with Rust
Rust std study series: Pin
This time we dive into std::pin which has a dense documentation. Types that pin data to its location in memory. It is sometimes useful to have objects that are guaranteed to not move, in the sense that their placement in memory does not change, and can thus be relied upon. A prime example of such … Continue reading Rust std study series: Pin
Rust std study series: alloc
Let's get deep into std::alloc! Memory allocator 101 The very basic need for any program to compile and execute is having access to either physical memory or virtual memory. An allocator is responsible for providing such an access. You can think of an allocator as a service, taking some sort of requests and either giving … Continue reading Rust std study series: alloc
Rust std study series: Interior mutability
Continuing the standard library study, it's time for Cell<T>! Rust compiler enforces multiple reads access and a single write access mutually exclusive, i.e. either multiple shared references & or one and only one mutable reference & mut. So essentially, Rust prevents the evil of aliasing and mutation between multiple threads. Cell<T> is a sharable mutable … Continue reading Rust std study series: Interior mutability
The State of Machine Learning in Rust
Every once in a while this topic comes up on a social media or Rust user channel. I'd like to describe briefly the way I see where things are going by a little bit of history as well as some information about existing flux of Machine Learning/Deep Learning frameworks and major recent trends. Brief history … Continue reading The State of Machine Learning in Rust
Rust std study series: VecDeque
Continuing from Rust standard library study series, it's time for VecDeque<T>. Because of its similarity to Vec, there isn't much to say. A double-ended queue implemented with a growable ring buffer. The "default" usage of this type as a queue is to use push_back to add to the queue, and pop_front to remove from the … Continue reading Rust std study series: VecDeque
Rust std study series: LinkedList
Continuing from Rust standard library study series, it's time for LinkedList<T>. Note that implementation are taken from Rust stable v1.33.0. A doubly-linked list with owned nodes. The LinkedList allows pushing and popping elements at either end in constant time. Almost always it is better to use Vec or VecDeque instead of LinkedList. In general, array-based … Continue reading Rust std study series: LinkedList
Variance in Rust: An intuitive explanation
Recently I've made a presentation about subtyping and variance in Rust for our local Vancouver Rust meetup, but I still think intuition was rather lost in the formalism, so here's my shot at explaining it as intuitively as I can. For more succinct definitions, please checkout the presentation or the resources at the end. First, … Continue reading Variance in Rust: An intuitive explanation
Rust std study series: Vec
The upcoming series of blog posts will contain my study of Rust standard library. I've partially written some parts of the series in scattered places and want to gather them in one place for better and easier access. I intend to update whenever I discover something interesting/important to remember. I'm referring to implementations in Rust … Continue reading Rust std study series: Vec
NIPS, AI hype and the lost rigor
Warning: This post contains a mixture of excitements, frustrations and rants! Today, Machine Learning/Deep Learning people have been sharing their great excitements over Ali Rahimi's talk at NIPS (from min 57 onwards). Undoubtedly, it's a great talk and you should check it out if you care about fundamental issues and the lost rigor in Deep Learning … Continue reading NIPS, AI hype and the lost rigor
What’s up with word embedding?
Word embedding is one of the interesting areas of research in Natural Language Processing. There are huge amount of materials with a lot of interesting ideas. I have been studying some of them lately and in this post, I'd like to create a brief account of the ideas I have found most interesting so far. … Continue reading What’s up with word embedding?
From Machine Learning to Formal Math and Type Theory
The idea of this post was sparkled from the new paper Developing Bug-Free Machine Learning Systems with Formal Mathematics. Meanwhile, I have had the idea of writing about what you're going to read for a long time and this paper happily forced me to do it finally! The first and final parts are about my journey and … Continue reading From Machine Learning to Formal Math and Type Theory
General Monty Hall Simulation
The idea of this post came up to my mind last night. I'm assuming you have already heard about the famous Monty Hall Problem (if you haven't, watch the quicker intro in Numberphile clip). Here I'd like to demonstrate a simulation taking the general case into account, i.e. assume we have $latex n$ bins (boxes or doors, … Continue reading General Monty Hall Simulation
Restaurant Revenue Prediction with BART Machine
In this post, I'd like to show you how to use the newly written package on Bayesian Additive Regression Trees i.e. BART Machine for Restaurant Revenue Prediction with R. The datasets are part of the passed Kaggle competition that can be found here. What is BART? BART is the Bayesian sibling of Random Forest. For … Continue reading Restaurant Revenue Prediction with BART Machine