Lemuel_/DeepPlant-EAP-NPU
模型介绍
文件和版本
Pull Requests
讨论
分析

Addaoud/DeepPlant-EAP 昇腾 NPU 推理适配

模型:DeepPlant-EAP(Conv1d 残差 backbone 512→2048 + 6 层 Transformer encoder d=2048 + attention pool + FC head 4096→2)

昇腾 NPU 适配结论

项目结果
前向输出logits (B, 2),CPU/NPU 一致
精度(rel-L2)7.46e-7(< 1% 阈值,PASS)
性能(NPU 平均)5.67 ms(batch=1)
稳定性20 轮 batch=1 逐位一致(PASS)
验收六件套齐全,CPU/NPU 独立子进程对比

关键适配点

  • 架构精确重建:conv_features(.conv 子模块)+ ConvResBlock(layer.0/1/3/4/6/7 + project.0/1)+ transformer encoder(encoder.encoder_layers)+ _AttentionPool(裸 Parameter)。
  • attention_pool.to_attn_logits 为裸参数 (2048, 2048),通过 _AttentionPool(nn.Module) + self.to_attn_logits = nn.Parameter(...) 实现键名精确匹配。
  • 权重键名全匹配:missing=0, unexpected=0。

运行方法

python3 minimal_repro.py
python3 accuracy_eval.py
python3 benchmark.py
python3 stability.py
python3 inference.py

结果文件

  • results/accuracy_241.json / benchmark_241.json / stability_241.json / inference_results_241.json

三张真实终端截图

  • assets/agent_workflow.png / assets/npu_device_call.png / assets/model_result.png