正在加载视频...

视频加载失败

New course on serving LLMs efficiently -- how do you serve models to many concurrent users at low latency and reasonable cost? This short course is built with Red Hat and taught by Cedric Clyburn. Efficient LLM serving requires efficient memory management. A 70B-parameter model takes ~140 GB just...

135,137 次观看 • 3 个月前 •via X (Twitter)

35 条评论

Cedric Clyburn 的头像
Cedric Clyburn3 个月前

Was a pleasure to join you, @AndrewYNg, and I’m super happy to see this launch! If you’re building AI applications and agents, understanding the underlying inference layer is SO important to managing cost, accuracy, and performance ⚡️ we at @RedHat_AI and the @vllm_project community hope you enjoy!

Deva 的头像
Deva3 个月前

@RedHat @cedricclyburn The weights aren't the serving bottleneck. It's KV cache blowing up under concurrent load. Does the course cover quantized KV cache or just PagedAttention style virtual memory? INT8 KV at scale is where the real cost wins are.

Cat 的头像
Cat3 个月前

@RedHat @cedricclyburn It's crazy how much of AI engineering is becoming a systems problem rather than a modeling problem.

Adel Bucetta 的头像
Adel Bucetta3 个月前

@RedHat @cedricclyburn the honest answer is that most lls are still bandwidth bottlenecked, not memory constrained.

Dan Sfera 的头像
Dan Sfera3 个月前

@RedHat @cedricclyburn serving cost is the silent killer of agent products. the demo works, then you run tokens per task on a napkin and the unit economics fall apart

Lena 的头像
Lena3 个月前

@RedHat @cedricclyburn the ugly version of this lesson is that serving cost shows up way before the model looks 'big.' once an agent is carrying memory, tools, and half-finished work at once, every vague step starts billing you twice.

Altiam Kabir 的头像
Altiam Kabir3 个月前

@RedHat @cedricclyburn Insightful: balancing latency, cost, and accuracy.

Zengyi Qin 的头像
Zengyi Qin3 个月前

@RedHat @cedricclyburn finally, a course that explains why my GPU bill looks like a mortgage payment each month.

Daniel Birker 的头像
Daniel Birker3 个月前

@RedHat @cedricclyburn Definitely bookmarking this course - need practical techniques for scaling with lower per-request costs.

Anis🐬Al 的头像
Anis🐬Al3 个月前

أهلاً بك يا أخي أندرو. 🌿 إن هذا الطرح يلمس جوهر التحدي الحقيقي في عصرنا الحالي؛ فالمعركة لم تعد تقتصر فقط على بناء نماذج لغوية أضخم وأذكى، بل انتقلت إلى كيفية جعل هذه العقول العملاقة "حاضرة" ومتاحة وسريعة الاستجابة في نسيج حياتنا اليومية. إن إدارة الذاكرة بكفاءة لخدمة النماذج الضخمة (مثل 70B) هي بمثابة تعليم هذا العملاق كيف يتحرك بخفة ورشاقة دون أن يثقله حجمه. تحقيق التوازن بين زمن الاستجابة المنخفض (Low Latency) والتكلفة المعقولة هو الجسر الذي سيعبر بنا من مرحلة "الإبهار بالقدرات" إلى مرحلة "الاستخدام المستدام" الذي يخدم البشرية على نطاق واسع. خطوة معرفية مباركة ومهمة جداً في هذا المسار التقني. ✨🚀

主任| 美股合约首选Gate 的头像
主任| 美股合约首选Gate3 个月前

@RedHat @cedricclyburn Efficient serving is where most models actually live or die in production.

Fairooz Choudhury 的头像
Fairooz Choudhury3 个月前

@RedHat @cedricclyburn Memory-wise serving is the future of LLM scale.

Gregor 的头像
Gregor3 个月前

@RedHat @cedricclyburn ran a 4-bit 7B locally for pennywise, hit OOM at 2 concurrent users memory not compute

Lunari 的头像
Lunari3 个月前

@RedHat @cedricclyburn vllm's paged attention is really the thing that made concurrent serving practical curious if the course gets into speculative decoding tradeoffs too

ed.haynes_redhat 的头像
ed.haynes_redhat3 个月前

@RedHat @cedricclyburn Divide and conquer baby

E 的头像
E3 个月前

@RedHat @cedricclyburn what's your take on the tradeoff between quantization and latency at scale? every setup I've seen optimizes for one or the other

あいり|海外AIニュースを毎日届ける人 的头像
あいり|海外AIニュースを毎日届ける人3 个月前

@RedHat @cedricclyburn この内容、日本語で詳しく書きました Wrote a detailed take in Japanese:

Hussain Hashim | Building SundayBack 的头像
Hussain Hashim | Building SundayBack3 个月前

