TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Finite Field Assembly: A Language for Emulating GPUs on CPU

42 点作者 muragekibicho4 个月前

11 条评论

muragekibicho4 个月前
Introduction : Finite Field Assembly is a programming language that lets you emulate GPUs on CPUs<p>It&#x27;s a CUDA alternative that uses finite field theory to convert GPU kernels to prime number fields.<p>Finite Field is the primary data structure : FF-asm is a CUDA alternative designed for computations over finite fields.<p>Recursive computing support : not cache-aware vectorization, not parallelization, but performing a calculation inside a calculation inside another calculation.<p>Extension of C89 - runs everywhere gcc is available. Context : I&#x27;m getting my math PhD and I built this language around my area of expertise, Number Theory and Finite Fields.
评论 #42744891 未加载
评论 #42744591 未加载
adamvenis4 个月前
I think I get it. You&#x27;re using the Ring isomorphism from the Chinese Remainder Theorem to do &quot;parallel computation&quot;. This is the same principle as how boolean algebra on binary strings computes the pairwise results of each bit in parallel. Unfortunately, there&#x27;s no free lunch - if you want to perform K operations on N-bit integers in parallel, you still need to work with (K * N)-bit-wide vectors, which is essentially what SIMD does anyway.
评论 #42745387 未加载
评论 #42744866 未加载
vimarsh67394 个月前
One of the more subtle aspects of retargeting GPU code to run on the CPU is the presence of fine grained(read - block level and warp level) explicit synchronization mechanisms being available in the GPU. However, this is not the same in CPU land, so additional care has to be taken to handle this. One example of work which tries this is <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2207.00257" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;2207.00257</a> .<p>Interestingly, in the same work, contrary to what you’d expect, transpiling GPU code to run on CPU gives ~76% speedups in HPC workloads compared to a hand optimized multi-core CPU implementation on Fugaku(a CPU only supercomputer), after accounting for these differences in synchronization.
评论 #42745294 未加载
hashxyz4 个月前
Pretty sure this is just vectorization. You can pack some 8bit ints into a machine-length 32bit int and add them together, that is vectorization.
评论 #42744863 未加载
foota4 个月前
It&#x27;s a bit hard for me to tell the intention here. Is the idea that finite fields can take better advantage of CPU architecture than something like SIMD for parallel computation? Or is this just for experimentation?<p>Edit: this tickles my brain about some similar seeming sort of programming language experiment, where they were also trying to express concurrency (not inherently the same as parallelism) using some fancy math. I can&#x27;t remember what it was though?
评论 #42745641 未加载
imbusy1114 个月前
I suspect this is just AI slop.
catapart4 个月前
If matrix multiplication does get added to this, I imagine that there is some utility for game development. At that point, I&#x27;d be curious what the comparison would be from CPU to GPU. Like, given a clock speed of x, what would a comparable GPU (or set of GPU features) look like?<p>I know that&#x27;s pretty abstract, but without that kind of &quot;apples to apples&quot; comparison, I have trouble contextualizing what kind of output is bring targeted with this kind of work.
pwdisswordfishz4 个月前
&gt; Field order (the number of elements your field can hold). i.e you can store 8 * 9 * 11 elements in the field<p>I thought a finite field&#x27;s order has to be a prime power.
评论 #42745527 未加载
tooltechgeek4 个月前
What are some problems where this approach has advantages?
almostgotcaught4 个月前
It&#x27;s hilarious how gullible hn is. All you gotta do is put GPU and math buzzwords in your README and you&#x27;ll automatically be upvoted.<p>This was discussed on Reddit - this is not actually finite field arithmetic.<p>Also you can go to this dudes GitHub and see exactly how serious this project is.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;LeetArxiv&#x2F;Finite-Field-Assembly">https:&#x2F;&#x2F;github.com&#x2F;LeetArxiv&#x2F;Finite-Field-Assembly</a><p>Lol
Retr0id4 个月前
This is nonsense.