The R ecosystem offers a rich variety of map-reduce application programming interfaces (APIs) for iterative computations, yet parallelizing code across these diverse frameworks requires learning multiple, often incompatible, parallel APIs. The futurize package addresses this challenge by providing a single function, futurize(), which transpiles sequential map-reduce expressions into their parallel equivalents in the future ecosystem, which performs all the heavy lifting. By leveraging R's native pipe operator, users can parallelize existing code with minimal refactoring -- often by simply appending `|> futurize()' to an expression. The package supports classical map-reduce functions from base R, purrr, crossmap, foreach, plyr, BiocParallel, e.g., lapply(xs, fcn) |> futurize() and map(xs, fcn) |> futurize(), as well as a growing set of domain-specific packages, e.g., boot, caret, glmnet, lme4, mgcv, and tm. By abstracting away the underlying parallel machinery, and unifying handling of future options, the package enables developers to declare what to parallelize via futurize(), and end-users to choose how via plan(). This article describes the philosophy, design, and implementation of futurize, demonstrates its usage across various map-reduce paradigms, and discusses its role in simplifying parallel computing in R.


翻译:R生态系统为迭代计算提供了丰富的map-reduce应用程序编程接口(API),然而在这些多样化框架间实现代码并行化需要学习多种通常互不兼容的并行API。futurize包通过提供单一函数futurize()来解决这一挑战,该函数将顺序执行的map-reduce表达式转译为future生态系统中的并行等效代码,由该生态系统承担所有繁重的并行处理任务。通过利用R的原生管道运算符,用户能够以最小的代码重构代价实现现有代码的并行化——通常只需在表达式末尾附加`|> futurize()`。该包支持来自基础R、purrr、crossmap、foreach、plyr、BiocParallel的经典map-reduce函数,例如lapply(xs, fcn) |> futurize()和map(xs, fcn) |> futurize(),同时支持日益增长的领域专用包,例如boot、caret、glmnet、lme4、mgcv和tm。通过抽象底层的并行机制并统一处理future选项,该包使开发者能够通过futurize()声明需要并行化的内容,而终端用户则可通过plan()选择并行化方式。本文阐述了futurize的设计理念、架构与实现,演示了其在各种map-reduce范式中的应用,并探讨了其在简化R语言并行计算中的作用。

0
下载
关闭预览

相关内容

【2023新书】并行算法,Parallel Algorithms ,400页pdf
专知会员服务
72+阅读 · 2023年8月6日
专知会员服务
55+阅读 · 2021年7月21日
【NeurIPS 2020】融入BERT到并行序列模型
专知会员服务
26+阅读 · 2020年10月15日
GCN如何并行化?分布式图卷积神经网路,13页pdf
专知会员服务
35+阅读 · 2020年7月20日
【硬核书】可扩展机器学习:并行分布式方法
专知会员服务
86+阅读 · 2020年5月23日
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
基于R语言进行Box-Cox变换
R语言中文社区
45+阅读 · 2018年11月19日
R语言之数据分析高级方法「时间序列」
R语言中文社区
17+阅读 · 2018年4月24日
并行算法演进,从MapReduce到MPI
凡人机器学习
10+阅读 · 2017年11月5日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
VIP会员
相关资讯
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
R工程化—Rest API 之plumber包
R语言中文社区
11+阅读 · 2018年12月25日
基于R语言进行Box-Cox变换
R语言中文社区
45+阅读 · 2018年11月19日
R语言之数据分析高级方法「时间序列」
R语言中文社区
17+阅读 · 2018年4月24日
并行算法演进,从MapReduce到MPI
凡人机器学习
10+阅读 · 2017年11月5日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员