<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: hemupadhyay26</title>
    <description>The latest articles on Forem by hemupadhyay26 (@hem_upadhyay_ad9428dc9ddc).</description>
    <link>https://forem.com/hem_upadhyay_ad9428dc9ddc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3118582%2Fbcae5f13-b04b-40df-9214-c9d7fa9ae6a0.jpg</url>
      <title>Forem: hemupadhyay26</title>
      <link>https://forem.com/hem_upadhyay_ad9428dc9ddc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hem_upadhyay_ad9428dc9ddc"/>
    <language>en</language>
    <item>
      <title>Docker Desktop on Windows EC2 Virtualization not supported Requires Nested Virtualization (AWS)</title>
      <dc:creator>hemupadhyay26</dc:creator>
      <pubDate>Sun, 22 Feb 2026 13:35:53 +0000</pubDate>
      <link>https://forem.com/hem_upadhyay_ad9428dc9ddc/docker-desktop-on-windows-ec2-virtualization-not-supported-requires-nested-virtualization-aws-1n5d</link>
      <guid>https://forem.com/hem_upadhyay_ad9428dc9ddc/docker-desktop-on-windows-ec2-virtualization-not-supported-requires-nested-virtualization-aws-1n5d</guid>
      <description>&lt;p&gt;I was recently working on setting up Docker Desktop on a Windows EC2 instance provided by a client and ran into a virtualization issue that took some time to identify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;Docker Desktop on Windows depends on a virtualization backend (WSL2 or Hyper-V), so hardware virtualization support is a mandatory requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Issue
&lt;/h2&gt;

&lt;p&gt;While enabling the required features, I kept hitting errors indicating that virtualization was not supported on the instance — even though the OS and configuration steps were correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Root Cause
&lt;/h2&gt;

&lt;p&gt;On AWS, running Docker Desktop inside a Windows EC2 instance requires &lt;strong&gt;nested virtualization&lt;/strong&gt;, since you’re effectively trying to run a virtualization layer inside a VM.&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;not supported on all instance families&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After digging through the AWS documentation, I found that nested virtualization is currently supported only on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C8i&lt;/li&gt;
&lt;li&gt;M8i&lt;/li&gt;
&lt;li&gt;R8i&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The issue was resolved after switching the instance to one of the supported families.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;If you’re planning to run &lt;strong&gt;Docker Desktop on a Windows EC2 instance&lt;/strong&gt;, check nested virtualization support first — otherwise WSL2/Hyper-V will fail regardless of correct OS-level setup.&lt;/p&gt;

&lt;p&gt;This detail is easy to miss because it’s buried quite deep in the documentation, so sharing it here to save someone else the troubleshooting time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2026/02/amazon-ec2-nested-virtualization-on-virtual/" rel="noopener noreferrer"&gt;Reference&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>ec2</category>
      <category>docker</category>
    </item>
    <item>
      <title>How Docker Uses the Kernel to Isolate Containers 🐳⚙️</title>
      <dc:creator>hemupadhyay26</dc:creator>
      <pubDate>Fri, 15 Aug 2025 19:50:43 +0000</pubDate>
      <link>https://forem.com/hem_upadhyay_ad9428dc9ddc/how-docker-uses-the-kernel-to-isolate-containers-4b28</link>
      <guid>https://forem.com/hem_upadhyay_ad9428dc9ddc/how-docker-uses-the-kernel-to-isolate-containers-4b28</guid>
      <description>&lt;p&gt;It’s been over a year since I started working with &lt;strong&gt;Docker&lt;/strong&gt; — building images, running containers, using Docker Compose, mapping ports, and doing all the regular containerization tasks.&lt;/p&gt;

&lt;p&gt;But recently, I decided to go deeper.&lt;/p&gt;

&lt;p&gt;Not just &lt;em&gt;how to use Docker&lt;/em&gt;, but &lt;em&gt;how Docker really works with the kernel&lt;/em&gt;.&lt;br&gt;
And honestly, it’s fascinating.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Kernel: The Real Magic Behind the Scenes
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;kernel&lt;/strong&gt; is the heart of any operating system. It manages processes, memory, networking, and communication — the core plumbing that everything else relies on.&lt;/p&gt;

&lt;p&gt;Over the past two decades, the kernel has evolved into a highly optimized, smooth-running foundation for modern computing. And Docker simply &lt;em&gt;taps into that magic&lt;/em&gt; using a set of powerful kernel features.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Kernel Features Docker Uses
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;chroot&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;chroot&lt;/code&gt; changes the apparent root directory for a process, locking it into its own filesystem view. This gives processes a scoped, isolated environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Namespaces
&lt;/h3&gt;

