SlackDrive:自适应驾驶推理的运行时弹性计算——21.7%延迟约束性能提升

论文信息

项目 内容
标题 SlackDrive: Reclaiming Runtime Slack for Adaptive Driving Inference
arXiv arXiv:2609.28064 (2026年9月23日)
作者 Xiaohuan Pei et al.
领域 cs.AI, cs.RO
评估平台 NAVSIM v2 + DriveDreamer-Policy
关键词 自适应推理、运行时弹性、驾驶世界模型、延迟约束

核心创新

SlackDrive提出了一种推理前计算分配器,利用已实现的延迟来动态选择每个控制步的计算预算。在严格延迟约束下,比最强基线提升21.7% EPDMS(延迟约束下的规划性能)。

关键洞察:最大的可允许计算预算随运行时状态系统性变化,而最近实现的延迟提供了可用计算余量(slack)的直接信号。


问题定义

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class DrivingInferenceChallenge:
"""
驾驶世界-动作模型的推理挑战

多模态推理 + 未来预测 → 提升规划
但推理成本与实时性要求冲突
"""

challenges = {
"growing_cost": "多模态推理+未来预测的推理成本不断增长",
"realtime_requirement": "车辆控制要求严格实时(<100ms)",
"shared_compute": "车载计算资源被多任务共享",
"runtime_variation": "运行时状态变化导致可用计算余量波动"
}

existing_methods = {
"token_reduction": "减少token数量(部署前确定)",
"layer_reduction": "减少网络层数",
"sampling_reduction": "减少采样步数"
# 共同问题:都是部署前静态配置,无法适应运行时变化
}

slackdrive_insight = """
观察:最大的可允许计算预算随运行时状态系统性变化
最近实现的延迟 → 可用计算余量的直接信号

利用已实现延迟 → 预测可用slack → 选择最优计算预算
"""

方法详解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import numpy as np
from typing import Tuple

class SlackDrive:
"""
SlackDrive: 推理前计算分配器

核心机制:
1. 离线profiling:对每个计算预算测量延迟和规划效用
2. 在线状态估计:从已完成的前向推理估计当前计算状态
3. 预算选择:选择在可允许延迟窗口内最高效用的预算

论文: arXiv:2609.28064
"""

def __init__(self, budgets, latency_profile, utility_profile):
"""
Args:
budgets: 离散计算预算集合, e.g. [0.25, 0.5, 0.75, 1.0]
latency_profile: 每个预算的延迟统计 {budget: (mean, std)}
utility_profile: 每个预算的规划效用 {budget: score}
"""
self.budgets = budgets
self.latency_profile = latency_profile
self.utility_profile = utility_profile
self.recent_latencies = []
self.window = 5 # 滑动窗口大小

def estimate_slack(self, admissible_latency: float) -> float:
"""
从最近实现的延迟估计可用计算余量

Args:
admissible_latency: 可允许延迟窗口(ms)

Returns:
estimated_slack: 估计的可用余量
"""
if len(self.recent_latencies) < 1:
return admissible_latency * 0.7 # 保守估计

# 最近延迟的加权平均(新数据权重更高)
weights = np.exp(np.linspace(-1, 0, len(self.recent_latencies)))
weights /= weights.sum()
recent_mean = np.average(self.recent_latencies, weights=weights)

# slack = 可允许延迟 - 预期延迟
estimated_slack = admissible_latency - recent_mean
return max(0, estimated_slack)

def select_budget(self, admissible_latency: float) -> float:
"""
选择最优计算预算

目标:在延迟约束内最大化规划效用

Args:
admissible_latency: 可允许延迟窗口

Returns:
selected_budget: 选中的计算预算
"""
slack = self.estimate_slack(admissible_latency)

best_budget = self.budgets[0] # 最保守预算
best_utility = 0

for budget in self.budgets:
mean_lat, std_lat = self.latency_profile[budget]

# 预测延迟 = 均值 + 安全边际
predicted_latency = mean_lat + 1.5 * std_lat # 95%分位

if predicted_latency <= admissible_latency - slack * 0.3:
# 在延迟约束内
utility = self.utility_profile[budget]
if utility > best_utility:
best_utility = utility
best_budget = budget

return best_budget

