跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算与语言

arXiv:2609.08088 (cs)
[提交于 2026年9月8日]

标题:Vectorizer: Vectorizing NumPy Programs with Shape-Guided Rewrite

作者:Jingqian Liu, Xiaoyu Liu, Yuepeng Wang
查看论文《Vectorizer: Vectorizing NumPy Programs with Shape-Guided Rewrite》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:NumPy is a widely used Python library for numerical scientific computing, known for its declarative APIs and its optimized implementations. However, writing efficient NumPy programs, which often entails using vectorized array operations instead of explicit Python loops, may not be straightforward. This can be difficult for programmers who are accustomed to imperative array traversal, especially when vectorized API invocations require careful reasoning about shapes, broadcasting, and advanced indexing. This paper presents a rewrite-based approach for vectorizing Numpy programs with explicit loops over array data. Our approach vectorizes loops from the inside out, using array shapes and dataflow analysis to guide a source-to-source transformation that replaces loop bodies with vectorized statements. Following a set of rewrite rules that are correct by construction, our approach is consistently fast. We have implemented the approach as a tool called Vectorizer and evaluated it on 150 benchmarks collected from prior work and Stack Overflow. The evaluation shows that Vectorizer vectorizes 142 of the 150 benchmarks directly and 2 more after minor changes to the original benchmarks, with only 0.53 seconds on average to rewrite each one. The resulting programs are, on average, 74.83x faster than the original loop-based implementations.
主题: 计算与语言 (cs.CL); 软件工程 (cs.SE)
引用方式: arXiv:2609.08088 [cs.CL]
  (或者 arXiv:2609.08088v1 [cs.CL] 对于此版本)
  https://doi.org/10.48550/arXiv.2609.08088

提交历史

来自:Jingqian Liu
[v1] 2026年9月8日 星期二 00:59:25 UTC (225 KB)
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2026-09
切换浏览方式为:
cs
cs.CL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站