Skip to main content
QUICK REVIEW

[论文解读] CLARINET: A RISC-V Based Framework for Posit Arithmetic Empiricism

Niraj Sharma, Riya Jain|arXiv (Cornell University)|May 30, 2020
Numerical Methods and AlgorithmsComputer Science被引用 13
一句话总结

本文提出 Clarinet,一个基于开源 RISC-V 架构的框架,集成可配置的 posit 算术核心(Melodica)与基于 quire 的融合运算,支持浮点数与 posit 算术并存,用于实际应用中的评估。实验表明,对于小规模累加操作,其延迟最高提升 16%,但在大规模内核中因高效流水线化而表现出更优性能。该框架已完成全 FPGA 实现,并开源提供,适用于软硬件协同设计研究。

ABSTRACT

Many engineering and scientific applications require high precision arithmetic. IEEE~754-2008 compliant (floating-point) arithmetic is the de facto standard for performing these computations. Recently, posit arithmetic has been proposed as a drop-in replacement for floating-point arithmetic. The posit exttrademark data representation and arithmetic claim several absolute advantages over the floating-point format and arithmetic, including higher dynamic range, better accuracy, and superior performance-area trade-offs. However, there does not exist any accessible, holistic framework that facilitates the validation of these claims of posit arithmetic, especially when the claims involve long accumulations (quire). In this paper, we present a consolidated general-purpose processor-based framework to support posit arithmetic empiricism. The end-users of the framework have the liberty to seamlessly experiment with their applications using posit and floating-point arithmetic since the framework is designed for the two number systems to coexist. Melodica is a posit arithmetic core that implements parametric fused operations that uniquely involve the quire data type. Clarinet is a Melodica-enabled processor based on the RISC-V ISA. To the best of our knowledge, this is the first-ever integration of quire with a RISC-V core. To show the effectiveness of the Clarinet platform, we perform an extensive application study and benchmark some of the common linear algebra and computer vision kernels. We emulate Clarinet on a Xilinx FPGA and present utilization and timing data. Clarinet and Melodica remain actively under development and is available in open-source for posit arithmetic empiricism.

研究动机与目标

  • 为解决在真实应用中对 posit 算术与浮点数进行实证评估时缺乏可访问、整体性的硬件平台的问题。
  • 通过在单一处理器中同时原生支持浮点数与 posit 算术作为一等类型,实现两者之间的直接比较。
  • 首次将 quire 数据类型——对高精度融合运算至关重要——集成到 RISC-V 核心中。
  • 为科学与工程工作负载中 posit 算术的早期阶段设计空间探索,提供可重构、开源的平台。
  • 通过在 FPGA 上运行真实世界基准测试,验证 posit 算术在性能、面积与延迟之间的权衡。

提出的方法

  • 设计 Melodica,一个可配置的 posit 算术单元,支持涉及 quire 数据类型的融合乘加与除加操作。
  • 扩展 RISC-V ISA,添加用于 posit 与 quire 操作的自定义指令,实现与标准 C 代码的无缝集成。
  • 构建 Clarinet,一个基于 Flute 核心的 RISC-V 处理器,增强 Melodica 模块,并同时支持浮点数与 posit 算术。
  • 开发定制化的 RISC-V GCC 工具链,用于编译使用新指令集的 C 代码,支持两种数据类型。
  • 在 Xilinx ZedBoard FPGA 上实现并综合 Clarinet,涵盖多种配置,调整 posit 宽度(N)与阶码字段大小(es)。
  • 利用 LUT 与时序分析,评估不同配置与工作负载下的资源利用率与性能表现。

实验结果

研究问题

  • RQ1RISC-V 处理器能否原生支持浮点数与 posit 算术并存,实现数据类型共存,从而支持直接的性能比较?
  • RQ2在 RISC-V 核心中引入 quire 数据类型,对融合运算的资源利用率与性能有何影响?
  • RQ3在大规模线性代数与计算机视觉内核中,使用 posit 代替浮点数进行大规模累加操作,其延迟与面积开销如何?
  • RQ4随着累加数量的增加,posit 算术在流水线融合运算中的性能扩展性如何?
  • RQ5Clarinet 平台能否作为可行的开源框架,用于硬件-软件协同设计与 posit 算术的实证评估?

主要发现

  • 对于小规模累加(如 2 元素点积),posit 算术带来 250% 的周期开销(95 个周期 vs. 25 个周期),表明在短序列中成本较高。
  • 对于较大规模累加(如 25 元素点积),posit 算术的周期开销为 16%(548 vs. 495 个周期),但其在长序列中的更高精度与动态范围可有效抵消开销。
  • 在完整的光流模拟中,posit 需要 2560 万个周期,而浮点数仅需 2100 万个周期,证实了在小内核中存在开销,但在精度敏感工作负载中具有潜在优势。
  • quire 单元是资源消耗最严重的组件,其 LUT 占比随 posit 宽度非线性增长(接近 O(N²)),在 Melodica 中主导了资源使用。
  • 采用 32 位 posit(N=32, es=2)的 Clarinet 配置在面积与时序方面与标准浮点单元相当,支持其硬件成本相近的论断。
  • 该框架成功实现了 C 代码中浮点数与 posit 类型的共存,使开发人员能够以最小修改实现代码的逐步迁移。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。