@RedHat @cedricclyburn @AndrewYNg sounds cool! curious if it'll cover batch processing vs real-time for LLMs. always a struggle balancing speed and cost.

Sebastian Buzdugan 的头像
Sebastian Buzdugan3 个月前

@RedHat @cedricclyburn serving LLMs is where AI goes from demo to business reality

Shantun Singh Parmar 的头像
Shantun Singh Parmar3 个月前

@RedHat @cedricclyburn Basically: squeeze huge models into GPUs and stop them melting under traffic

Rohit Jain 的头像
Rohit Jain3 个月前

@RedHat @cedricclyburn Thank you!

Pradeep Goel 的头像
Pradeep Goel3 个月前

@RedHat @cedricclyburn Incredible

Maxirex 的头像
Maxirex3 个月前

@RedHat @cedricclyburn I see the same thing almost everywhere

Ramneek Sidhu 的头像
Ramneek Sidhu3 个月前

@RedHat @cedricclyburn LLM serving is the unsexy half of AI that actually determines whether products ship. A 70B model is useless if you cannot serve it affordably to real users at low latency. This course fills a critical gap. 🙌

크롱 的头像
크롱3 个月前

@RedHat @cedricclyburn Thanks for sharing this.

Alex Carter | Money Plays 的头像
Alex Carter | Money Plays3 个月前

@RedHat @cedricclyburn Model quality gets most of the attention, but serving efficiency is where economics actually decide what can scale

Anthara Fairooz 的头像
Anthara Fairooz3 个月前

@RedHat @cedricclyburn Thoughtful blueprint to balance speed and cost.

Prateek Tripathi 的头像
Prateek Tripathi3 个月前

@RedHat @cedricclyburn 70b models can easily crash a 4090

Cyberzk⚡🐸💎 的头像
Cyberzk⚡🐸💎3 个月前

@RedHat @cedricclyburn This is huge! Emergent abilities in large models continue to surprise researchers.

Bowen 的头像
Bowen3 个月前

@RedHat @cedricclyburn LLM serving cost is the part nobody talks about until the bill arrives. good to see a course on this — most people only think about model quality

validate.qa 的头像
validate.qa3 个月前

@RedHat @cedricclyburn memory management always becomes the limiter once you hit concurrent users. kv cache reuse is doing most of the work

Daisy 的头像
Daisy3 个月前

@RedHat @cedricclyburn I'm not saying you're right... but I'm listening 😏👂

Cyberzk⚡🐸💎 的头像
Cyberzk⚡🐸💎3 个月前

@RedHat @cedricclyburn Impressive! Synthetic data generation could solve training bottlenecks.

Ferbin 的头像
Ferbin3 个月前

@RedHat @cedricclyburn the brutal part: batch for cost or speed, not both. hit this hard with trading signals. batching adds 200-300ms latency which can miss the entire move. that's where efficient memory actually makes the difference.

Cyberzk⚡🐸💎 的头像
Cyberzk⚡🐸💎3 个月前

@RedHat @cedricclyburn This proves the point! The pace of AI development is remarkable.

相关视频

New short course: LLMs as Operating Systems: Agent Memory, created with Letta, and taught by its founders Charles Packer and Sarah Wooders. An LLM's input context window has limited space. Using a longer input context also costs more and results in slower processing. So, managing what's stored in this context window is important. In the innovative paper MemGPT: Towards LLMs as Operating Systems, its authors (which include the instructors) proposed using an LLM agent to manage this context window. Their system uses a large persistent memory that stores everything that could be included in the input context, and an agent decides what is actually included. Take the example of building a chatbot that needs to remember what's been said earlier in a conversation (perhaps over many days of interaction with a user). As the conversation's length grows, the memory management agent will move information from the input context to a persistent searchable database; summarize information to keep relevant facts in the input context; and restore relevant conversation elements from further back in time. This allows a chatbot to keep what's currently most relevant in its input context memory to generate the next response. When I read the original MemGPT paper, I thought it was an innovative technique for handling memory for LLMs. The open-source Letta framework, which we'll use in this course, makes MemGPT easy to implement. It adds memory to your LLM agents and gives them transparent long-term memory. In detail, you’ll learn: - How to build an agent that can edit its own limited input context memory, using tools and multi-step reasoning - What is a memory hierarchy (an idea from computer operating systems, which use a cache to speed up memory access), and how these ideas apply to managing the LLM input context (where the input context window is a "cache" storing the most relevant information; and an agent decides what to move in and out of this to/from a larger persistent storage system) - How to implement multi-agent collaboration by letting different agents share blocks of memory This course will give you a sophisticated understanding of memory management for LLMs, which is important for chatbots having long conversations, and for complex agentic workflows. Please sign up here!

Andrew Ng

201,127 次观看 • 1 年前

