惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
S
SegmentFault 最新的问题
The Cloudflare Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
The Hacker News
The Hacker News
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
博客园 - 叶小钗
量子位
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Simon Willison's Weblog
Simon Willison's Weblog
I
Intezer
S
Secure Thoughts
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Help Net Security
Help Net Security
爱范儿
爱范儿
C
Cybersecurity and Infrastructure Security Agency CISA
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
T
Tor Project blog
NISL@THU
NISL@THU
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
The Register - Security
The Register - Security
Recent Announcements
Recent Announcements
N
News and Events Feed by Topic
B
Blog RSS Feed

Miya's Blog

博客大修记录 (2026) 我在用什么? 记一次软件源归档导致的 CI 构建问题 Denoising Diffusion Null-Space Model 可逆神经网络 Invertible Diffusion Model Jupyter Notebook 安装及配置 论文复现 - MAGIS 浅谈非易失内存 深度学习环境配置(一) 深度学习环境配置(二) Debian 配置 V2Ray-A Diffusion 入门 CV 基础(二) CV 基础(一) 内存体系结构 - 简述 Programming Persistent Memory 第三章笔记 地址映射与TLB CuBase 小记
常见推理后端安装及配置
Miya · 2025-04-21 · via Miya's Blog

几种推理后端的安装及配置

TVM

TVM 的官方文档[1]给出的配置是 apache-tvm v0.11,这个版本压根跑不起来。实测需要带 --pre 参数安装。

1
2
pip install apache-tvm --pre
Successfully installed apache-tvm-0.14.dev273 ml-dtypes-0.5.0

需补充安装如下库

1
2
pip install tlcpack-nightly-cu116 --pre -f https://tlcpack.ai/wheels
pip install pytest

XLA

PyTorch 与 TensorFlow 都有 XLA 支持。这里吃了大亏,误认为 PyTorch 生态更好,于是先尝试了 PyTorch-XLA,一步一坑!

相关教程见 [1:1] [2] [3] [4],这里只粗略记录笔者的配置过程。

  1. 为兼容低版本 torch 安装旧版 xla。
  2. 样例报 ImportError: libpython3.10.so.1.0: cannot open shared object file
  3. 检查 /usr/local/lib,只有 libpython3.10.a,原来是编译时只生成了静态库,于是重新编译安装 Python 并更新动态链接器缓存 sudo ldconfig
  4. 重跑,仍然提示 Undefined Symbol。
  5. 到了喜闻乐见的试版本开盲盒环节,尝试换 xla 版本,但是根本找不到仓库,无奈去翻 xla 的 GCS Bucket 自行拼链接下载,反复测试数个版本,不得行!最后还是会报各种 Attribute Error 等。

被折磨习惯了,但为了把样例跑起来,无奈转投 Tensorflow-XLA。

Triton 算子库

Triton 的轻度使用,通过 torch.compile() 即可。[5]

POFO

这玩意一眼写论文凑数用的,使用 Rotor[6] 实现。


  1. (Homepage) openxla/xla: A machine learning compiler for GPUs, CPUs, and ML accelerators ↩︎ ↩︎

  2. How to run with PyTorch/XLA:GPU — PyTorch/XLA master documentation ↩︎

  3. pytorch/xla: Enabling PyTorch on XLA Devices (e.g. Google TPU) ↩︎

  4. Releases · pytorch/pytorch ↩︎

  5. 在 AI Infra 体系里,Triton 实际上并不是与本文介绍的其他后端同一层的概念,但是在当前语境下,混淆一下,问题不大。 ↩︎

  6. https://gitlab.inria.fr/hiepacs/rotor/-/tree/offload ↩︎

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Miya's Blog