ajwheeler / ajwheeler/Korg.jl

GPUs?

未关闭
#190 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Julia
星标
67
派生
15
平均合并
2 天 6 小时
30 天内合并 PR
6

描述

It has been suggested before that Korg might be sped up by putting the hot loop (line opacity calculation) on the GPU.

This paper presents an interesting implementation of that idea: https://ui.adsabs.harvard.edu/abs/2015ApJ...808..182G/abstract

Comparing their performance to ours is not straightforward. They take about ~1s to calculate opacity from 10^6 lines in their performance tests. If I do a synthesis for a cool star with the Pokazatel water linelist, there are ~2*10^6 lines across ~50 layers -> 10^8 line opacity calculations. This takes ~40s. So naively, we are already doing great (0.4 µs vs their 1 µs per line). BUT:
- I am running on my laptop, on a single M2 performance core. They are using an NVIDIA Tesla K20 GPU. What we really want is something like [time / line / $ of compute], but I have no idea what the appropriate numbers are for this hardware.
- They are calculating their lines out to 100 cm^-1 (they also do 10 and 1000). [If I am not bungling the math](https://www.wolframalpha.com/input?i=16000+angstroms+-+1%2F%281%2F%2816000+aangstroms%29+%2B+100%2Fcm%29), this corresponds to ~250 Aangstroms, which is orders of magnitude bigger than my line windows. They discuss the fact that Voigt profiles probably aren't really correct that far out, but they do make a difference to the wavelength-integrated opacity. This may be a problem with Korg and other stellar synthesis codes.
- I'm not sure what temperature and pressure they computed their opacity at. This matter a lot, but not as much as you would think given that their line windows are fixed.
- I'm not sure how their Voigt approximation compares to ours in speed or accuracy. (Though I noted it in #43.)
- Finally, conventional wisdom is that pressure broadening of molecular lines is negligible in stars. I still haven't gotten around to verifying this, but assuming it's true, we can always pre-tabulate molecular opacity as a function of temperature. This will be extremely fast. **(edit: this is implemented and it is indeed very fast)**

The code for this (and for GPU-accelerated RT!) is on their github: https://github.com/exoclime.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。