Applying for Research Internships (Universities)

Hi everyone! Over the last few months, I’ve received a lot of queries regarding applying to research internships. And I wanted to answer them shortly, in this blog, with a disclaimer to begin with. DISCLAIMER I did only one research internship (NTU Singapore, ROSE Labs), and there are people who are more qualified than me to answer this, but I’ll make my best attempt. Here is how I will suggest to apply: ...

September 4, 2022 · 3 min · Kushashwa Ravi Shrimali

Porting a Tiling Window Manager Extenstion to C++ (Bismuth): Part-2 (getting closest relative window)

Hi everyone! In this blog, I will be discussing the algorithm used in Bismuth to find the closest relative window to be focused for focusWindowByDirection event. If you haven’t read the previous blog, make sure to give it a read here. Recap from the previous blog Let’s start with a quick recap though, in the previous blog, we discussed: focusWindowByDirection requires the following information: direction (from the user) - can be one of: right, left, top/up, bottom/down. activeWindow (from the current session) - this is needed since focusWindowByDirection event is a relative event to your current focused window. Neighbor window candidates (neighborCandidates) to your current window (activeWindow) and the given direction (direction). // declaration std::vector<Window> Engine::getNeighborCandidates(const FocusDirection &direction, const Window &basisWindow); // use std::vector<Window> neighborCandidates = getNeighborCandidates(direction, basisWindow); From these neighbor candidates (neighborCandidates), we will now find the closest relative window corner. To me, it was tricky to understand at first, so we’ll be discussing this in detail over in the later sections. Once we know the closest relative window corner, we’ll try to find the window which satisfies the corner condition. If there were multiple found, we’ll return the first one based on the time-stamp (last used) Understanding the scenario I want to start off with a visual, took me some time to draw it, but in case it doesn’t look good, I’m sorry! My drawing teacher in the high school tried his best, but… ...

July 31, 2022 · 6 min · Kushashwa Ravi Shrimali

Porting a Tiling Window Manager Extenstion to C++ (Bismuth): Part-1

Hi everyone! I understand it’s been a long time, and I’m so excited to be writing this blog today. In today’s blog, I wanted to talk about my journey (so far) on contributing to Bismuth (a KDE’s Tiling Window Manager Extension), mainly how and why I started, and where I am right now. The Story: Why KDE Plasma and Why Bismuth? For the last few months (close to a year), I’ve been using Pop OS (a linux distribution by System 76) which had this amazing automatic tiling window extension called pop-shell, and it was close to what I always needed: ...

July 23, 2022 · 8 min · Kushashwa Ravi Shrimali

Common Collections (Vector and Strings) in Rust [Notes]

Chapter 8: Common Collections These are my notes from the chapter-8 of rust book. Please scroll down to the bottom (Note) section if you are curious about what this is. 8.1: Storing Lists of Values with Vectors Vec<T> collection type discussed, aka vector: * By default contiguous. * All values should be of same type. // Creation let v: Vec<i32> = Vec::new(); // vec! macro for convenience // default integer type is i32 let v = vec![1, 2, 3]; // Modifying let mut v = Vec::new(); // Rust infers the type from the elements pushed here v.push(5); v.push(6); // ... // Dropping // a vector is freed, when it goes out of scope { let v = vec![1, 2, 3, 4]; // ... } // <-- v goes out of scope here, and hence memory is freed as well // Reading Elements of Vectors let v = vec![1, 2, 3, 4, 5]; // First way: let third: &i32 = &v[2]; println!("The third element is: {}", third); // Second way: match v.get(2) { Some(num) => println!("The third element is: {}", num), None => println!("There is no third element."), } .get(&index) method allows you to handle out of range errors. ...

January 9, 2022 · 8 min · Kushashwa Ravi Shrimali

Common Collections (Vector and Strings) in Rust [Notes]

Chapter 8: Common Collections (Hash Maps) In the previous blog, I shared my notes on strings and vectors in Rust, and in this post we’ll cover Hash Maps. I personally have found their use in competitive programming, a lot, but hopefully as we move on, we’ll see lots of use-cases in real-life problems. Hash Maps Hash Maps: HashMap<K, V> You can’t access using indices, but through keys. Hash Maps store data on heap. Hash Maps are homogenous (all keys must have same type, and all values must have same type). Use std::collections::HashMap to bring HashMap to scope. Creating a New Hash Map ...

