As the complexity and scale of modern parallel machines continue to grow, programmers increasingly rely on composition of software libraries to encapsulate and exploit parallelism. However, many libraries are not designed with composition in mind and assume they have exclusive access to all resources. Using such libraries concurrently can result in contention and degraded performance. Prior solutions involve modifying the libraries or the OS, which is often infeasible. We propose Virtual Library Contexts (VLCs), which are process subunits that encapsulate sets of libraries and associated resource allocations. VLCs control the resource utilization of these libraries without modifying library code. This enables the user to partition resources between libraries to prevent contention, or load multiple copies of the same library to allow parallel execution of otherwise thread-unsafe code within the same process. In this paper, we describe and evaluate C++ and Python prototypes of VLCs. Experiments show VLCs enable a speedup up to 2.85x on benchmarks including applications using OpenMP, OpenBLAS, and LibTorch.


翻译:随着现代并行机器的复杂性和规模持续增长,程序员日益依赖软件库的组合来封装和利用并行性。然而,许多库在设计时并未考虑组合性,并假定它们独占所有资源。同时使用此类库可能导致资源争用和性能下降。现有解决方案涉及修改库或操作系统,这通常不可行。我们提出了虚拟库上下文(VLCs),这是一种封装库集合及相关资源分配的进程子单元。VLCs无需修改库代码即可控制这些库的资源利用。这使得用户能够在库之间划分资源以防止争用,或加载同一库的多个副本,以允许在同一进程内并行执行原本线程不安全的代码。本文中,我们描述并评估了VLCs的C++和Python原型。实验表明,在使用OpenMP、OpenBLAS和LibTorch等应用的基准测试中,VLCs可实现高达2.85倍的加速。

0
下载
关闭预览

相关内容

【CVPR2024】ViewDiff: 3D一致的图像生成与文本到图像模型
专知会员服务
30+阅读 · 2024年3月10日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员