<?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 Zartbot on Medium]]></title>
        <description><![CDATA[Stories by Zartbot on Medium]]></description>
        <link>https://medium.com/@nimokaka?source=rss-5a0cc9c55eb1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*04Ctp6nxLLkXNq9T</url>
            <title>Stories by Zartbot on Medium</title>
            <link>https://medium.com/@nimokaka?source=rss-5a0cc9c55eb1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 04:19:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nimokaka/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 evolution of large model architectures, or “The Art of Memory”]]></title>
            <link>https://medium.com/@nimokaka/the-evolution-of-large-model-architectures-or-the-art-of-memory-4c13fa564522?source=rss-5a0cc9c55eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c13fa564522</guid>
            <dc:creator><![CDATA[Zartbot]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 17:27:58 GMT</pubDate>
            <atom:updated>2025-01-22T17:27:58.952Z</atom:updated>
            <content:encoded><![CDATA[<p>Influenced by DeepSeekv3, both Minimax and Stepfun have disclosed their model architectures. These are highly innovative works. Minimax reduces the computational and space complexity for long texts through Linear Attention. Stepfun introduces a conceptual framework called Generalized Multi-Head Attention (GMHA) to understand different MHA variants, with Fully Parameterized Bilinear Attention (FPBA) as the capacity upper bound, offering a very insightful perspective. They then propose a matrix factorization scheme to minimize parameters and KV Cache usage, bringing the model capacity as close as possible to FPBA. Based on these analyses, they introduce MFA and MFA-KR, significantly increasing the number and dimension of attention heads while adopting a single value for KV.</p><p>Essentially, these works and DeepSeek’s MLA all modify the attention mechanism, either to reduce spatial complexity or temporal complexity. However, these modifications introduce another perspective.</p><p>If the initial token-by-token inference in large models can be likened to a sequential <strong>Turing machine</strong> with a tape, then the emergence of OAI-O1 methods is more akin to a more complete Turing machine, albeit one that lacks the ability to backtrack and erase on the tape. These backtracking and erasing capabilities could be a good way to save complexity during the inference phase. <strong>After all, we don’t need an infinitely large scratchpad to solve many problems, and neither do large models.</strong></p><p>As mentioned before, <strong>this paper aims to construct a general-purpose computer architecture capable of generating and running code through the large model architecture, treating tokens as instructions.</strong> When visualizing this, it becomes clear that large models may indeed transition from autoregressive to self-generating instruction paths. <strong>Thus, constructing a von Neumann architecture for large models would look something like this.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/0*sefw_A63M_kQsq2E.png" /></figure><h3>The evolution of the Attention block</h3><p>Actually, I had been contemplating how to modify the Attention block since last year, such as the GNN-SAE Adapter mentioned in<strong><em> “Discussing DeepMind’s TransNAR for Solving Algorithmic Problems and Introducing the Composable Transformer Hypothesis Based on SAE-GNN.”</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/0*ubE1NHQQsUadMYJr.png" /></figure><p>The principle, viewed from category theory, involves imposing constraints during Attention computation to prevent erroneous inputs. Essentially, some PostTraining methods also update and constrain the parameters of WQ, WK, and WV in Attention. Analogous to computer architecture, <strong>hallucinations are similar to out-of-bounds memory access in general-purpose computers. PostTraining techniques can be seen as implementing protections against such out-of-bounds access, making large model security akin to security in computer architecture.</strong></p><p>A recent Google Research paper has further reinforced this intuition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*xOkW6e2fXipEusBZ.png" /></figure><p>The GNN-SAE Adapter is essentially consistent with the MAG (Memory as Gate) Architecture from Google’s paper, both requiring a certain level of verification at test time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l4Hq-sSInhZOYVhQ.png" /></figure><p>The opening quote in the Google paper suddenly sparked a lot of inspiration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*1cly1Bs_bL5KSdBs.png" /></figure><p>The issue with the O(N²d) complexity of Attention computation is similar to the challenges faced in the era without virtual memory. Various approaches like Linear Attention, MFA, MLA, GQA, and MQA essentially act as memory compression mechanisms, allowing processing within a smaller latent space.</p><h3>From the perspective of computer architecture</h3><p>Indeed, we are exploring various approaches to modify the Attention block through the construction of KV Heads to reduce memory overhead during training and inference. However, many compression methods to the latent space are inherently lossy, which initially raised doubts about the effectiveness of DeepSeek MLA (though these concerns now seem unfounded).</p><p>These efforts essentially involve processing within a fixed physical memory, resorting to data structure compression when capacity is exceeded. The paper<strong> “Space-time tradeoffs of lenses and optics via higher category theory”</strong> also offers valuable insights into the space-time trade-offs of Optics and Lenses through higher category theory.</p><p>From a computer architecture perspective, is it necessary to keep all context in memory for full access by the Attention control unit? A true Attention mechanism should incorporate a paging mechanism, similar to how books or papers reference specific sections. The computation engine only needs to access the pages pointed to by its program.</p><p>Following this idea, we can construct a virtual memory space, loading only the necessary pages for Attention calculations. Mixture of Experts (MoE) might be an early implementation of a paged memory system, and the recently proposed MoE Group aims to extend this into a multi-level page table.</p><h3>Tokens as Instruction</h3><p>In essence, autoregressive generative AI models extend traditional computer architectures by enabling the autonomous generation of code segments. The prompt can be viewed as the initial code section (.text) for a large model. As the generated structure evolves, heap and stack structures emerge, with models like o1 and DeepSeek-R3 further enhancing stack and heap management through reinforcement learning (RL) to control information deletion and subsequent computation.</p><p>From this perspective, there is a case for developing a specialized Instruction Set Architecture (ISA) for these large models, treating specific tokens as code. The next frontier for large models, or the essence of Test Time Scaling Laws, could involve modifying and swapping out parts of the token sequence (context) to execute new code paths.</p><p>At this stage, a self-verification and error-correction mechanism becomes necessary, with Google’s Titans paper offering an early example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-_WP09Ue9W-N14hx.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*RCB8LUAmTGl9ryp4.png" /></figure><p>Through Test-Time Learning, retrieve “code snippets” (Instruction Tokens) based on the existing context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kILu8w4GB0ci2SN0.png" /></figure><p>Updating control instructions in memory based on the output of Attention might indeed be a viable approach to truly reduce KVCache memory consumption.</p><p><strong><em>Adding more control logic, potentially involving morphism constraints from higher category theory, algebraic topology, or algebraic geometry, could further refine this method.</em></strong></p><h3><strong>Speculation Decode as Branch Predictor</strong></h3><p>On the other hand, techniques like speculative decoding or DeepSeek’s MTP, from a computer architecture perspective, essentially form take-N branch predictor.</p><h3>MoE Group as multilevel page table</h3><p>From a category theory perspective, the Block Diagonal matrix in MoE essentially disrupts the structure, neglecting some morphisms. Introducing multi-level page tables could help manage and restore these relationships, potentially addressing the neglected morphisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/0*r5Ka7FRdedonqKIu.png" /></figure><p>Perhaps this is the true “Page” Attention.</p><h3>Put all together</h3><p>As mentioned at the beginning, these components form a fairly complete general-purpose processor architecture in a self-consistent manner. By effectively swapping memory (Context) at Test Time and allowing the model to generate new instructions based on this Context, the entire computational architecture gradually becomes more complete.</p><p>Of course, this is just my own conviction in terms of architecture, and it may shed some light on the path to AGI. There is still a significant amount of work to be done in training and inference engineering. Perhaps this is a path for companies like Deepseek to catch up with and eventually surpass OAI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c13fa564522" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discussing RDMA over VPC at Scale]]></title>
            <link>https://medium.com/@nimokaka/discussing-rdma-at-scale-over-vpc-ba22077d1ca1?source=rss-5a0cc9c55eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba22077d1ca1</guid>
            <dc:creator><![CDATA[Zartbot]]></dc:creator>
            <pubDate>Mon, 02 Dec 2024 17:18:18 GMT</pubDate>
            <atom:updated>2024-12-02T17:40:11.508Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, the Mooncake KV-Cache centric disaggregated LLM inference framework has been open-sourced (<a href="https://github.com/kvcache-ai/Mooncake">https://github.com/kvcache-ai/Mooncake</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*LzKv3_c8mFHfEe8REVTupQ.png" /></figure><p>It is a highly efficient Prefill-Decode LLM inference framework, and it supports vLLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*yWtBKfJYgUgq62k133t3Xw.png" /></figure><p>After looking through the README, I was surprised to find that it supports eRDMA(elastic RDMA). Even the demo animation for the performance test was also using eRDMA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vlnrXabApa_Gdt2U.png" /></figure><p>Here are my personal thoughts; all opinions expressed are my own and do not reflect the views of the company I am affiliated with.</p><p>I asked the colleagues involved in eRDMA development, and they all said they hadn’t supported the mooncake team. In fact, a product that can be self-serviced like this is already considered a success.</p><p>eRDMA supports the standard RDMA Verbs RC ecosystem and also addresses the challenges of large-scale networking. Users don’t need to worry about complex PFC/ECN parameter configurations , which builds a self-service RDMA network with the capability for large-scale deployment (this is what truly counts as RDMA at Scale).</p><p>Additionally, it is based on the VPC FrontEnd network, allowing different types of GPUs (H20/L20) and CPU instances to be networked at scale using RDMA, fully meeting the diverse computational needs of various models for different types of compute density requirements.</p><p>Among all CSPs globally, this is unique. AWS SRD is not compatible with the standard RC(Reliable Connection) Verbs ecosystem, and Google’s Falcon has not yet been fully deployed, with many instances still relying on GPUDirect-TCPX for support. Meanwhile, Microsoft is still using a significant amount of InfiniBand deployment.</p><p>In contrast, Alibaba Cloud eRDMA can be freely enabled on the new H-series/L-series GPU instances as well as all 8th generation general-purpose CPU instances, and it has achieved full region and availability zone coverage.</p><p>Beyond GPU instances, eRDMA is also widely deployed in various scenarios online, including HPC, databases, big data, messaging middleware, Redis, and container networking.</p><h3>The challenges of RDMA at Scale</h3><p>For customers, a significant number of private data centers use Nvidia (Mellanox) CX series RDMA network cards, and almost all RDMA ecosystems are built based on standard RDMA Verbs RC semantics.</p><p>Of course, when it is built on commercial Ethernet (RDMA over Converged Ethernet, RoCE), there are numerous issues, such as the lack of support for multipath and out-of-order delivery, poor efficiency of Go-back-N, difficulty in tuning DCQCN, and challenges in achieving large-scale networking. These are the problems that UltraEthernet aims to address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*sxgFm392MGe8Zp7y.png" /></figure><h3>Why is it essential to be compatible with the RDMA Verbs RC ecosystem?</h3><p>Compatibility with the RDMA Verbs RC (Reliable Connection) ecosystem is crucial for several reasons:</p><ol><li><strong>Widespread Adoption and Standardization: </strong>The RDMA Verbs API is a widely adopted standard in the industry, providing a common interface for RDMA-capable network adapters. This standardization ensures that software and hardware from different vendors can interoperate seamlessly.</li><li><strong>Existing Software and Tools: </strong>Many existing applications, libraries, and tools are built on top of the RDMA Verbs API. Compatibility with this ecosystem allows these applications to run without modification, reducing the need for extensive rewrites or custom integrations.</li><li><strong>Developer Familiarity and Ecosystem Support: </strong>Developers are already familiar with the RDMA Verbs API, and there is a large community and support structure around it. This familiarity and support make it easier for developers to adopt and work with new RDMA technologies.</li><li><strong>Performance and Reliability</strong>: The RDMA Verbs RC protocol is designed for high-performance, low-latency, and reliable communication. By being compatible, new solutions can leverage the same performance and reliability benefits, ensuring that they meet the stringent requirements of data center and HPC environments.</li></ol><p>AWS SRD was one of the first CSPs to build RDMA technology in the FrontEnd VPC network. Unfortunately, to address congestion, jitter, multipath, and out-of-order delivery issues in the VPC network, it did not adopt the standard RDMA Verbs RC semantics but instead built a Scalable RD semantics.For GPU interconnect scenarios, it can use a plugin approach built on top of NCCL. However, for a broader ecosystem, especially for some older HPC applications, commercial database applications, and high-performance parallel file systems that have already implemented standard RC semantics, significant adaptation work is required. This necessitates a considerable amount of effort in communication and often incurs high learning costs for customers.</p><p>Therefore, for CSPs, there is a need for a solution that is compatible with the RDMA Verbs RC ecosystem. Such a solution would allow code from on-premises data centers to be deployed in the cloud without any modifications, and it would not require complex DCQCN parameter tuning or consideration of the impact of PFC storms. It should also be capable of ultra-large-scale deployment.</p><p>Alibaba Cloud eRDMA is such a technology. It is supported on the latest H-series and L-series GPUs, as well as all 8th generation general-purpose CPU instances. Built on Alibaba Cloud’s CIPU, eRDMA does not require additional dedicated RDMA network cards, enabling full-region and full-availability zone deployment. Additionally, the SMC-R ecosystem built on top of eRDMA can accelerate TCP Socket communication applications without any code changes.</p><p>In a previous discussion a few months ago titled “Discussing KVCache Acceleration and Memory Pooling for Large Model Inference”, similar issues were addressed. If both CPU and GPU instances can communicate through the FrontEnd VPC, much of the CPU memory can be used as KVCache storage. Additionally, for smaller models, using cheaper CPUs, L20, or A10 for the Decode phase can be a cost-saving measure.</p><h3>The Challenges of RDMA at Scale over VPC</h3><p><em>Why is eRDMA the only RDMA technology in the world that achieves RC compatibility and large-scale deployment in VPC networks?</em></p><p>Deploying RDMA at scale over a Virtual Private Cloud (VPC) presents several significant challenges:</p><p><strong>Congestion and Jitter</strong>: VPC networks can experience congestion and jitter, which can degrade the performance of RDMA. Ensuring consistent and low-latency communication is crucial for RDMA to function effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/0*5oq1b7ABhsYpN4j1.png" /></figure><p><strong>Multipath and Out-of-Order Delivery</strong>: Traditional RDMA implementations often struggle with multipath routing and out-of-order packet delivery, which are common in VPC environments. Handling these issues requires sophisticated network management and protocols.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*eDl0mX6BoboRUTHZ.jpg" /></figure><p><strong>Complex Configuration and Tuning</strong>: Configuring and tuning RDMA parameters, such as DCQCN (Data Center Quantized Congestion Notification) and PFC (Priority Flow Control), can be complex and time-consuming. These configurations need to be carefully managed to avoid issues like PFC storms and ensure optimal performance.</p><p><strong>Scalability</strong>: As the number of nodes and the complexity of the network increase, maintaining high performance and reliability becomes more challenging. Scalable solutions need to handle large-scale deployments efficiently.</p><p><strong>Interoperability with Non-RDMA Traffic</strong>: VPCs often carry a mix of RDMA and non-RDMA traffic. Ensuring that RDMA traffic does not negatively impact other types of traffic and vice versa is a critical consideration.</p><p><strong>Security and Isolation</strong>: Ensuring the security and isolation of RDMA traffic in a shared VPC environment is important. This includes protecting against potential attacks and ensuring that different tenants’ traffic does not interfere with each other.</p><p><strong>Cost and Resource Management</strong>: Efficiently managing resources and costs is crucial, especially in cloud environments where resource usage directly impacts costs. Solutions need to be cost-effective.</p><p>The industry has taken many detours in supporting RDMA over Ethernet in last decade</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*mq3C6HvMycbVDalgA45CQQ.png" /></figure><p>AWS drop the RC Verbs compatibility, use the customized Scalable RD(SRD) solution.</p><p>Google Falcon has further evolved through the Swift congestion control algorithm, but it has not yet been fully deployed. Some H100 instances still rely on GPU-Direct-TCPX, and the utilization of the collective communication fabric can only reach around 60%. Even with the new H100 instances starting to adopt CX7 deployments, it cannot be used for general-purpose computing instances.</p><p>Microsoft continues to use InfiniBand for building HPC and GPU instances.</p><p>Even Nvidia (Mellanox)’s Spectrum-X solution can only enable Adaptive Routing in lossless networks.</p><p><em>How to ensure RDMA RC semantic compatibility while also addressing various sudden traffic congestion and hash polarization that lead to unbalanced loads in VPC networks, without allowing excessive traffic to impact other tenants’ traffic on the same VPC, and achieving over 97% fabric utilization during GPU collective communication, is a very challenging problem.</em></p><h3>Why can eRDMA achieve this?</h3><p>eRDMA leverages the Direct-Data-Placement technology from iWARP in 2002 to achieve out-of-order delivery and ordered completion capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kzIQO2-WNAWQHVMg.png" /></figure><p>This way, the issue of packets arriving out of order after traveling through multiple paths is resolved, thus achieving a 97% fabric utilization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*J6uUHEPgSb2k882E.png" /></figure><p>Recently, Nvidia (Mellanox) can only achieve DDP (Direct Data Placement) capabilities on WRITE operations due to the limitations in the RoCE protocol definition(RETH definition issue).</p><p>On the other hand, for congestion control, eRDMA adopts a fine-grained sliding window control protocol based on RTT (Round-Trip Time), similar to Swift, and supports SACK (Selective Acknowledgment) and other selective retransmission techniques. This approach improves retransmission efficiency and reduces the usage of switch buffers. We can also see that Google Falcon has inherited the congestion control mechanisms from Swift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*ZOP-xfseTPUkDv-U.png" /></figure><p><em>The entire eRDMA solution, whether for congestion control or multipath forwarding, </em><strong><em>does not require assistance from switches </em></strong><em>(features like ECN, PFC, INT, PacketSpray, VOQ, etc., are not needed). This significantly reduces the operational burden and fully enables users to self-service and enable the technology.</em></p><h3>In closing</h3><p>At this year’s Alibaba Cloud Computing Conference, the released CIPU 2.0 supports 400G single-card forwarding capabilities and also enables secure encryption for VPC traffic. This makes RDMA data communication more secure, and GPU server inference efficiency and data access efficiency are significantly improved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lx95-4jKyEPtenPB.png" /></figure><p>In addition to GPU scenarios, eRDMA has already been widely deployed in various other scenarios, including HPC, databases, big data, messaging middleware, and container networking. Such as Redis also provide native RDMA support.</p><p>These modern cloud infrastructures significantly improve the efficiency of cloud usage for users. Moreover, users can use eRDMA without any additional costs.</p><p><em>It is the only RDMA technology in the world that achieves RC compatibility, large-scale deployment in VPC networks, and supports data encryption.</em></p><p>We welcome everyone to use eRDMA. Currently, the H-series and L-series GPUs, as well as all 8th generation general-purpose CPU instances, can enable eRDMA capabilities for free across all regions and availability zones, accelerating your various communication and data transfer efficiencies. Even some of your traditional TCP Socket applications can benefit from high-efficiency, high-quality data transmission services using SMC-R technology based on eRDMA, without requiring any code modifications.</p><p>eRDMA official website: <a href="https://www.alibabacloud.com/help/en/ecs/user-guide/elastic-rdma-erdma/">https://www.alibabacloud.com/help/en/ecs/user-guide/elastic-rdma-erdma/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba22077d1ca1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>