Specialization of `N0f16` -> `Float16` conversion
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The issue links to the N0f8 to Float16 conversion in src/normed.jl around lines 145–147. Read that implementation and compare its behavior with the N0f16 conversion; reproduce the two reported mismatches, then determine what conversion change would make the results match the BigFloat reference. Done means those cases convert to the expected Float16 values.
由索引模型根据 Issue 内容生成。
描述
I have long suggested considering the use of Float16 or BFloat16 for image processing tasks where there is a risk of overflow.
I personally believe that, as a result of the increasing use of GPUs in the Julia ecosystem, we find ourselves in the ironic situation where GPU support in the graphics field has lagged behind.
Even if there are counterarguments regarding my understanding of the situation, I don't think there's any problem with improving the conversion to Float16.
The current N0f8->Float16 conversion is performed via Float32, which isn't too bad.
https://github.com/JuliaMath/FixedPointNumbers.jl/blob/d62abf3a5f2f0e99e63e22eeb4835eff717c9086/src/normed.jl#L145-L147
julia> for i in 0x00:0xff
f = Float16(i/big"255")
n = Float16(reinterpret(N0f8, i))
f === n && continue
@show i, f, n
end
On the other hand, converting from N0f16 to Float16 results in an error of 1ULP (0.5ULP).
julia> for i in 0x0000:0xffff
f = Float16(i/big"65535")
n = Float16(reinterpret(N0f16, i))
f === n && continue
@show i, f, n
end
(i, f, n) = (0xffaf, Float16(0.9985), Float16(0.999))
(i, f, n) = (0xffef, Float16(0.9995), Float16(1.0))
- 主要语言
- Julia
- 星标
- 95
- 派生
- 38
- 平均合并
- 14 小时 24 分钟
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaMath/FixedPointNumbers.jl 的其他 Issue
-
enhancement needs comments
难度 5/5 一周以上 新手友好度 12/100
JuliaMath/FixedPointNumbers.jl#353 · 5 条评论 ·
维护者通常 1 天内回复
-
bug
难度 5/5 一周以上 新手友好度 35/100
JuliaMath/FixedPointNumbers.jl#343 · 1 条评论 ·
维护者通常 1 天内回复
-
Fallback of `floattype()` for non-concrete types可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 62/100
JuliaMath/FixedPointNumbers.jl#342 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
JuliaMath/FixedPointNumbers.jl#337 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 42/100
JuliaMath/FixedPointNumbers.jl#331 · 10 条评论 ·
维护者通常 1 天内回复
查看 JuliaMath/FixedPointNumbers.jl 的全部 Issue
相似的 Issue
-
io
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
docs
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 72/100
JuliaGPU/GPUArrays.jl#837 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复