g
gcw_C8PI9e90/genomics-tf-prediction-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

genomics-tf-prediction-npu 昇腾 NPU 适配

1. 模型介绍

  • Hugging Face 原始模型:https://huggingface.co/Genereux-akotenou/genomics-tf-prediction
  • GitCode HF 镜像:https://ai.gitcode.com/hf_mirrors/Genereux-akotenou/genomics-tf-prediction
  • GitCode 权重文件:https://ai.gitcode.com/hf_mirrors/Genereux-akotenou/genomics-tf-prediction/blob/main/model.safetensors
  • 任务类型:转录因子结合位点预测
  • 模型框架:PyTorch + torch-npu (Ascend)
  • 模型架构:FEEDFORWARD (Keras)
  • 输入格式:见 readme.md 第 3 节
  • 输出格式:见 readme.md 第 3 节
  • 验证环境:Ascend 910, CANN 8.5.1, torch 2.9.0, torch-npu 2.9.0.post1

转录因子结合亲和度预测(DNA 序列分类)

2. NPU 适配说明

本仓库提供独立 CPU/NPU 推理脚本与精度对比脚本。测试严格先运行 CPU、释放资源,再运行昇腾 NPU;NPU 计时前后执行同步,结束后释放缓存。

3. 环境准备

python -m pip install -r requirements.txt --index-url "${PIP_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}"

4. 推理命令

python inference.py --device cpu --model-dir /path/to/model --output cpu_inference.json
python inference.py --device npu --model-dir /path/to/model --output npu_inference.json

5. CPU/NPU 精度测试

python compare_cpu_npu.py --model-dir /path/to/model --output comparison.json
指标CPUNPU
推理耗时0.4774 ms0.3149 ms
精度指标实测值
主指标mean_relative_error_pct
CPU/NPU 主误差0%
最大相对误差0%
最大绝对误差0
余弦相似度0.999999999
语义输出一致True

结论:NPU 与 CPU 推理结果误差小于 1%。

6. 性能说明

性能数据与输入大小、批量、预热、模型规模和首次算子编译有关。上表为本次真实运行结果,不作为跨模型性能排名。

7. 执行记录

7.1 Agent 完整适配工作流

Agent 完整适配工作流

7.2 NPU 硬件设备调用日志

NPU 硬件设备调用日志

7.3 模型最终适配验收结果

模型最终适配验收结果