&lt;p&gt;Namespaces isolate system resources — process IDs, network interfaces, mount points, and more — so each container feels like its own little world.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. cgroups (Control Groups)
&lt;/h3&gt;

&lt;p&gt;Control Groups limit and allocate CPU, memory, and I/O to containers, ensuring they don’t consume more than their fair share of resources.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;So far, I’ve explored these three features — but Docker uses much more behind the scenes to provide isolation, efficiency, and portability.&lt;/p&gt;

&lt;p&gt;Once you understand these fundamentals, it’s much easier to dive into advanced container topics, troubleshoot complex issues, or even appreciate the elegance of how containers achieve their “virtual machine feel” without the heavy overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  Must-Watch References 🎥
&lt;/h2&gt;

&lt;p&gt;If you want to understand Docker at a &lt;em&gt;much deeper level&lt;/em&gt;, I can’t recommend these enough.&lt;br&gt;
They’re not just good — they’re the kind of content you can binge-watch like your favorite Netflix series.&lt;/p&gt;

&lt;p&gt;1️⃣ &lt;a href="https://www.youtube.com/watch?v=sK5i-N34im8&amp;amp;t=2795s" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=sK5i-N34im8&amp;amp;t=2795s&lt;/a&gt;&lt;br&gt;
2️⃣ &lt;a href="https://www.youtube.com/watch?v=8fi7uSYlOdc" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=8fi7uSYlOdc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After watching these, you’ll gain so much clarity — and from there, you can explore any part of Docker’s internals with confidence.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>linux</category>
      <category>programming</category>
    </item>
    <item>
      <title>Fine-Tuning Large Language Models (LLMs): A Complete Step-by-Step Guide</title>
      <dc:creator>hemupadhyay26</dc:creator>
      <pubDate>Sun, 03 Aug 2025 08:38:53 +0000</pubDate>
      <link>https://forem.com/hem_upadhyay_ad9428dc9ddc/fine-tuning-large-language-models-llms-a-complete-step-by-step-guide-5f15</link>
      <guid>https://forem.com/hem_upadhyay_ad9428dc9ddc/fine-tuning-large-language-models-llms-a-complete-step-by-step-guide-5f15</guid>
      <description>&lt;p&gt;Fine-tuning a Large Language Model (LLM) lets you adapt an existing AI model to your needs — whether that’s injecting domain knowledge, adjusting tone, or optimizing for specific tasks.&lt;br&gt;&lt;br&gt;
It’s more efficient than training from scratch and can dramatically improve performance for niche use cases.&lt;/p&gt;

&lt;p&gt;In this guide, we’ll cover &lt;strong&gt;the complete fine-tuning process&lt;/strong&gt;, from defining goals to deployment.&lt;br&gt;&lt;br&gt;
We’ll also highlight why &lt;strong&gt;dataset creation is the most crucial step&lt;/strong&gt; and how using a larger LLM for filtering can make your smaller model much smarter.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Understand Fine-Tuning &amp;amp; Choose the Right Method
&lt;/h2&gt;

&lt;p&gt;Before starting, define your &lt;strong&gt;goal&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do you need a general-purpose assistant or a task-specific expert?&lt;/li&gt;
&lt;li&gt;Should the model focus on tone, accuracy, or covering rare edge cases?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fine-tuning methods:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LoRA (Low-Rank Adaptation)&lt;/strong&gt; – Updates small trainable matrices; fast and cost-efficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QLoRA&lt;/strong&gt; – LoRA + 4-bit quantization; great for large models on modest hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full Fine-Tuning (FFT)&lt;/strong&gt; – Updates all weights; powerful but resource-heavy and risks &lt;em&gt;catastrophic forgetting&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PEFT&lt;/strong&gt; – Parameter-efficient approaches (including LoRA) that update only a subset of parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 &lt;em&gt;Beginner tip:&lt;/em&gt; Start with a small &lt;strong&gt;instruct model&lt;/strong&gt; like &lt;em&gt;Llama 3.1 (8B)&lt;/em&gt; for faster and cheaper fine-tuning.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Prepare a High-Quality Dataset — &lt;strong&gt;The Most Crucial Step&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Your dataset decides exactly how your model thinks, behaves, and what it knows.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A well-curated dataset will outperform a large, noisy one.&lt;br&gt;&lt;br&gt;
Using a &lt;strong&gt;larger LLM&lt;/strong&gt; to filter and clean your training data can greatly boost results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structure as &lt;strong&gt;QA pairs&lt;/strong&gt; or chat-style data.&lt;/li&gt;
&lt;li&gt;Generate synthetic data from PDFs, videos, or existing logs.&lt;/li&gt;
&lt;li&gt;Filter for accuracy, style, and relevance using a strong LLM.&lt;/li&gt;
&lt;li&gt;Remove unnecessary context if it reduces clarity.&lt;/li&gt;
&lt;li&gt;Split into &lt;strong&gt;training&lt;/strong&gt;, &lt;strong&gt;validation&lt;/strong&gt;, and &lt;strong&gt;test&lt;/strong&gt; sets.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  3. Set Up Your Training Environment
&lt;/h2&gt;