January 9, 2022 · 5 min · Kushashwa Ravi Shrimali

Weekly Progress Report: 03-10-2021, 2

Hi everyone, so this week has been comparatively more productive in terms of learning as well as work! I’m happy, so why not share with everyone as well? 🎉 PyTorch: (ft. Quansight and Facebook) Started working on porting index_add to structured kernels, see the PR I made on my forked repo here, and on upstream here. This included adding an out= variant to the op. Refining the way it’s registered in PyTorch. I am thinking to pass defalut value while registering, but it will be a BC breaking change. Finally got to use ghstack, thanks to Yukio (Quansight). Revised derivatives yaml file. Personally I feel that this one needs opinions from the Facebook team, and a lot of changes might be rejected (which is okay, at the end of the day - everything we do should be good for the library). My PR here is more like a prototype for everyone to get a chance to review, as well as comment on what they feel. Structured Kernel porting PR for baddbmm, bmm has been merged. Yay! 🎉 ❤️ PR. Took a walkthrough of lots of autogenerated code in PyTorch, to understand how ops are registered. Listened to Ed’s podcast - episode on NVIDIA GPUs. A sweet little introduction to NVIDIA GPUs. Extras: ...

October 3, 2021 · 2 min · Kushashwa Ravi Shrimali

Weekly Progress Report: 26-09-2021, 1

Hi everyone, before I go ahead and share my progress, I wanted to quickly talk about what this blog is about. I am highly passionate with the idea of high performance computing, optimizing deep learning applications, and solving real world problems using deep learning, computer vision, and speech processing. While I’m on this path - I would like to document this somewhere. And while I’m doing that, why not share it publicly? ...

September 26, 2021 · 3 min · Kushashwa Ravi Shrimali

Prefer const_iterators to iterators (Notes)

NOTE My notes on Chapter 3, Item 13 of Effective Modern C++ written by Scott Meyers. Some (or even all) of the text can be similar to what you see in the book, as these are notes: I’ve tried not to be unnecessarily creative with my words. :) In C++, iterators come handy to point at memory addresses of STL containers. For example, // C++11 std::vector<int> x {11, 9, 23, 6}; // begin() member function returns an iterator, which points to the first // memory address of the container x std::vector<int>::iterator it = x.begin(); While the general practice is to use const whenever possible, but programmers tend to use whenever it’s practical. const_iterators is particularly suggested when you want to use iterators, but you don’t need to modify what it points to. ...

September 26, 2021 · 5 min · Kushashwa Ravi Shrimali

Declaring Overriding Functions override (Notes)

NOTE My notes on Chapter 3, Item 12 of Effective Modern C++ written by Scott Meyers. Some (or even all) of the text can be similar to what you see in the book, as these are notes: I’ve tried not to be unnecessarily creative with my words. :) Overriding != Overloading Example of virtual function overriding: // Base class class Base { public: virtual void doWork(); // ... }; // Derived class from Base class Derived: public Base { public: // virtual is optional // this will "override" Base::doWork virtual void doWork(); // ... }; // This creates a "Base" class pointer to "Derived" class object std::unique_ptr<Base> upb = std::make_unique<Derived>(); // Derived doWork() function is invoked upb->doWork(); This is how virtual function overriding allows to invoke a “derived class function” from a base class interface. ...

September 25, 2021 · 4 min · Kushashwa Ravi Shrimali

Prefer Deleted Functions to Private Undefined Ones (Notes)

Prefer deleted functions to private undefined ones This item (11) in the chapter 3 focuses on: Why and How to prevent users calling particular functions? C++-98 and C++-11 approach What’s the difference between deleting a function vs declaring a member function private (and not defining them)? NOTE These are my notes on Chapter 3, Item 11 of Effective Modern C++ written by Scott Meyers. Some (or even all) of the text can be similar to what you see in the book, as these are notes: I’ve tried not to be unnecessarily creative with my words. :) ...

August 25, 2021 · 5 min · Kushashwa Ravi Shrimali