AWS Lambda推理成本超托管模型80倍
作者将基于Qwen3.5-4B微调的H2O-Lightning拆分为5,600次AWS Lambda调用,处理约4,000个token耗时17秒。该次运行折合每百万token成本8.40美元,是文中引用的Google托管Gemini Decision 1价格的80多倍。尽管分布式推理在技术上可行,作者认为CPU横向扩展不适合此类矩阵计算。
这项实验以明确的成本和延迟数据表明,把Transformer推理分散到无服务器CPU函数,可能比使用托管决策模型昂贵得多。
Who needs a GPU?
In my work at Bevyl I was really impressed by the performance and cost characteristics of AWS Lambdas. They can massively distribute and fan out CPU-bound work, which is amazing for things like ffmpeg on long videos.
So I was curious if it was possible to run inference on self-hosted models using Lambdas. It was a random idea built on a hunch, and I like to prove such ideas right or wrong by building. In this case I was very wrong, but it was a good lesson!
I picked H2O-Lightning, a fine-tune of Qwen3.5-4B, because I wanted a small model built for decisions. I figured if this architecture had any legs, only doing decision models (a single forward pass) is the move. A decision model reads a document and answers a question about it by picking one option.
Fanning out
So the trick, if it's possible, would be fanning out. I was inspired how Remotion uses massively parallelized Lambdas to render videos.
#H2O-Lightning#Qwen3.5-4B#AWS Lambda#AWS#Gemini Decision 1#Google#Bevyl