milo retweeted
My CS degree never covered GPU programming.
I wish someone had handed me these 4 free CUDA resources on day one 👇
1./ NVIDIA - Modern CUDA C++
Learn GPU programming directly from NVIDIA. Video lectures, slides, and coding notebooks covering parallel algorithms, CUDA streams, and writing your own kernels.
github.com/NVIDIA/accelerate…
2./ freeCodeCamp - CUDA Programming
12 hours with Elliot Arledge. Starts with setup and a C/C++ review, then moves into kernels, memory management, matrix multiplication, and custom PyTorch operations.
freecodecamp.org/news/learn-…
3./ University of Illinois - Applied Parallel Programming
Understand CUDA’s execution and memory models, then work through tiling, reductions, scans, and convolution.
lumetta.web.engr.illinois.ed…
4./ University of Oxford - CUDA Programming on NVIDIA GPUs
Free lecture slides and practical exercises from Mike Giles and Wes Armour. Covers memory, synchronization, libraries, and programming across multiple GPUs.
people.maths.ox.ac.uk/~giles…
milo retweeted
this one page turns Obsidian + Opus 5.5 + Jev into a second brain that thinks with you around the clock
built on Karpathy's ideas
Jev reads every note before Opus does
Opus writes only what matters
your vault keeps working while you don't
cuts 80% off your weekly chat time
frees you up for the work your manager actually pays for
the people who set this up early
are the ones the next raise finds first
el ingeniero que construyó Claude Code acaba de publicar un video de 28 minutos sobre cómo escribir prompts que realmente funcionan
he visto cursos de 300$ que no cubren lo que él muestra en los primeros 10 minutos
archivos CLAUDE.md, atajos de memoria, sesiones paralelas, patrones de prompting
todo en un video y completamente gratis
funciona seas desarrollador, principiante o alguien que lleva meses usando Claude
连 JEV 的联合创始人 @CompleteSkeptic 都亲自下场转发点赞:这是 JEV 正确的打开方式!
大家在 Claude Code 里写长代码,最恶心的就是上下文一满,系统就卡住 10 秒去写总结小作文
开发者 @tamarajtran 刚刚开源了这个插件:利用 JEV 的打分能力,几十毫秒内精准识别并清空所有没用的终端垃圾与冗余日志
Github:github.com/tamaratran/fast-j…
它的作用是:
• 彻底治好 Agent 失忆症:几千行终端废话和文件内容让 JEV 毫秒级打分,没用的直接扔,核心代码与状态 100% 原样保留
• 彻底消灭卡顿与账单:几十毫秒无感完成瘦身,不花一分钱废话 Token
@typesafeai 的联合创始人 Diogo Almeida 也公开实名认可:这就是编码 Agent 绕过传统 KV 缓存的最佳解法🧐
found the perfect use case for @typesafeai Jev:
instant compaction
in 2026, why is compaction still a summarization prompt?
Jev can make it instant by scoring every tool call and dropping what’s irrelevant
milo retweeted
Jev 관련 TypeSafeAi 공식 유즈케이스 모음
오피셜이 역시 좋을수 있겠다👍
docs.typesafe.ai/concepts/us…
milo retweeted
Jev 관련 실용적 유즈케이스 모아놓는 깃!!
이런건 뒤도 안보고 북마크🔖
진짜 아직도 제대로 와닿지가 않네…ㄷㄷ
やぁ!兄弟たち!
Jevに関するGitHubの実用性と発展性がありそうなリポジトリをまとめたよ!
やはり、高速判断を要するComputerUseや完全自動トレードなんかに対しての活用が多い印象だね!
Jevは公式のウェイトリストも1日ほどで承認されるけど、待たなくてもVercel AI GatewayからModel: typesafe-ai/jevで直接呼び出せるってさ!
このGrok翻訳っぽい文章はわざわざタイピングしてるゾ!
1. browser-use/jev-ultrafast
Jevがブラウザ自動操作と対象要素を選び、文字入力時のみ小型LLMを使うブラウザエージェント。
github.com/browser-use/jev-u…
2. TheoLeeCJ/openjev
TypeSafe公式の非公開モデルを再現したものではなく、オープンモデルで同じ入出力パターンを試す独立プロジェクト。ローカルGPUで動かせます。
github.com/TheoLeeCJ/openjev
3. vinnylarouge/jevlike
変化するテキスト候補から1つを選ぶJev-likeモデルを、自前データで学習する独立プロジェクト。TypeSafe公式モデルではありません。※使い物にはならないが面白い試み
github.com/vinnylarouge/jevl…
4. jarrodwatts/jev-trader
Monad上のKuru MON-USDCを対象に、Jevで売買判断を行うトレードbot。デフォルトはdry-run/mock動作で、収益性を証明・保証するものではありません。
github.com/jarrodwatts/jev-t…
5. Anil-matcha/awesome-jev-by-typesafe
TypeSafe Jevの使い方、パターン、プロンプト、スターターコード、事例などを集めたコミュニティのまとめ。
github.com/Anil-matcha/aweso…
6. awlevin/typesafe-computer-use
画面をOCRで読み取り、次のクリック操作をTypeSafe/Jevで選ぶMac向けのcomputer-use実装。
github.com/awlevin/typesafe-…
7. devagrawal09/jev-review
Git diffやコードベースを段階的に検査し、正確性・安全性・信頼性・互換性・テストリスクを構造化して表示するコードレビューworkflow。
github.com/devagrawal09/jev-…
8. gargpratyush/jev-router
Claude CodeやOpenAI Codexのターンごとに、簡単な作業を速いモデル、難しい作業を強いモデルへ振り分けるルーター。
github.com/gargpratyush/jev-…
9. vlad-terin/jev-browser
既存のブラウザ自動操作ツールにJevを組み込み、連続的な観測・操作・検証ループで対象要素を選ぶ非公式runtime/skill。
github.com/vlad-terin/jev-br…
10. droidrun/mobile-jev
実機のAndroid端末をJevで操作するモバイルエージェント。ライブ操作デモ、CLI、実行トレースを含みます。
github.com/droidrun/mobile-j…
milo retweeted
"DiffusionGemma as Jev" showcases the power of non-autoregressive architectures.
While Jev demonstrates the value of rapid decision models, running DiffusionGemma in this paradigm leverages canvas diffusion to evaluate structured choices in a single parallel pass:
⚡ ️Massive Parallelism: Denoises across an open canvas in a single step instead of sequential autoregressive token generation (~0.2s on a DGX spark).
🧠 Full Bidirectional Attention: Allows every option to attend to the full context concurrently, yielding well-calibrated decision distributions.
👁️ Multimodal Grounding: Inherits Gemma 4's spatial vision capabilities for complex visual and text decisions.
Read more about this approach here:
github.com/vllm-project/vllm…
nitter.gq/mmastrac/status/210037…
nitter.gq/mmastrac/status/210062…
milo retweeted
分享一份最近收集的 AI Infra 入门阅读清单,建议收藏,慢慢看
AI 已经可以生成很多很好的内容,解释概念、翻译论文、整理资料,都越来越方便。但在这个时代,能静下心来,把一篇好文章认真读完,把没懂的地方再琢磨一遍,我觉得更加难能可贵
这次整理的材料,主要集中在大模型推理这一块。从 KV Cache、显存管理,到请求调度、推理加速,再到怎么判断性能有没有真正变好
做工程的朋友,可以顺着往源码和实验里走。平时看 AI 产业、算力和存储的朋友,也可以先把原理读明白
读文章,挑值得反复读的。
1. 如果只选一篇,我会选 Inside vLLM。
Inside vLLM: Anatomy of a High-Throughput LLM Inference System,作者 Aleksa Gordić
aleksagordic.com/blog/vllm
把很多零散的概念串进了一个真实系统:一个请求进来,怎么排队,怎么分配 KV Cache,怎么执行,最后又怎么把结果送回来
PagedAttention、continuous batching、chunked prefill、prefix caching、投机解码、P/D 分离、多卡和性能测试,都能在这条线上找到位置。
这篇适合当主线,后面的材料用来补不懂的地方
2. 想弄懂 continuous batching,先看 Anyscale 这篇。
Continuous Batching 博客
anyscale.com/blog/continuous…
llm用户的回答有长有短,有的已经生成完了,有的还在继续。已经空出来的位置,能不能马上接下一个请求?
这篇用静态批处理和连续批处理的对比图,把这个问题讲得很直观。看完你会理解,GPU 的效率,也取决于请求怎么安排
建议重点看图和机制
3. NVIDIA 的两篇,一篇帮你建立全貌,一篇教你怎么看性能。
Mastering LLM Techniques: Inference Optimization
developer.nvidia.com/blog/ma…
适合先建立基本认识:处理输入的 prefill 和逐步生成输出的 decode 有什么区别,模型权重和 KV Cache 分别占什么空间,量化、批处理、多卡并行又各自解决什么问题
LLM Inference Benchmarking: Fundamental Concepts
developer.nvidia.com/blog/ll…
这一篇我也很推荐。用户等多久才看到第一个 token,后面生成得快不快,整个系统一秒能服务多少请求,是不同的问题。TTFT、ITL、TPOT 这些指标,要连着测试口径一起看
4. 想再往下算一层,读 kipply 的 Transformer Inference Arithmetic
Transformer Inference Arithmetic
这是一篇 2022 年的文章。它带你从计算量、内存容量、带宽和通信开销出发,估算推理为什么快、为什么慢,以及 batch size 改变后会发生什么
硬件和模型的具体例子有年代了, 作为 optional 选读
milo retweeted
Why KV cache stores K and V vectors but never Q?
(a popular technical LLM interview question)
LLMs are autoregressive so each token is predicted from every token before it, one at a time.
This autoregressive nature has a direct consequence inside the model.
A forward pass over <n> tokens produces <n> hidden states, but only the last one is projected to logits and is required to generate the next token.
So to understand why KV cache just stores K and V vector, we must back track to see how exactly is the last hidden state produced.
Let's walk through this with a 10-token prompt.
1) Prefill:
All 10 tokens go through the model in one forward pass, in parallel (with causal masking), since the whole prompt is already known.
At every layer, each of the 10 positions produces a query, a key and a value vector, and attention at each position runs against all positions up to it.
This pass is compute-heavy, and it's why the first token takes noticeably longer than the ones after it. TTFT is mostly prefill.
2) The first output token:
To generate the 11th token, only the 10th token's hidden state is needed. So this is projected from the hidden-dim to vocab-dim to generate logits over vocab.
These logits then go through softmax and sampling to generate token 11.
3) Back-track the hidden state:
The last hidden state is the last row of the feedforward block's output. The feedforward block is position-wise (it's applied to each row independently) so that row comes from the last row of the attention output before it.
So now we need to see how the last row of attention is computed.
4) Attention matrix:
QKᵀ for a 10-token prompt will give a 10 × 10 matrix.
Row <i> will have the dot product of query <i> with every key.
Row 10 is therefore Q₁₀·K₁, Q₁₀·K₂, all the way to Q₁₀·K₁₀.
Notice that only Q₁₀ appears in it. Q₁ through Q₉ only belong to their corresponding rows 1-9, and those rows' hidden states we already discarded because they were never needed.
The last row of attention goes through softmax and multiplies the full stack of value vectors, V₁ through V₁₀, to give the last row of the attention output.
So the last hidden state depends on exactly three things: Q₁₀, every key, and every value.
5) Generating token 12:
Token 11 is appended, and this time, we need row 11's hidden state to generate token 12.
Mathematically, attention operation turns out to be Q₁₁ against K₁ through K₁₁, then multiplied by V₁ through V₁₁.
K₁ through K₁₁ and V₁ through V₁₁ are bit-for-bit what prefill + first token produced since under causal masking, a token's key and value depend on that token and the ones before it, never on anything after, so appending token 11 cannot change anything at position 3.
6) The cache state:
Overall, this implies that you just need to retain the keys and values at each decoding step, and compute only the new position's Q, K and V.
Each decode step requires one query vector, which is never used again, so they are never cached across the decoding process.
The visual below explains the entire process.
That said, KV cache is only one of four separate caching layers in an LLM stack.
The other three are prefix caching on the server, prompt caching billed by a provider, and a semantic cache that skips the model entirely.
I wrote a full breakdown of all four caches in LLM serving that you should know as an AI engineer, with code for each.
Read it below.
milo retweeted
study notes on speculative decoding
leoniemonigatti.com/blog/spe…
milo retweeted
I have been fine-tuning LLMs for over 2 years now!
Here are the top 12 techniques I'd learn if I were to fine-tune them:
Bookmark this.
1. LoRA
> Freezes the base weights and trains two low-rank matrices as the update, resulting in ~95-99% fewer params to fine-tune.
2. QLoRA
> LoRA on top of a 4-bit quantized base model.
3. Prefix tuning
> Prepends trainable vectors to keys and values at every layer, weights frozen.
4. Adapter tuning
> Inserts small trainable modules between transformer layers.
5. Instruction tuning
> Supervised tuning on (instruction, response) pairs so the model follows directions instead of just continuing text.
6. P-tuning
> Optimizes continuous prompt embeddings through a small encoder, mainly for NLU tasks where discrete prompts are unstable.
7. BitFit
> Trains only the bias terms, ~0.08% of params, and still rivals full fine-tuning on small-to-medium datasets.
8. RLHF/RLAIF
> RLHF trains a reward model on human preference rankings, then PPO against it. The pipeline behind the first ChatGPT.
> RLAIF swaps the human labeler for an LLM judging. RLHF-level quality at a fraction of the cost.
9. DPO (Direct Preference Optimization)
> Skips the reward model and optimizes preference pairs directly with a classification-style loss. Simpler than PPO.
10. GRPO (Group Relative Policy Optimization)
> Samples a group of responses per prompt and normalizes their rewards within the group. DeepSeek R1 ran on it.
11. RLVR (Reinforcement Learning with Verifiable Rewards)
> Replaces the learned reward model with a checker or compiler returning verifiable scores. The free signal behind R1's math and code.
12. Federated fine-tuning
> Tunes across decentralized clients that share only weight updates, never raw data. For when data can't leave the device.
GRPO needs exactly one scalar reward per response. RLVR (13) produces that for free on math and code by running the answer through a checker or compiler.
But tasks like a RAG answer, a support reply, or a summary have no gold label to match against.
The usual fallback is a hand-written reward function scoring faithfulness, hallucination, and completeness.
It takes days to calibrate, rewards the wrong behavior when the weights are off, and breaks every time you add a tool or edit the system prompt.
RULER, implemented in OpenPipe's ART (open-source), solves this.
During training, it passes the N sampled trajectories to a judge LLM, which ranks them relative to each other against the agent's system prompt and returns the scores.
Relative ranking is more stable than absolute scoring, and GRPO normalizes within the group anyway, so the rankings feed straight into the pipeline like with RLVR.
Here's the GitHub Repo: github.com/OpenPipe/ART
(don't forget to star it ⭐ )
I wrote a full breakdown recently on how exactly this works, with the training loop and code.
Read it below.
milo retweeted
vLLM's model loader and KV connector both have an @Azure Blob path now: weights in, KV out. @Microsoft and @NVIDIAAI shipped a recipe for each.
Nothing serves until weights land in HBM. Dynamo ModelExpress plugs into the loader, up to 7.3x faster than the default on H100/A100.
milo retweeted
NVIDIA researchers did it again!
They found a way to make KV cache transferable between models.
The target model skips prefill entirely, and the conversion runs 2.7 to 25x faster than processing the context again.
Let's understand why this is so important today.
LLM APIs are stateless, so every turn sends the entire conversation back to the model. The model reads all of it again before writing a single new token, and all of it is billed as input.
Prompt caching allows Anthropic and other providers to hold the KV cache for a stable prefix and bill a hit at roughly 10% of the base input rate, because the compute was already done once.
The 90% reduction is one of the largest lever in LLM serving, which is why so much production work goes into keeping prefixes byte-stable.
But the cache only works on the model that produced it. Keys and values are produced from that model's weights, so no other model can read them.
In pratice, the constraint shows up in LLM routing. If the traffic is shifted to a different model for cost/capability reasons, the accumulated KV cache becomes invalid.
As a result, the accumulated context has to be processed from scratch, and it's billed at full rate.
NVIDIA's recent paper treats this as a representation problem.
Prefill's only output is the KV cache, so to move KV between models, we need to convert one model's cache into the format the other expects.
They first checked whether the conversion has any structure worth exploiting.
They found that moving from Qwen3 14B to 32B, a plain linear regression from a single source layer reconstructed 56% of the variance in the target model's keys.
The two models obviously may have different layer counts, so there is no natural one-to-one pairing between them.
For each target layer they rank every source layer by how well it predicts that layer, then feed the top eight in together, which takes the reconstruction to 79%.
The mapper itself has three parts:
> Each target layer and head gets its own independent linear map, solved in one closed-form step rather than by gradient descent.
> The cross-layer selection described above is the second part, and their ablation shows it carries the most weight of the three.
> Keys also carry a position-dependent rotation from RoPE. They strip that rotation, fit the map in position-free space, then re-apply the target model's rotation at inference.
Across six pairs from Qwen3, Llama 3.1 and Ministral 3, four retain 73 to 98% of the receiving model's standalone accuracy, and the conversion runs 3-25x faster than processing the context again.
Prior work on cross-model KV reuse exists, but it either trains a neural adapter per pair or requires both models to be architecturally identical.
This is probably the first version that is closed-form and training-free, so a lot of it is still open research.
Every pair tested belongs to one family, so it works on Qwen to Qwen and Llama to Llama.
Cross-family transfer is listed as future work.
All six pairs mentioned above also happen to share KV head count and per-head dimension across scales. Mismatched head configurations are currently untested.
The researchers scoped this to dense full-attention only, so sliding-window and attention-recurrent hybrids still need work.
Here's the paper: arxiv.org/abs/2608.03893
Plenty of work is yet to be done. Still, the constraint being solved is genuine.
Every model swap currently invalidates the full KV that was already paid for, and this is the first result showing that work might be recoverable without training anything extra.
That said, all of this only matters because of what the KV cache is doing in the first place.
I wrote a first-principles breakdown of it, covering why the model stores keys and values at all, why the cache grows with every token, and what generation speed looks like with and without it.
Read it below.
milo retweeted
Kimi and GLM are some of the best open models available. They're also some of the hardest to serve efficiently. Check out this writeup to learn how we're making them faster and cheaper without losing accuracy.
blog.cloudflare.com/smaller-…
milo retweeted
Training high-quality speculators has become essential for production-grade inference. It’s exciting to see the ecosystem flourishing—and to have @vllm_project be part of it!
🚀 We’ve open-sourced AngelSpec, an end-to-end speculative decoding framework supporting both training and deployment.
On Hy3-A21B, DFly delivers a 1.98–2.40× end-to-end speedup over autoregressive decoding across tested concurrency levels from 4 to 64, with 10.5–11.8% higher throughput than DFlash.
Training code and Hy3-A21B MTP/DFly drafter weights are now available:
GitHub: github.com/Tencent/AngelSpec
Paper: arxiv.org/abs/2607.25852
Docs: angelspec.readthedocs.io
Hugging Face: huggingface.co/collections/A…
ModelScope: modelscope.cn/collections/An…
#Hy3 #AngelSpec #OpenSource








































