<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Sandeep Kumar</title><link>https://sandeep007734.github.io/posts/</link><description>Recent content in Posts on Sandeep Kumar</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 10 Jul 2026 00:00:00 +0530</lastBuildDate><atom:link href="https://sandeep007734.github.io/posts/feed.xml" rel="self" type="application/rss+xml"/><item><title>Cache Coherence Demystified: The MESI Protocol on Intel Granite Rapids</title><link>https://sandeep007734.github.io/posts/cache_coherence/</link><pubDate>Tue, 03 Mar 2026 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/cache_coherence/</guid><description>Deep dive into cache coherence and the MESI protocol on a 256-core Intel Granite Rapids system: microbenchmarks for ping-pong latency, false sharing, atomic contention, and lock primitives.</description></item><item><title>Everything on Precision: Numeric Formats in Modern ML and HPC</title><link>https://sandeep007734.github.io/posts/everything_on_precision/</link><pubDate>Tue, 03 Mar 2026 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/everything_on_precision/</guid><description>A walkthrough of numeric formats that matter today — FP32, TF32, FP16, BF16, FP8, INT8, INT4 — how they behave, when to use each, and where the pitfalls hide.</description></item><item><title>LLM Inference Introduction: the end-to-end flow and vector math</title><link>https://sandeep007734.github.io/posts/llm_basics/</link><pubDate>Tue, 10 Feb 2026 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/llm_basics/</guid><description>LLM Basic</description></item><item><title>Understanding Linux perf: stat and record</title><link>https://sandeep007734.github.io/posts/understanding-perf-tools/</link><pubDate>Thu, 04 Dec 2025 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/understanding-perf-tools/</guid><description>What really happens in the kernel when you run perf stat or perf record.</description></item><item><title>Fat File System</title><link>https://sandeep007734.github.io/posts/fat-fs/</link><pubDate>Sat, 16 May 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/fat-fs/</guid><description>&lt;p&gt;In this post, we discuss the internals of a FAT based file system. FAT stands for File Allocation Table, which is also the name of the central data structure of this design. It is one of the oldest file system designs still in use &amp;ndash; your pen drive is probably formatted with some variant of it (FAT32 or exFAT).&lt;/p&gt;
&lt;h2 id="the-layout"&gt;The layout&lt;/h2&gt;
&lt;p&gt;A FAT file system has a fairly simple on-disk layout:&lt;/p&gt;</description></item><item><title>Library Calling in C</title><link>https://sandeep007734.github.io/posts/lib-calling/</link><pubDate>Wed, 01 May 2019 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/lib-calling/</guid><description>&lt;p&gt;In this post we are exploring how different types of binaries are generated, how function calls work when code is split across multiple files, and how the toolchain (compiler, linker, loader) helps. We&amp;rsquo;ll also cover how to build and install a custom libc for testing and debugging purposes.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="file-types-and-high-level-flow"&gt;File Types and High-Level Flow&lt;/h2&gt;
&lt;p&gt;Difference in types of files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.c&lt;/code&gt; / &lt;code&gt;.cpp&lt;/code&gt;: source files&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.o&lt;/code&gt;: object files (compiled but not yet linked)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.a&lt;/code&gt;: static library (archive of &lt;code&gt;.o&lt;/code&gt; files)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.so&lt;/code&gt;: shared library (dynamically linked at runtime)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Typical build pipeline:&lt;/p&gt;</description></item><item><title>Installing Intel SGX on Ubuntu 18.04</title><link>https://sandeep007734.github.io/posts/sgx/installing-sgx/</link><pubDate>Sat, 27 Apr 2019 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/sgx/installing-sgx/</guid><description>Test</description></item><item><title>The VNNI layout, and why your AMX kernel is silently wrong</title><link>https://sandeep007734.github.io/posts/vnni-tutorial/</link><pubDate>Sun, 08 Mar 2026 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/vnni-tutorial/</guid><description>Notes from getting Intel AMX to do a matrix multiply: the VNNI memory layout, why skipping it gives silently wrong answers, and LIBXSMM&amp;#39;s dispatch model.</description></item><item><title>Adding a counter to the *proc* interface</title><link>https://sandeep007734.github.io/kernel/instrumentation/adding_to_proc/</link><pubDate>Thu, 08 Apr 2021 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/kernel/instrumentation/adding_to_proc/</guid><description>A practical guide to instrumenting the Linux kernel by adding custom counters to /proc/vmstat</description></item><item><title>Inode File system</title><link>https://sandeep007734.github.io/posts/inode-fs/</link><pubDate>Sat, 16 May 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/inode-fs/</guid><description>&lt;p&gt;In this post, we are going to discuss the internals of an inode based file system. There are different variants of inode: i-node, I-node, and, of course, inode. We are going to be using &amp;ldquo;inode&amp;rdquo; for this post.&lt;/p&gt;
&lt;h2 id="what-is-an-inode"&gt;What is an inode?&lt;/h2&gt;
&lt;p&gt;Inode is a data structure, used by modern file systems, such as ext4, to track the contents of a file across the disk. An inode is associated with every file and directory. Technically, from the point of view of a file system, there is no difference between the inode of a file or a directory. They are basically the same, with a flag in the inode stating whether it is pointing to a file or a directory.&lt;/p&gt;</description></item><item><title>Intel SGX Internals</title><link>https://sandeep007734.github.io/posts/sgx/intelsgx-internals/</link><pubDate>Thu, 14 May 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/sgx/intelsgx-internals/</guid><description>&lt;div style="background-color:blue; text-align:center; vertical-align: middle; padding:4px 0; margin-top:3px; color:white;"&gt;
Status: &lt;strong&gt;In Progress&lt;/strong&gt;
&lt;/div&gt;
&lt;p&gt;In this post, we are going to discuss the latest Intel SGX technology from Intel. Intel SGX is from the suite of TEE solutions that has technologies from various vendors such as ARM TrustZone from ARM, XX from XX, and much more.
These solutions enable a capability in the latest computer chips that have been missing until now. It allows the hardware of the system to guarantee the CFI property of an execution. CFI stands for control-flow integrity and is used to determine the security of an executing program.&lt;/p&gt;</description></item><item><title>Installing custom LibC</title><link>https://sandeep007734.github.io/posts/custom-libc/</link><pubDate>Mon, 09 Mar 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/custom-libc/</guid><description>&lt;p&gt;Glibc is the standard library that is linked against all the linux applications. It provides the necessary functionality like &lt;em&gt;printf&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It also provides wrappers for most used system calls like &lt;em&gt;open, read, write, close&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="manually-building-and-installing-libc"&gt;Manually building and installing libc.&lt;/h2&gt;
&lt;p&gt;Example from a &lt;a href="https://stackoverflow.com/questions/10412684/how-to-compile-my-own-glibc-c-standard-library-from-source-and-use-it"&gt;StackOverflow answer&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;export glibc_install=&amp;#34;$(pwd)/glibc/build/install&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;git clone git://sourceware.org/git/glibc.git
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;cd glibc
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;git checkout glibc-2.28
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;mkdir build
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;cd build
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;../configure --prefix &amp;#34;$glibc_install&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;make
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;make install
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Followed by a test c code&lt;/p&gt;</description></item><item><title>GPU Memory Profiling Tools (NVIDIA and Intel)</title><link>https://sandeep007734.github.io/posts/gpu_memory_profiling_tools/</link><pubDate>Tue, 10 Feb 2026 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/gpu_memory_profiling_tools/</guid><description>A practical guide to observing GPU memory stats on NVIDIA and Intel GPUs (monitors, profilers, and attribution).</description></item><item><title>Install Graphene SGX</title><link>https://sandeep007734.github.io/posts/graphenesgx_install/</link><pubDate>Thu, 08 Apr 2021 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/graphenesgx_install/</guid><description>&lt;p&gt;In this brief post, we will be installing &lt;a href="https://github.com/oscarlab/graphene"&gt;GrapheneSGX&lt;/a&gt; on a real machine with support for Intel SGX.
We will be using Ubuntu 20.04 and kernel version: 5.12.
There are other &lt;a href="https://graphene.readthedocs.io/en/latest/building.html"&gt;great tutorials&lt;/a&gt; out there. They are more general and can be used by anyone. Here, we are focusing on a particular machine.&lt;/p&gt;
&lt;p&gt;Our expectations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We will be using the latest stable version that was released in 2020. v1.1
&lt;ul&gt;
&lt;li&gt;The master branch is in between transition from make to meson. Though it builds successfully, I have faced some issues in running some examples. As there are no major functional changes as of now, we will wait for it to become stable before switching to it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Graphene with SGX support.&lt;/li&gt;
&lt;li&gt;All features working as expected, with all the PATH variables correctly set up.&lt;/li&gt;
&lt;li&gt;Run an example: Maybe &lt;a href="https://www.iozone.org/"&gt;Iozone&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not focusing on:&lt;/p&gt;</description></item><item><title>Dyninst</title><link>https://sandeep007734.github.io/posts/dyninst/</link><pubDate>Fri, 27 Apr 2018 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/dyninst/</guid><description>&lt;p&gt;This is a tool for binary instrumentation.&lt;/p&gt;
&lt;p&gt;Clone the repository using the command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;git clone https://github.com/dyninst/dyninst.git
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Some useful links:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/BinaryAnalysisPlatform/bap/"&gt;https://github.com/BinaryAnalysisPlatform/bap/&lt;/a&gt;
&lt;a href="https://studylib.net/doc/5617117/dyninst-tutorial-slides"&gt;https://studylib.net/doc/5617117/dyninst-tutorial-slides&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.paradyn.org/tutorial/"&gt;http://www.paradyn.org/tutorial/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Attacks on the control flow integrity of applications</title><link>https://sandeep007734.github.io/posts/attacks/bufferoverflow/</link><pubDate>Thu, 12 Mar 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/attacks/bufferoverflow/</guid><description>&lt;h2 id="buffer-overflow-attacks"&gt;Buffer overflow attacks&lt;/h2&gt;
&lt;p&gt;Buffer overflow attack basically means that the content provided by the user to an application has a bigger size than what the application was expecting. In this case, if the application did not handle this kind of situation, then the user provided content will overwrite the stack of the application. In most cases this will corrupt the stack and the program will end with a segmentation fault.&lt;/p&gt;</description></item><item><title>Managing tasks via Google Tasks</title><link>https://sandeep007734.github.io/posts/googletasks/</link><pubDate>Sat, 22 Feb 2020 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/googletasks/</guid><description>&lt;p&gt;Google tasks is a great tool to manage tasks.&lt;/p&gt;
&lt;p&gt;We can further extend its capabilities by tracking the tasks completed so far, which allows us to look back and see where all the time went.&lt;/p&gt;
&lt;p&gt;By connecting Google tasks to &lt;em&gt;automate.io&lt;/em&gt;, we can add an entry to the Google calendar when a task is marked complete, and also create an entry into a Google sheet with all the details, such as name of the task, date tasks were created, and when it was completed.&lt;/p&gt;</description></item><item><title>Experiments with the CPU benchmark</title><link>https://sandeep007734.github.io/posts/exp_cpu_bench/</link><pubDate>Sat, 27 Apr 2019 00:00:00 +0530</pubDate><guid>https://sandeep007734.github.io/posts/exp_cpu_bench/</guid><description>&lt;h2 id="experiments-with-the-cpu-benchmark"&gt;Experiments with the CPU benchmark&lt;/h2&gt;
&lt;p&gt;The iso can be downloaded from here:&lt;br&gt;
&lt;a href="https://iitd-plos.github.io/col729/labs/lab0/lab0.html"&gt;https://iitd-plos.github.io/col729/labs/lab0/lab0.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The link is valid only within IITD.
The installation module is given at:
&lt;a href="https://www.spec.org/cpu2017/Docs/install-guide-unix.html"&gt;https://www.spec.org/cpu2017/Docs/install-guide-unix.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After extracting the ISO run&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;./install.sh
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;There might be a need to make the folder executable:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; chmod +x -R &amp;lt;folder name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After the installation, setup the environment by sourcing the &lt;em&gt;shrc&lt;/em&gt; or the &lt;em&gt;chrc&lt;/em&gt; file.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;source shrc
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;
go config
cp Example-gcc-linux-x86.cfg try1.cfg
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Run using the command:&lt;/p&gt;</description></item></channel></rss>