Repository navigation
SimdYolo 0.11.6
中文
SimdYolo 和 SimdYolo.Training 同步发布 0.11.6,目标框架为 .NET 10。训练包同步更新推理依赖。
- CPU 推理 将大张量拼接和同形状逐元素运算分块交给已有执行器。线程预算达到四个时,空闲工作线程默认进入事件等待,降低每帧 CPU 开销。
- 完整图片推理 在会话内复用预处理和解码缓冲区。双线性缩放直接写入三个颜色平面,通道优先检测输出用 SIMD 扫描分类分数。Vulkan 回读和重放也可借用解码缓冲区。
- 分割与姿态 PT 端到端头直接收集 TopK 入选锚点的掩码系数或关键点,省去与检测输出的整张量拼接。
- Vulkan Winograd 按实际内核布局变换权重,跨卷积复用两槽输入变换区和乘积工作区,降低中间缓冲区容量。
- Vulkan TopK 用整数比较键保留原始浮点分数与稳定的同分顺序,减少归并写入。0.11.5 在 RTX 3060 上失败的通用 ONNX 末轴 TopK 用例已通过。通用 GPU 路径仍需显式启用。
性能实测
同机对比 NuGet 正式包 0.11.5 与本版推理代码的 Release 构建。Windows、Core i7-12700、RTX 3060,640×640 FP32,单帧,8 个 P 核,AVX-512 关闭。90 个独立计时窗口共测量 17,832 帧。完整图片路径包含预处理、模型推理和后处理,Vulkan 时间包含上传和回读。
| 模型与指标 / Model and metric | NuGet 0.11.5 | 0.11.6 | 变化 / Change |
|---|---|---|---|
| YOLO26n-seg PT · CPU 图片中位耗时 / Image median | 41.54 ms | 36.62 ms | −11.9% |
| YOLO26n-seg PT · CPU 图片 CPU 时间 / Image CPU time | 243.75 ms/帧 | 200.81 ms/帧 | −17.6% |
| YOLO26n-seg PT · Vulkan 前向中位耗时 / Forward median | 6.57 ms | 5.95 ms | −9.3% |
| YOLOv8n PT · Vulkan 图片中位耗时 / Image median | 7.03 ms | 4.67 ms | −33.6% |
| YOLOv8n PT · CPU 图片峰值工作集 / Peak working set | 484.67 MiB | 222.25 MiB | −54.1% |
| YOLOv8n PT · Vulkan 中间缓冲区 / Intermediate buffers | 224.00 MiB | 140.30 MiB | −37.4% |
| YOLO26n-seg PT · Vulkan 中间缓冲区 / Intermediate buffers | 288.00 MiB | 223.64 MiB | −22.3% |
10 项配置的中位延迟均低于 0.11.5。YOLOv8n CPU 图片的 P95 从 35.60 ms 增至 36.83 ms,YOLO26n-seg ONNX CPU 前向的峰值工作集从 345.67 MiB 增至 376.76 MiB。中间缓冲区数据统计帧分配区和 Winograd 工作区,显存总占用还包括权重、暂存区及驱动开销。136 项 CPU/Vulkan 测试、11 项训练测试和 352 项输出核对通过。 完整性能报告
English
Both packages target .NET 10 and ship as 0.11.6. The training package updates its shared inference dependency.
- CPU inference uses the existing executor to process large concatenations and same-shape elementwise operations in contiguous blocks. Idle workers park immediately when the budget is four or more threads.
- Image inference reuses session buffers for preprocessing and decoding, writes resized pixels directly to color planes, and uses SIMD to scan channel-first class scores. Vulkan readback and replay can reuse the decoding buffers.
- PT segmentation and pose gather mask coefficients or keypoints directly from selected anchors, avoiding concatenation of the full detection and instance tensors.
- Vulkan Winograd transforms weights into the kernel's layout and reuses two input transform slots and one product workspace across convolutions.
- Vulkan TopK ranks scores with integer keys, preserving the original float values and stable ties while reducing writes during merging. The opt-in generic ONNX last-axis TopK case that failed on RTX 3060 in 0.11.5 now passes.
The table compares the public NuGet 0.11.5 package with a Release build of this version's inference code. The Windows test used a Core i7-12700, an RTX 3060, 640×640 FP32 inputs, single-frame inference, eight P-cores and AVX-512 off. There were 17,832 timed frames in 90 independent windows. Image timings include preprocessing and postprocessing. Vulkan timings include input upload and output readback.
All ten median latencies improved. YOLOv8n CPU image P95 increased from 35.60 ms to 36.83 ms, and YOLO26n-seg ONNX CPU forward peak working set increased from 345.67 MiB to 376.76 MiB. The reported GPU buffer capacities cover frame arenas and Winograd workspaces. Total GPU memory also includes weights, staging and driver overhead. The 136-test CPU/Vulkan suite, 11 training tests and 352 output comparisons passed. Performance data and test methodology
安装 / Install
dotnet add package SimdYolo --version 0.11.6
dotnet add package SimdYolo.Training --version 0.11.6SimdYolo on NuGet · SimdYolo.Training on NuGet · Changes since 0.11.5