混合精度-周记(2022.4.18-4.24)

task 1:学习“Automatically Adapting Programs for Mixed-Precision Floating-Point Computation”以及相关知识


Part 1 :首先是一些问题(生词),红色标注表示还不理解 ,紫色表示已经解决

framework  框架          streaming architectures 数据流结构?

bandwidth   释义:a measurement of the amount of information that a particular computer network or Internet connection can send in a particular time. It is often measured in bits per second. 带宽值,频宽值(计算机网络或互联网接口一定时间内传送信息量的量度,按每秒传送的字节数计)

binary instrumentation and modifification (上网查了是 二进制插桩 二进制修改
configuration   释义:the equipment and programs that form a computer system and the way that these are set up to run (计算机的)配置
benchmark 释义:衡量标准    incentive   释义:鼓励,激励  degradation  释义:退化
    
incur  释义:if you incur  costs, you have to pay them 引致,带来(成本、花费等)
overhead  释义:开销       optimization  释义:优化   verification  释义:证实,证明
replicate manual conversions 复制; 重做(试验、工作或研究) 人工转换
significand,mantissa  释义:尾数     exponent  释义:指数   scheme 释义:方案,计划
IEEE 释义:Institute of Electrical and Electronics Engineers.
arithmetic  释义:算数,运算    excerpts  释义:摘抄,摘录   impose  释义:强加
128-bit XMM registers  释义:一种寄存器    catalogue  释义:目录(忘记怎么拼了)
fatal  释义:致命的      trial-and-error experiment  释义:试错实验
several orders of magnitude  释义:几个数量级

Part 2 catalogue

1.“Floating-point

2.Register classification in x86_64 architecture

3.浮点数表示


 Part 3 content

Below are some excerpts and notes from the article

        1.“Floating-point”

Double-precision arithmetic generally results in more accurate computations, but with several costs.Another cost is the reduced opportunity for parallelization, such as on the
x86 architecture, where packed 128-bit XMM registers can only hold and operate on two double-precision numbers simultaneously compared to four numbers with single precision.
In practice, it has been reported that single-precision calculations can be 2.5 times faster than corresponding double-precision calculations, because of the various factors described above

         2.Register classification in x86_64 architecture

  • 通用寄存器 (General-Purpose registers)
  • 状态和控制寄存器(RFLAGS register)
  • 指令寄存器 (RIP)
  • XMM寄存器
  • 浮点控制和状态寄存器 (MXCSR)

        3. 浮点数表示

QQQ. 虽然图解表示了浮点数的大概的表示方式(分为符号,价码,尾数),但是具体的数学公式还是不清晰(即将一个实数近似表示为一串二进制位的具体步骤)

(然后当然是查资料解决了^.^)(下面内容借鉴了《浮点计算——编程原理、实现与应用》,以及百度百科

首先对于任意一个实数可以有两种表示方式:定点数表示法(fixed-point), 浮点数表示法d_{0}.d_{1}d_{2}d_{3}d_{4}d_{5}(floating-point number)

 定点数表示法(fixed-point)

所谓定点格式,即约定机器中所有数据的小数点位置是固定不变的。在计算机中通常采用两种简单的约定:将小数点的位置固定在数据的最高位之前,或者是固定在最低位之后。一般常称前者为定点小数(纯小数),后者为定点整数(整数)。

 浮点数表示法(floating-point number)

规范的(Normalized)浮点数表达方式具有如下形式:d_{0}.d_{1}d_{2}d_{3}d_{4}d_{5}......(0\leqslant d_{i}<\beta)当然,在计算机里\beta=2,也就是说一个实数可以用下列形式表示(S:符号位,Exponent:指数域,Fraction:尾数域)

x=(-1)^{s}*(1+{\mathrm{Fraction}})*2^{(Exponent-Bias)} 

ps:为了强制定义一些特殊值,IEEE标准通过指数将表示空间划分成了三大块:1.最小值指数(所有位全置0)用于定义0和弱规范数2.最大指数(所有位全值1)用于定义±∞和NaN(Not a Number);3.其他指数用于表示常规的数。这样一来,最大(指绝对值)常规数的指数不是全1的,最小常规数的指数也不是0,而是1。

attention:通常情况,IEEE标准写法,尾数的1省略,Fraction= 0.001001,因为标准写法,前面的1总是省略Fraction = 尾数 - 1 ;(IEEE规定小数点左侧的 1 是隐藏的)

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值