&lt;p&gt;You’ll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GPU access&lt;/strong&gt; (e.g., RunPod with 25GB VRAM)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy your dataset to the training environment.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  4. Data Loading &amp;amp; Formatting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Load dataset&lt;/strong&gt; (e.g., with &lt;code&gt;load_dataset&lt;/code&gt; from Hugging Face).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply chat templates&lt;/strong&gt; (system, user, assistant roles).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tokenize&lt;/strong&gt; text into tokens using the model’s tokenizer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch&lt;/strong&gt; data based on GPU memory.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  5. Fine-Tuning the Model
&lt;/h2&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load base model&lt;/strong&gt; (e.g., Llama 3.1 8B).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantize&lt;/strong&gt; (QLoRA → 4-bit) for memory savings.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;gradient checkpointing&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Define &lt;strong&gt;LoRA config&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rank&lt;/code&gt; – adapter matrix size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lora_alpha&lt;/code&gt; – scaling factor (often &amp;gt; rank).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lora_dropout&lt;/code&gt; – regularization.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;target_modules&lt;/code&gt; – layers to adapt.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;strong&gt;SFTTrainer&lt;/strong&gt; with tuned hyperparameters:&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;num_train_epochs&lt;/code&gt; – start low (1–3), increase later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;learning_rate&lt;/code&gt; – lower values for precision.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;save_steps&lt;/code&gt; – checkpoint frequency.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Train and monitor:&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loss ≈ 0.55 is healthy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Token accuracy &amp;gt; 0.9 is ideal.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  6. Evaluation &amp;amp; Iteration
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manual&lt;/strong&gt;: Chat with the model to check style, accuracy, and knowledge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated&lt;/strong&gt;: Use tools like &lt;code&gt;lm-evaluation-harness&lt;/code&gt; or SuperAnnotate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If results aren’t great:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve data quality.&lt;/li&gt;
&lt;li&gt;Adjust LoRA parameters.&lt;/li&gt;
&lt;li&gt;Train for more epochs.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  7. Save &amp;amp; Deploy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Save &lt;strong&gt;LoRA adapter files&lt;/strong&gt; (~100MB).&lt;/li&gt;
&lt;li&gt;Deploy locally (e.g., with Ollama) or push to Hugging Face Hub.&lt;/li&gt;
&lt;li&gt;For inference:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;FastLanguageModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;for_inference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_new_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama run &amp;lt;model_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Advanced Tips
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Increase &lt;strong&gt;LoRA rank &amp;amp; alpha&lt;/strong&gt; (e.g., rank 256, alpha 512) for richer updates.&lt;/li&gt;
&lt;li&gt;Train for more epochs if data is clean (watch for overfitting).&lt;/li&gt;
&lt;li&gt;Always &lt;strong&gt;use stronger models for filtering&lt;/strong&gt; smaller LLM training data.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📚 Resources &amp;amp; Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🎥 &lt;a href="https://www.youtube.com/watch?v=D3pXSkGceY0&amp;amp;list=WL" rel="noopener noreferrer"&gt;Fine-Tuning Walkthrough (YouTube)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📄 &lt;a href="https://docs.unsloth.ai/" rel="noopener noreferrer"&gt;Unsloth Docs – Quantization &amp;amp; Efficient Tuning&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📝 &lt;a href="https://www.ibm.com/think/topics/rag-vs-fine-tuning" rel="noopener noreferrer"&gt;IBM: RAG vs Fine-Tuning&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;💡 Key Takeaway:&lt;/strong&gt;&lt;br&gt;
Fine-tuning success isn’t just about running a script — it’s &lt;strong&gt;data quality + smart parameter choices + iterative refinement&lt;/strong&gt;.&lt;br&gt;
Your model is only as good as the data you feed it.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
