<?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>Notes on Ethan's Blog</title><link>https://blog.ethanlyu.top/tags/notes/</link><description>Recent content in Notes on Ethan's Blog</description><image><title>Ethan's Blog</title><url>https://blog.ethanlyu.top/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url><link>https://blog.ethanlyu.top/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link></image><generator>Hugo -- 0.152.2</generator><language>en</language><lastBuildDate>Tue, 21 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.ethanlyu.top/tags/notes/index.xml" rel="self" type="application/rss+xml"/><item><title>Deep Generative Model I</title><link>https://blog.ethanlyu.top/posts/deep-generative-model-i/</link><pubDate>Tue, 21 Oct 2025 00:00:00 +0000</pubDate><guid>https://blog.ethanlyu.top/posts/deep-generative-model-i/</guid><description>&lt;p&gt;The rise of large models has advanced the way of how we move towards to the intelligence. In the past decades, people worked on &amp;ldquo;discriminative&amp;rdquo; intelligence, that is, we predict a dog image as a &amp;ldquo;dog&amp;rdquo;. To do so, we train on a batch of dataset containing different categories with labels, and train with the goal that every output matches the corresponding classes. The great success of LLM has brought us into a new era: GenAI. Unlike the discriminative model, we generate the image &amp;ldquo;dog&amp;rdquo; given the input prompt (text, image, &amp;hellip;). This is called &lt;em&gt;generative model&lt;/em&gt;.
&lt;img loading="lazy" src="https://blog.ethanlyu.top/attachment/40665896e722d64746aa9972abd6199d.png"&gt;&lt;/p&gt;</description></item><item><title>CUDA Programming Model II</title><link>https://blog.ethanlyu.top/posts/day-2-programming-model-ii/</link><pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate><guid>https://blog.ethanlyu.top/posts/day-2-programming-model-ii/</guid><description>&lt;p&gt;Previously, we discuss the basic programming model of CUDA: memory and thread. In this note, we will dive into the hardware implementation. By doing this, we can better understand the philosophy of CUDA programming, so as to accelerate the computation.&lt;/p&gt;
&lt;p&gt;The GPU architecture is built around a scalable array of multi-threaded Streaming Multiprocessors (SMs). There are usually numerous SMs in every GPU. And every SM can host hundreds of threads. When a CUDA program on the host GPU invokes a kernel grid, the blocks of the grid are enumerated and distributed to multiprocessors with available and distributed to SMs with available execution capacity.&lt;/p&gt;</description></item><item><title>CUDA Programming Model I</title><link>https://blog.ethanlyu.top/posts/day-1-programming-model-i/</link><pubDate>Sun, 24 Nov 2024 00:00:00 +0000</pubDate><guid>https://blog.ethanlyu.top/posts/day-1-programming-model-i/</guid><description>&lt;p&gt;The programming model gives us a high level idea of how to write CUDA programs. Also, we need to know how to debug the program using the toolchains.&lt;/p&gt;
&lt;p&gt;There are several key points that we need to be aware of in the GPU programming:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Kernel Function&lt;/li&gt;
&lt;li&gt;Memory Management&lt;/li&gt;
&lt;li&gt;Thread Management&lt;/li&gt;
&lt;li&gt;Streams&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A typical environment usually encompasses several CPUs and GPUs. They use PCIe to communicate with each other. &lt;strong&gt;The memory is strictly isolated between CPU and GPU&lt;/strong&gt; (though they share uniform addressing). A complete CUDA program can be executed in the following way:
&lt;img loading="lazy" src="https://blog.ethanlyu.top/attachment/1e2e4a3828300afff6c90c9d4942f57c.png"&gt;
The host code is followed by the parallel code. And it will be returned immediately to the main thread. In other word, when the first parallel code is running, the second host code is likely to run as well simultaneously.&lt;/p&gt;</description></item><item><title>CUDA Programming Intro</title><link>https://blog.ethanlyu.top/posts/day-0-hello-world----cuda/</link><pubDate>Fri, 01 Nov 2024 00:00:00 +0000</pubDate><guid>https://blog.ethanlyu.top/posts/day-0-hello-world----cuda/</guid><description>&lt;p&gt;There are numerous tutorials online to teach how to use CUDA C++ for parallel programming. And we will adopt some of them. The best way to learn is to read the official documents. This tutorial, however, will start from how to write the code at the beginning. We will illustrate the architecture part throughout the code.&lt;/p&gt;
&lt;p&gt;We will take few days to go over the principle of CUDA programming. Afterwards, we will read over the ML code to see how the operations are implemented in CUDA core. There is no strict prerequisite (except basic programming), but it would be better to know OS and CPU (a little bit).&lt;/p&gt;</description></item></channel></rss>