New short course: Long-Term Agentic Memory with LangGraph. Learn to build an agent with long-term memory in this course developed in collaboration with taught by its Co-Founder and CEO, Harrison Chase! Personal assistance and productivity tasks have become important use cases for agents. An important feature of an AI assistant, such as a coding or calendar assistant, is its ability to keep improving over time from its experience. Agent memory is the key capability that enables this. To add memory to an agent, you must first figure out what to store and what to retrieve when it is time to use the information. Additionally, you’ll have to decide when to update the stored information. For example, you might update in each iteration loop of the agent or perform updates in the background, with a helper agent. In this course, you will learn a mental framework to build agents with long-term memory. You'll create a useful email assistant that can respond, ignore, and notify using writing, scheduling, and memory-management tools. You’ll develop your agent's memory by adding facts to its memory store, provide examples to learn the user's preferences, and optimize system prompts to evolve instructions based on previous responses. In detail, you’ll: - Learn how the three types of memory--semantic, episodic, and procedural–and the two update mechanisms–via hot path and in the background–apply to your agents. - Build an email agent with writing, scheduling, and availability tools, along with a router that triages incoming email and handles it accordingly by ignoring, responding, or notifying the user. - Add tools to your email agent that allow it to operate on semantic memory by learning facts about the user, storing them in a long-term memory store, and searching over them in future interactions. - Incorporate episodic memory, in the form of few-shot examples, in the triage step of your agents to help them learn and update user preferences. - Add procedural memory as system prompts, optimized with feedback to improve the instructions the agent follows. Learn how to approach memory in agents, and start building agents with long-term memory with LangGraph! Please sign up here:

Andrew Ng

132,058 次观看 • 1 年前

researchers gave a tiny local model human-style memory and its context limit basically stopped existing a team from MBZUAI, Princeton and Weizmann took a 1B model and rebuilt how it reads. instead of attending to everything at once, the model reads in 1,024 token chunks and passes the important stuff forward through an associative memory, the same way you carry the plot of a book between chapters without rereading them. the design mirrors human memory on purpose. full attention inside a chunk works as short-term memory. the module that carries information between chunks works as long-term memory. they even trained it like a person, starting with short easy texts and raising the difficulty gradually, because memory thrown into the deep end learns nothing. the numbers back it up. the normal model burns 40GB of GPU memory on a long document and collapses hard past its limit, dropping from 0.86 to 0.32 accuracy. the memory version holds 0.71 at double that length while using a flat 12GB no matter how long the input gets. it also needs about 30% fewer FLOPs. the part i keep thinking about is that nobody scaled anything here. they didn't build a bigger model, didn't stretch the window, didn't add compute. they looked at how a brain handles a long day and copied the architecture. a model small enough to run on a consumer gpu now survives documents its own architecture used to choke on. we keep treating intelligence as a compute problem. sometimes it's a memory problem.

Alex Veremeyenko

16,147 次观看 • 2 个月前

A tricky LLM interview question: You're serving a reasoning model on vLLM, and it keeps running out of GPU memory on long traces. So you add KV cache compression and evict 90% of the cached tokens. VRAM usage stays as is and GPU still runs out of memory. Why? (answer below) Evicting 90% of the KV cache can free almost none of the memory it was using. This sounds counterintuitive, but it follows directly from how production servers store the cache today. The KV cache grows with every token a model generates. Each token appends its key and value vectors across every layer, and nothing is freed while generation continues. This is the dominant memory cost for reasoning models. If a 32K-token CoT caches ~32K tokens of KV vectors, a Qwen3-32B with 4-bit weights will run out-of-memory around 24K tokens on a 24GB GPU. One obvious solution is to keep the important tokens and drop the rest, since attention is sparse enough to allow it. But this does not solve the memory problem yet. The reason is paged attention, which is the memory manager behind vLLM and most production servers. Under the hood, it splits GPU memory into fixed physical blocks, each one holds the KV for about 16 tokens. This block returns to the allocator only when every slot inside it is empty. Since the eviction logic selects tokens by importance, and such tokens are scattered across blocks... ...so despite eviction, almost every block is left with at least some survivor tokens. For instance, if the logic evicts 14k of 16k tokens across 1,000 blocks, most likely every block will still have a token. This means the allocator frees almost nothing. Placing the new tokens into those freed slots is not ideal because it breaks the cache's layout. Say token 16,001 arrives, and it's placed in the slot the 40th token used to hold. The cache now reads position 38, then 16,001, then 41, so the cache is no longer in token order. Attention can still compute the right answer from that, but only if every slot now carries a separate note recording which position it actually holds. This introduces another bookkeeping cost that an in-order layout inherently avoids. So the cache is logically 90% smaller and still physically the same size. Many compression results miss this because they measure on pre-allocated contiguous tensors rather than a paged server. There's another problem. Eviction methods pick which tokens to keep by looking at the attention scores themselves (as expected). But fast attention kernels used in production, like FlashAttention, never save those scores. They compute attention in small pieces and throw the full score grid away as they go, which is also why they're fast. So the exact signal eviction methods need isn't available in memory. The workaround is to fall back to eager attention and build the full matrix, which gives up the speed FlashAttention was there to provide. NVIDIA published a method called TriAttention to solve both these problems. It never needs attention scores. Instead, it scores tokens from the geometry of the model's key and query vectors before RoPE is applied, where those vectors sit in stable clusters. For the memory problem, it runs a compaction pass every 128 decoded tokens. The surviving tokens slide forward to close the holes eviction creates, so whole blocks empty out and return to the allocator while the cache stays in token order. On long reasoning traces, the approach matches full-attention accuracy while decoding 2.5x faster and using 10.7x less KV memory. KV cache compression is a big infrastructure problem. The number that decides whether it works is the count of freed blocks, not the count of evicted tokens. You can find the NVIDIA write-up here: I wrote a first-principles breakdown of how the KV cache works. It walks through why the model stores keys and values at all, why the cache grows with every token, and a comparison of LLM generation speed with and without KV caching. Read it below.

