写给 8 月的技术投资建议:AI 编译、推理优化与 Rust 生态的优先事项判断
写给 8 月的技术投资建议AI 编译、推理优化与 Rust 生态的优先事项判断一、技术投资的最大陷阱把需要关注和需要投入混为一谈7 月读了 47 篇论文关注了 12 个开源项目的更新参与了 5 个技术讨论。但真正投入工程资源去验证和应用的只有 3 个方向。其他的——有价值有前景但不需要我现在投入。技术投资的本质是资源分配。你的时间、团队的精力、GPU 的预算——这些都是有限资源。每月 40 篇论文中真正需要立即投入的不会超过 5 篇。其余的是知识储备——知道它存在知道它的适用场景但当前不动手。本文基于 7 月的技术动态和 8 月的建设规划提出三个层面的优先事项判断立即投入、观察评估、知识储备。每项附带判断依据、预期收益和投入成本。二、8 月技术投资决策矩阵三、实践三个优先级的详细投资方案// // P0 投资 1: vLLM Prefix Caching 实施 // /// Prefix Caching 决策检查清单 /// 设计原因不是所有场景都适合开启 Prefix Caching /// 条件是系统提示长度 500 token 且重复率 50% struct PrefixCacheDecision { /// 你的系统提示平均长度 avg_system_prompt_tokens: usize, /// 系统提示的重复率相同前缀的请求占比 prompt_repeat_rate: f64, /// 是否需要系统提示 500 AND 重复率 0.5 should_enable: bool, /// 预估显存开销GB estimated_vram_cost_gb: f64, } fn evaluate_prefix_cache(config: PrefixCacheDecision) - InvestmentDecision { if !config.should_enable { return InvestmentDecision::Skip { reason: 系统提示过短或重复率太低Prefix Caching 收益 成本.into(), }; } // 实施步骤 // 1. vLLM 启动参数添加: --enable-prefix-caching // 2. 设置 --max-model-len 8192 (匹配实际最长 prompt) // 3. 监控指标: vllm:gpu_cache_usage_perc (不要超过 80%) // 4. 监控指标: vllm:prefix_cache_hit_rate (目标 0.3) // 5. 如果是首次使用建议在 staging 环境运行 48 小时观察 InvestmentDecision::Invest { priority: Priority::P0, expected_benefit: format!( 首 token 延迟降低约 {}% (基于重复率 {:.0}%), (config.prompt_repeat_rate * 65.0) as u32, config.prompt_repeat_rate * 100.0 ), implementation_cost: CostEstimate { developer_days: 1, gpu_testing_hours: 48, risk_level: RiskLevel::Low, }, } } // // P1 评估: SGLang RadixAttention 的迁移决策 // /// 评估是否从 vLLM 迁移到 SGLang struct MigrationDecision { /// 多轮对话请求占比 — SGLang 的最大优势场景 multi_turn_ratio: f64, /// 系统提示平均 Token 数 avg_system_prompt_tokens: usize, /// 现有的 vLLM 定制化程度 vllm_customization: CustomizationLevel, } enum CustomizationLevel { Vanilla, // 原版无定制 → 迁移成本低 SomePatches, // 少量 patch → 需要迁移验证 HeavilyCustom, // 重度定制 → 迁移成本可能不划算 } struct CostEstimate { developer_days: u32, gpu_testing_hours: u32, risk_level: RiskLevel, } enum RiskLevel { Low, Medium, High, } enum Priority { P0, P1, P2, } struct InvestmentDecision { // 实际字段在各 match 分支中定义 } impl InvestmentDecision { fn Invest { priority: Priority, expected_benefit: String, implementation_cost: CostEstimate } - Self { todo!() } fn Skip { reason: String } - Self { todo!() } } fn evaluate_sglang_migration(config: MigrationDecision) - InvestmentDecision { // 决策矩阵 // multi_turn_ratio 0.3 AND customization Vanilla → 考虑迁移 // multi_turn_ratio 0.1 → 不迁移单轮请求的 Prefix Caching 收益与 vLLM 相似 // customization HeavilyCustom → 迁移风险高等待社区统一 API 标准 if config.multi_turn_ratio 0.1 { return InvestmentDecision::Skip { reason: 单轮请求为主vLLM Prefix Caching 足够.into(), }; } if matches!(config.vllm_customization, CustomizationLevel::HeavilyCustom) { return InvestmentDecision::Skip { reason: vLLM 重度定制迁移成本 收益。等待 SGLang/vLLM 社区统一 API.into(), }; } InvestmentDecision::Invest { priority: Priority::P1, expected_benefit: format!( 多轮对话场景吞吐量预计提升 {:.0}%, config.multi_turn_ratio * 30.0 ), implementation_cost: CostEstimate { developer_days: 5, gpu_testing_hours: 72, risk_level: RiskLevel::Medium, }, } } // // 投资决策框架 — 对所有技术方向的一致性评估 // /// 技术投资统一评估模型 struct TechInvestment { /// 技术方向名称 name: String, /// 优先级 priority: Priority, /// 预期收益描述 expected_benefit: String, /// 投入成本 cost: CostEstimate, /// 投资决策 decision: TechDecision, } #[derive(Debug, PartialEq)] enum TechDecision { Invest, // 立即投入 Watch, // 观察评估 Skip, // 暂不投入 } impl TechInvestment { fn summarize(self) - String { format!( [{}] {}: {} — {} — {:.1}人天, match self.priority { Priority::P0 P0·立即投入, Priority::P1 P1·观察评估, Priority::P2 P2·知识储备, }, self.name, self.expected_benefit, match self.decision { TechDecision::Invest 建议立即开始, TechDecision::Watch 建议8-10月观察, TechDecision::Skip 建议暂不投入半年后评估, }, self.cost.developer_days as f64, ) } } /// 8 月技术投资全貌 fn august_investment_summary() - VecTechInvestment { vec![ // P0: 立即投入 (3 项) TechInvestment { name: vLLM Prefix Caching.into(), priority: Priority::P0, expected_benefit: 首Token延迟降低30-65%.into(), cost: CostEstimate { developer_days: 1, gpu_testing_hours: 48, risk_level: RiskLevel::Low }, decision: TechDecision::Invest, }, TechInvestment { name: GPU 弹性伸缩 MVP.into(), priority: Priority::P0, expected_benefit: 月度GPU成本降低30-40%.into(), cost: CostEstimate { developer_days: 8, gpu_testing_hours: 0, risk_level: RiskLevel::Medium }, decision: TechDecision::Invest, }, TechInvestment { name: Token级可观测性.into(), priority: Priority::P0, expected_benefit: P99抖动根因定位5分钟.into(), cost: CostEstimate { developer_days: 3, gpu_testing_hours: 0, risk_level: RiskLevel::Low }, decision: TechDecision::Invest, }, // P1: 观察评估 (3 项) TechInvestment { name: SGLang RadixAttention.into(), priority: Priority::P1, expected_benefit: 多轮对话吞吐量15-30%.into(), cost: CostEstimate { developer_days: 5, gpu_testing_hours: 72, risk_level: RiskLevel::Medium }, decision: TechDecision::Watch, }, TechInvestment { name: 推测解码 EAGLE-2.into(), priority: Priority::P1, expected_benefit: 批处理总吞吐量2.5-3.5x.into(), cost: CostEstimate { developer_days: 10, gpu_testing_hours: 96, risk_level: RiskLevel::Medium }, decision: TechDecision::Watch, }, TechInvestment { name: 异构GPU调度方案.into(), priority: Priority::P1, expected_benefit: 异构集群利用率20%.into(), cost: CostEstimate { developer_days: 15, gpu_testing_hours: 120, risk_level: RiskLevel::High }, decision: TechDecision::Watch, }, // P2: 知识储备 (2 项) TechInvestment { name: BitDelta 1-bit压缩.into(), priority: Priority::P2, expected_benefit: 模型切换成本降低10x.into(), cost: CostEstimate { developer_days: 0, gpu_testing_hours: 0, risk_level: RiskLevel::High }, decision: TechDecision::Skip, }, TechInvestment { name: 自定义异步Runtime.into(), priority: Priority::P2, expected_benefit: 理论收益实际场景极少需要.into(), cost: CostEstimate { developer_days: 30, gpu_testing_hours: 0, risk_level: RiskLevel::High }, decision: TechDecision::Skip, }, ] } /// 投资总结报告 fn print_summary() { let investments august_investment_summary(); let p0_total_days: u32 investments.iter() .filter(|i| matches!(i.priority, Priority::P0) i.decision TechDecision::Invest) .map(|i| i.cost.developer_days) .sum(); eprintln!( 8 月技术投资总结 ); eprintln!(P0 立即投入: 3 项预计人力 {} 人天, p0_total_days); eprintln!(P1 观察评估: 3 项); eprintln!(P2 知识储备: 2 项); eprintln!(); for inv in investments { eprintln!({}, inv.summarize()); } } fn main() { print_summary(); }P0 三项投入的逻辑关系vLLM Prefix Caching1 人天投入产出比最高的单项优化。如果你的系统提示 500 token几乎零风险收益立竿见影。唯一的注意事项是显存开销——确保 GPU 显存利用率不要超过 90%。GPU 弹性伸缩8 人天当前 GPU 月度账单的 30-40% 是浪费的低谷期闲置。这项投入在 1-2 个月内回本。但需要注意缩容冷却时间——频繁扩缩容会导致请求排队。建议设置 30 分钟的冷却期。Token 级可观测性3 人天这是所有性能优化的前提。没有 TTFTTime To First Token和 per-token latency 的分解性能优化的努力是盲目的。3 人天的投入可以一次性解决这个请求为什么慢了的问题。三项 P0 总投入约 12 人天预期月度 GPU 成本降低 30-40%首 Token 延迟降低 30-65%。四、边界分析投资决策的调整规则如果团队只有 1 人能投入资源极度受限只做 P0-1vLLM Prefix Caching1 天和 P0-3TTFT 监控1 天跳过 P0-2GPU 弹性伸缩太复杂而且没有团队配合运维用节省的时间阅读 P1 的三篇论文不做工程投入如果有 3 人典型的小团队完整的 P0 三项1 人 × 2 周P1 评估由 1 人兼职进行每周 4 小时不设 deadlineP2 不投入如果有 8 人成熟的团队P0 三项作为 8 月的 sprint goalP1 的 SGLang 和推测解码各自分配 1 人做 PoC异构 GPU 调度作为 Q4 规划8 月只做调研最重要的投资原则降低当前痛苦 提升未来能力。GPU 成本是当前的痛苦每月账单新算法是未来的能力。优先解决当下的问题。可观测性先于优化。在对延迟分布没有清晰理解之前任何优化都是猜测。1 人天能验证的不要等 1 个月。Prefix Caching 就是 1 天的工作收益立竿见影。不要把它放进下个季度的规划里。五、总结P0 三项Prefix Caching GPU 弹性伸缩 Token 可观测性是 8 月必须完成的工作总投入 12 人天SGLang RadixAttention 和推测解码是 P1 观察项5-10 月评估但暂不全面投入投资原则是降低当前痛苦 提升未来能力——优先解决每月账单和定位困难的监控盲区可观测性先于优化——没有 TTFT 和 per-token latency 的数据性能优化是盲目的猜测1 人天能完成的高收益项不要拖延到下个季度——Prefix Caching 就是典型资料说明本文中的协议、版本、性能、成本和行业趋势应以可核验的一手资料为准。未标注统计口径的比例、时间表和预测仅作工程讨论不应视为行业事实。可参考 0731 资料来源索引并在发布前将具体来源贴到对应断言之后。