def update(self, actual_latency: float):
"""更新延迟历史"""
self.recent_latencies.append(actual_latency)
if len(self.recent_latencies) > self.window:
self.recent_latencies.pop(0)


# 测试
if __name__ == "__main__":
# 定义4个计算预算级别
budgets = [0.25, 0.50, 0.75, 1.0]

# 离线profiling数据
latency_profile = {
0.25: (35, 5), # 35±5ms
0.50: (55, 8), # 55±8ms
0.75: (75, 10), # 75±10ms
1.00: (95, 15), # 95±15ms
}
utility_profile = {
0.25: 0.65,
0.50: 0.78,
0.75: 0.88,
1.00: 0.95,
}

allocator = SlackDrive(budgets, latency_profile, utility_profile)

# 模拟运行
admissible_latency = 100 # ms

for step in range(10):
budget = allocator.select_budget(admissible_latency)
actual_latency = latency_profile[budget][0] + np.random.randn() * 5
allocator.update(actual_latency)

print(f"Step {step}: budget={budget:.2f}, "
f"latency={actual_latency:.1f}ms, "
f"utility={utility_profile[budget]:.2f}")

实验结果

方法 EPDMS (延迟约束) 延迟超标率 说明
Full budget (无约束) 0.872 42% 超标严重
Static token pruning 0.781 15% 固定预算
Static layer skip 0.795 12% 固定层数
SlackDrive 0.950 3% 动态分配
Oracle (后验最优) 0.968 0% 上界

不同延迟约束下的性能

延迟约束 (ms) Static最优 SlackDrive 提升
50 0.621 0.756 +21.7%
80 0.783 0.891 +13.8%
100 0.852 0.950 +11.5%
150 0.901 0.961 +6.7%

IMS开发启示

1. DMS推理弹性架构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class ElasticDMSInference:
"""
将SlackDrive理念应用到DMS推理

场景:DMS+OMS+CPD共享NPU算力
当ADAS占用更多算力时,DMS需要弹性降级
"""

def __init__(self):
# DMS模型预算级别
self.budgets = {
"ultra_fast": {
"model": "FastKAN-DDD (35KB)",
"latency_ms": 0.04,
"accuracy": 0.99,
"features": ["疲劳3级分类"]
},
"standard": {
"model": "YOLOv8n face landmark",
"latency_ms": 8,
"accuracy": 0.96,
"features": ["关键点", "凝视", "疲劳"]
},
"full": {
"model": "多模态融合DMS",
"latency_ms": 30,
"accuracy": 0.98,
"features": ["关键点", "凝视", "疲劳", "分心", "OOP"]
}
}
self.slack_allocator = SlackDrive(
budgets=list(self.budgets.keys()),
latency_profile=self._profile(),
utility_profile=self._utility()
)

def _profile(self):
return {
"ultra_fast": (0.04, 0.01),
"standard": (8, 1.5),
"full": (30, 5)
}

def _utility(self):
return {
"ultra_fast": 0.70,
"standard": 0.88,
"full": 0.95
}

def select_dms_mode(self, available_time_ms):
"""根据可用时间选择DMS模式"""
budget = self.slack_allocator.select_budget(available_time_ms)
return self.budgets[budget]

2. 与ADAS算力协商

3. 实际部署价值

场景 传统DMS SlackDrive DMS 优势
正常驾驶 固定30ms/帧 8ms/帧(标准) 节省73%算力
ADAS高负载 固定30ms → 超时 0.04ms/帧(极速) 不超时
复杂场景 固定30ms/帧 30ms/帧(完整) 最优检测
混合交通 固定 动态切换 自适应

总结

SlackDrive为IMS提供了一个关键的系统级优化思路:DMS推理预算不应静态固定,而应根据运行时可用计算余量动态调整。在ADAS与DMS共享车载NPU的架构下,这种弹性分配机制可确保DMS在任何计算负载下都不超时,同时在资源充裕时最大化检测精度。

核心启示:IMS的推理架构应内置SlackDrive式的弹性机制——当ADAS占用大量NPU时自动降级到FastKAN-DDD极速模式(0.04ms),当资源充裕时恢复全模型推理。这比固定的”一刀切”推理预算更高效、更鲁棒。