Avi Chawla

273,409 次观看 • 2 个月前

OpenAI just announced API access to o1 (advanced reasoning model) yesterday. I'm delighted to announce today a new short course, Reasoning with o1, built with OpenAI, and taught by Colin Jarvis, Head of AI Solutions at OpenAI, to show you how to use this effectively! Unlike previous language models which generate output directly, o1 “thinks before it responds,” and generates many reasoning tokens before returning a more thoughtful and accurate response. It is great at complex reasoning -- including planning for agentic workflows, coding, and domain-specific reasoning in STEM fields like law. But how you should use it is quite different from other LLMs. I think o1 will be a game changer for many AI applications; and in this course, you'll learn how to use it effectively. In detail, you’ll: - Learn to recognize what tasks o1 is suited for, and when to use a smaller model, or combine o1 with a smaller model - Understand the new principles of prompting reasoning models: Be simple and direct; no explicit chain-of-thought required; use structure; show rather than tell - Implement multi-step orchestration in which o1 plans, and hands tasks over to gpt-4o-mini to execute specific steps; this illustrates a design pattern to optimize intelligence (accuracy) and cost - Use o1 for a coding task to build a new application, edit existing code, and test performance by running a coding competition between o1-mini and GPT 4o - Use o1 for image understanding and learn how it performs better with a "hierarchy of reasoning," in which it incurs the latency and cost upfront, preprocessing the image and indexing it with rich details so it can be used for Q&A later - Learn a technique called meta-prompting, in which you use o1 to improve your prompts. Using a customer support evaluation set, you'll iteratively use o1 to modify a prompt to improve performance You'll also learn about how OpenAI used reinforcement learning to produce a model that uses "test-time compute" to improve performance. I think you'll find this course enjoyable and valuable. Please sign up for it here:

Andrew Ng

358,190 次观看 • 1 年前

Qwen3.8-Flash-Next is still going strong at 364.7K tokens of context on an M5 Max. And this isn’t just a static long-context test. The model was reasoning about how to speed up its own workflow while using tools, and the tool calls kept working without misses. Setup: • Qwen3.8-Flash-Next • M5 Max • 128GB unified memory • MLX-Serve PR #363 • OpenCode 2 • 364.7K context The interesting part isn’t simply getting hundreds of thousands of tokens into memory. It’s what happens once the context gets this large. Long-context inference usually comes with a painful tradeoff. As the KV cache grows, memory pressure increases and generation can slow down. But this setup is still pushing through 364K tokens while maintaining a usable agent workflow. The model can reason, call tools, inspect results, continue working, and keep the session moving. And the tool calls reportedly haven’t missed so far. That’s important for agentic coding. A huge context window is only useful if the model can actually operate reliably inside it. A 400K-token context that constantly breaks tool calls isn’t very useful. A 364K session that can keep reasoning and executing tools is a different story. And the test isn’t finished yet. The current run is approaching 400K tokens, with the expectation that it can keep going. This is also another interesting example of why Apple Silicon keeps showing up in local LLM experiments. The M5 Max’s unified memory gives a large model and its growing KV cache access to one shared memory pool. With MLX-Serve continuing to improve, these machines are becoming surprisingly capable long-context inference boxes. The bigger takeaway: Context length is becoming a workload, not just a model specification. Running a model at 256K is one thing. Keeping an agent alive at 300K+ while it reasons and uses tools is much more interesting. And Qwen3.8-Flash-Next is showing that this can be pushed surprisingly far on a single 128GB Mac. 364.7K and counting. Next stop: 400K.

FHILY👑

39,982 次观看 • 16 天前