<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bhasha Tyagi on Medium]]></title>
        <description><![CDATA[Stories by Bhasha Tyagi on Medium]]></description>
        <link>https://medium.com/@bhashatyagi.iitdelhi?source=rss-b7b691de86a3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mauhdOV33fHMC30V5RJAsw.jpeg</url>
            <title>Stories by Bhasha Tyagi on Medium</title>
            <link>https://medium.com/@bhashatyagi.iitdelhi?source=rss-b7b691de86a3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:21:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhashatyagi.iitdelhi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Great Escape from your Localhost- A Beginner’s Guide to Deployment]]></title>
            <link>https://medium.com/@bhashatyagi.iitdelhi/the-great-escape-from-your-localhost-a-beginners-guide-to-deployment-a07fd60d9492?source=rss-b7b691de86a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a07fd60d9492</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Bhasha Tyagi]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 22:53:02 GMT</pubDate>
            <atom:updated>2026-11-02T23:03:37.226Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>I know you are putting some great efforts in learning deployment, trust me you’re about to realise it’s not as scary as it sounds. 😉</em></blockquote><blockquote>To begin with, lets do the concept building via a scenario:<br>“Suppose you are working in X company , you are building an application for any business use case , for this you worked on from improving it to developing multiple features right. You are using a <strong>localhost server</strong> to manage all these tasks. Now the next question would come to your mind how to make it accessible to other users in the team or even scaling it to broader areas as a future perspective.”</blockquote><p><strong>This is our problem statement for this article.</strong> Lets deep dive to understand it better and explore some solutions :</p><h4><strong>Understanding Network Access:</strong></h4><p>Localhost are accessible to that one user’s laptop , it can run via <strong>Streamlit</strong> (but requires continuous running) but to share it to other person’s laptop , two things must suffice :</p><p>a) the other user should be on the <strong>same</strong> <strong>network</strong>.</p><p>b) the application should be configured to accept network connections.</p><pre># Start Streamlit and allow network access<br>streamlit run app.py --server.address 0.0.0.0 --server.port 8501<br><br># Find your local IP address<br>ipconfig getifaddr en0<br><br># Share this URL with your teammate<br># Replace YOUR_LOCAL_IP with the IP returned above<br>http://YOUR_LOCAL_IP:8501</pre><p>if you configure to do that , one additional requiremnt comes up : your <strong>firewall</strong> must allow incoming connections on that port and the network must permit devices to communicate with each other. Some corporate Wi-Fi networks block these connections.</p><p>If you face these similar issues, let’s see other approach we can try.</p><h4><strong>Creating a public entry point :</strong></h4><p>A secure connection is built that bridges our localhost link with the exposed public url (that will be accessible to others) with the help of tunelling client. It creates a secure outbound connection -&gt; our public url.</p><p>This whole connection requires an authorisation token (just to add a safety layer in authentication) and then any user will be able to access that exposed endpoint.</p><p>for example, we will take case of <strong>ngrok</strong> :</p><p>The flow looks something like this:</p><p>User → Public ngrok URL → ngrok Cloud → Secure Tunnel → localhost:8501</p><p>And voila! your application will be accessible to users outside your local network without directly exposing your laptop’s local IP address.</p><figure><img alt="ngrok implementation" src="https://cdn-images-1.medium.com/max/794/1*jBStne9elfE4qWXd2UL0sg.jpeg" /><figcaption>Ngrok implementation</figcaption></figure><p>But sharing our app is only half the problem solved. What happens when it works perfectly on our machine but fails on someone else’s? That’s where <strong>Docker</strong> comes in.</p><h4><strong>Docker 🐳</strong></h4><p>I will walk you with an easiest case :</p><blockquote>You are working with a team of developers building your application, now suppose a new member comes in, he wants to access all your codebase , one way would be that he would need to setup the env and <strong>dependencies</strong> (requirements.txt inshort ) that are on your system. This process invites errors and dependencies problem like you have some v17 of any library , while that person installs a different version (v21). Complexity adds in when you are a mac user and the other team member is using windows. In short, these pain points led developers to <strong>standardise</strong> this transfer method in a <strong>single</strong> <strong>package</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*EQbcL5PC16UEajTe9eN7vQ.jpeg" /></figure><p>Now <strong>back in the present</strong> : to resolve all these issues , we use Docker, a portable and lightweight and portable way to package our application along with everything it needs to run.</p><p>But before jumping into implementation, let&#39;s understand what Docker actually does.</p><h4>Docker Image: Your Application’s Blueprint</h4><p>A Docker image is a read-only template that contains (like a blueprint)</p><ol><li>Application code</li><li>Required libraries and dependencies</li><li>Runtime (Python, Java, etc)</li><li>Configuration and other necessary files</li></ol><p>Think of it as a <strong>static snapshot or blueprint</strong> of your application’s environment. You build it once and can use it to create multiple running instances.</p><p>And good news, you can share this image with other developers!</p><p>For example, Docker Desktop is a go to go where developers can store and share Docker images. Someone else can download an existing image using:</p><pre>docker pull python:3.11-slim</pre><h4>Docker Container: From Blueprint to Reality</h4><p>Now you must be asking if an image is just a blueprint then how do we actually run to use our application? This brings us to the concept of a <strong>Docker Container</strong>.</p><p>Lets understand from basics of OOPs:</p><ol><li><strong>Class</strong> :: Docker Image</li><li><strong>Object</strong> :: Docker Container</li></ol><p>A class defines the structure while an object is an instance created from that class.</p><p><strong><em>Similarly, a Docker image defines the environment, while a container is the running instance created from that image.</em></strong></p><p><em>Some Crazy stuff: You can even create multiple containers from the same image!</em></p><pre>docker run -d -p 8501:8501 my-first-app</pre><p>Now an important question to ask :</p><blockquote>if docker runs our application , how is it different from VM?</blockquote><p>A Virtual Machine comes with its own <strong>Guest Operating System</strong> along with the application and its dependencies.</p><p>Whereas , Docker containers work differently. They share the <strong>host operating system’s kernel</strong> while keeping applications and their dependencies isolated. For this reason they are lighter than vm!!</p><p><strong>One small clarification:</strong> Docker has only linux based containers , so to use it in mac or windows : you need a Docker Desktop that typically runs Linux containers inside a lightweight Linux VM because these operating systems do not provide a native Linux kernel.</p><h4><strong>does having a Docker image mean our application is now deployed and accessible to everyone?</strong></h4><p>Not really, docker has solved our biggest problem of portability but how do users access it without depending on your local machine?</p><p><em>This is where the cloud platforms and hosting services come into picture and that deserves a whole new discussion. (so follow)</em></p><p>I will discuss more on this in a separate article, if there is any related topic you’d like me to cover, feel free to drop it in the comments.</p><p><em>To be continued…..</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a07fd60d9492" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The CUDA Effect: How Parallel Computing is Changing the World]]></title>
            <link>https://medium.com/@bhashatyagi.iitdelhi/the-cuda-effect-how-parallel-computing-is-changing-the-world-003874090267?source=rss-b7b691de86a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/003874090267</guid>
            <category><![CDATA[cuda-programming]]></category>
            <dc:creator><![CDATA[Bhasha Tyagi]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 22:53:54 GMT</pubDate>
            <atom:updated>2025-03-29T22:58:20.460Z</atom:updated>
            <content:encoded><![CDATA[<p>While diving into machine learning papers, I was wondering what is so powerful about this <strong>CUDA thing anyway. </strong>Let me tell you, it’s not something you’re unfamiliar with; it’s been working its magic when you’re battling through <strong><em>Cyberpunk</em>,</strong> pushing your GPUs to the limits. CUDA, handling multitasking and preparing you for your next smooth gaming experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/0*Pz4SZMxcjQ3DqynN.jpg" /></figure><p>If you’re thinking,<strong> </strong>“<strong>CUDA?</strong> Isn’t that just for making my video games look appealing?” you’re in for a treat. <strong>A big NO!</strong> It isn’t just about rendering the next blockbuster game; it’s about <strong>parallelisation</strong> of your computing tasks, especially useful in deep learning and much more. CUDA is like the blueprint or the management system that allows the CPU to delegate tasks to the GPU, ensuring efficient use of resources and coordination between the two.</p><h3>The GPU: Not Just for Graphics Market Anymore</h3><p>Let’s roll back with a bit of history. Back in the day, when dinosaurs roamed the earth, hold on, not too back, its the time when computers were the size of your living room, companies like <strong>HP</strong> and <strong>IBM</strong> started playing around with silicon to make images pop on screens. Fast forward a few decades, and we’ve got GPUs, or Graphics Processing Units, which are not just for displaying images but are now used in parallel computing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*oVCkKMv7BAhoeGAJ" /></figure><p>But why GPUs? Well, imagine your CPU, responsible for all the mathematical and logical calculations of a computer. as a diligent but somewhat slow worker, handling tasks one at a time. Now, think of your GPU as a bustling office full of workers as <strong>cores</strong>, each capable of doing their own thing simultaneously. While a<strong> CPU might have 16 cores</strong>, a modern <strong>GPU can boast</strong> <strong>656 × 16 cores</strong> running might be at lower speed than CPU, but still be effective !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/0*h0Uo7pOxzfZC2qfm.gif" /><figcaption>See for real, how the processing can be compared visually!</figcaption></figure><h3>CUDA: Dealer between CPU and GPU</h3><p>CUDA stands for <strong>Compute Unified Device Architecture,</strong> NVIDIA’s brainchild that lets you harness this GPU power. In simpler words, it has capabilities to <strong>shift</strong> your tasks from <strong>CPU to GPU</strong> based on the computation and time of output. CUDA allows you to write programs that can run thousands of threads in parallel. The full architecture is as follows:</p><blockquote><strong>Thread</strong>: The smallest unit executing a single task.</blockquote><blockquote><strong>Thread Block:</strong> A group of threads that work together and share memory.</blockquote><blockquote><strong>Kernel Grid:</strong> A collection functions of thread blocks launched to process data concurrently.</blockquote><blockquote><strong>Streaming Multiprocessor (SM): </strong>Hardware unit that schedules and runs thread blocks.</blockquote><blockquote><strong>CUDA Core:</strong> The individual processing unit within an SM that executes thread instructions.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*TfMgUFwgsOHOIGhD.png" /><figcaption>the architecture on which CUDA works and handles tasks between CPU &amp; GPU</figcaption></figure><p>You can use CUDA with languages like <strong>C, C++, and even Python</strong>, making it accessible for a wide range of developers.</p><h3>An example to compare the speed: CPU v/s CUDA</h3><p>Let’s get our hands dirty with a simple example. Imagine you want to add two arrays together. On a CPU, this would be a <strong>sequential task</strong>, where each element will be added to the single array first then computing the addition results based on the individual arrays. Pretty exhausting right!, but with CUDA, computation becomes faster with the incorporation of <strong>kernels.</strong></p><p>Before we go ahead, let me clear the concept of kernels:</p><blockquote><strong>kernel</strong> is like our mom in a kitchen. Just as she can prepare multiple dishes at once, a kernel can execute multiple threads simultaneously, each performing the same task on different data.</blockquote><pre>import numpy as np<br>from numba import cuda<br><br># Define array size<br>N = 10_000_000<br><br># Generate random float32 arrays<br>a = np.random.rand(N).astype(np.float32)<br>b = np.random.rand(N).astype(np.float32)<br># CUDA kernel for vector addition<br>@cuda.jit<br>def vector_add_gpu(a, b, c):<br>    idx = cuda.grid(1)  # Get unique thread index<br>    if idx &lt; a.size:  <br>        c[idx] = a[idx] + b[idx]  # Perform element-wise addition</pre><pre><br># CPU computation<br>c_cpu = a + b  # NumPy handles vector addition<br><br><br># GPU computation<br>a_gpu, b_gpu, c_gpu = cuda.to_device(a), cuda.to_device(b), cuda.device_array_like(a)</pre><blockquote>We create an array of 10 million random numbers for our arrays. In the first case, CPU adds each number one by one. For GPU Calculation, each CUDA thread handles independent operations in threads at the same time. Thousands of threads work in parallel, finishing the job much faster.</blockquote><h3>The Performance Boost</h3><p>Now, let’s talk numbers. Here’s a quick comparison:</p><blockquote>→ CPU Time: 0.038214 seconds</blockquote><blockquote>→ GPU Time: 0.002171 seconds</blockquote><p>That’s a 17.6x speed-up! this is why CUDA Matters.</p><h3>An Ultimate Beginner guide:</h3><p><strong>Installation part</strong><br> First things first, make sure your system has a <strong>CUDA-capable GPU</strong>. On Windows, hit control /name Microsoft.DeviceManager to peek at your hardware. On <strong>Linux</strong>, nvidia-smi will give you the lowdown.</p><p><em>Downloading the CUDA Toolkit,</em> Head over to the NVIDIA CUDA download page. Choose your OS (Windows, Linux, or macOS) and architecture (x86_64). Pick the CUDA version that matches your project needs or is compatible with other frameworks you’re using.</p><p><em>Install the Toolkit</em> in Windows through Grab the local .exe installer or network installer. Run it, and make sure to select all the goodies like the CUDA Toolkit, sample projects, and documentation. For <strong><em>Linux, </em></strong>Follow NVIDIA’s steps to install the driver, GCC, and then the CUDA toolkit. It’s like following a recipe, but for your computer.</p><p><em>Set Up Your Environment Variables</em></p><p><strong>Windows</strong>: Double-check that CUDA_PATH and PATH variables are pointing to the right CUDA directories.</p><p><strong>Linux:</strong> Add CUDA paths to your .bashrc file. It’s like giving your system a map to find CUDA.</p><p>Verify Your <em>Installation</em> by running nvcc -V to see if the CUDA compiler is installed correctly. After these exhaustive steps, voila! explore the never ending potential with it through amazing projects.</p><p>Now, here’s the catch, these steps might seem like a cakewalk, but they can test your patience and time to successfully get the toolkit on your system. like Toolkit Mismatch, Compiler Incompatibility, PATH issues, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*CXGgYjmouq56dd8DUa4zzg.jpeg" /></figure><p>Don’t worry, we’ll cover these errors and more in upcoming posts, so stay tuned!</p><h3>Wrapping Up</h3><p>So, after much patience, you reach till the end(much appreciated), With this guide, you’re ready to install CUDA, start exploring its power, and tackle any challenges that come your way. It’s about unlocking the full potential of your GPU tasks and maintaining the easy tasks with CPU.</p><p><em>For more resources, please go through the blogs and resources:</em></p><blockquote><a href="https://maharshi.bearblog.dev/optimizing-softmax-cuda/">CUDA — Bear Blog</a></blockquote><blockquote><a href="https://developer.nvidia.com/blog/">CUDA programming guide</a></blockquote><blockquote><a href="https://www.modular.com/blog/democratizing-compute-part-2-what-exactly-is-cuda">CUDA runtime API</a></blockquote><blockquote><a href="https://www.turing.com/kb/understanding-nvidia-cuda">Turing</a></blockquote><p>Thanks for tuning in, and keep those GPUs humming! See you all in the next blog!!</p><p><em>~Bhasha</em></p><blockquote><strong>Share || Export || Like</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=003874090267" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>