Rav1d AV1解码器Rust代码优化悬赏2万美元
$20K Bounty Offered for Optimizing Rust Code in Rav1d AV1 Decoder

原始链接: https://www.memorysafety.org/blog/rav1d-perf-bounty/

我们与Immunant合作开发了rav1d,这是一个更安全、更高性能的Rust编写的AV1解码器。到2024年9月,rav1d的功能已全部完成,通过了所有dav1d(基于C语言的解码器)的测试,甚至可以在Chromium中运行。然而,rav1d的速度比dav1d慢约5%,这阻碍了它的采用,即使我们已经进行了优化努力。 为此,我们悬赏20,000美元来实现性能均等。符合条件的参与者(美国、英国、欧盟、加拿大、新西兰或澳大利亚的居民/公民)可以改进rav1d的Rust代码、Rust编译器或Rust标准库,但不包括共享的汇编代码。贡献必须根据其开源许可证合并到相关项目中。 我们鼓励提前提问以确保符合条件。奖金将根据性能提升的比例在贡献者之间分配,最终决定权在我们手中。我们的目标是提高rav1d的性能,并深入了解Rust与C语言性能的差异。祝你好运!

为优化Rav1d AV1解码器中的Rust代码,提供2万美元的奖励,目标是达到基于C语言的dav1d解码器的性能。将不安全的C代码移植到安全的Rust代码的初步工作揭示了与动态分派、内部可变性、边界检查和初始化相关的性能瓶颈,总共造成11%的性能影响。一些人认为这些是Rust特有的问题,可以通过不同的方法(如形式化验证)避免。 这笔赏金引发了关于所提供价值与所需专业知识之间关系的讨论,一些人认为它太低,而另一些人则认为,对于拥有优化工具链的特定个人来说,这笔赏金是合理的。参与者必须是特定地区(美国、英国、欧盟、加拿大、新西兰、澳大利亚)的居民/公民。规则要求解决方案必须在rav1d、Rust编译器或Rust标准库中实现。 即使是视频编解码器中微小的性能提升也很重要,它直接影响电池续航时间和用户体验。该讨论还涉及到在这些关键应用中安全性和性能之间的争论。

原文

In March of 2023 we announced that we were starting work on a safer high performance AV1 decoder called rav1d, written in Rust. We partnered with Immunant to do the engineering work. By September of 2024 rav1d was basically complete and we learned a lot during the process. Today rav1d works well—it passes all the same tests as the dav1d decoder it is based on, which is written in C. It’s possible to build and run Chromium with it.

There’s just one problem—it’s not quite as fast as the C version. We want to change that and we need your help.

Our Rust-based rav1d decoder is currently about 5% slower than the C-based dav1d decoder (the exact amount differs a bit depending on the benchmark, input, and platform). This is enough of a difference to be a problem for potential adopters, and, frankly, it just bothers us. The development team worked hard to get it to performance parity. We brought in a couple of other contractors who have experience with optimizing things like this. We wrote about the optimization work we did. However, we were still unable to get to performance parity and, to be frank again, we aren’t really sure what to do next.

After racking our brains for options, we decided to offer a bounty pool of $20,000 for getting rav1d to performance parity with dav1d. Hopefully folks out there can help get rav1d performance advanced to where it needs to be, and ideally we and the Rust community will also learn something about how Rust performance stacks up against C.

The official rules are here, but to summarize:

  1. The contest is open to individuals or teams of individuals who are legal residents or citizens of the United States, United Kingdom, European Union, Canada, New Zealand, or Australia.
  2. The rules provide instructions for benchmarking performance improvements.
  3. You work on improving performance. Your improvements can be in rav1d, the Rust compiler, or the Rust standard library.
  4. The dav1d and rav1d decoders share the exact same low-level assembly code optimizations—you cannot modify this assembly. You must improve the Rust code (or the Rust compiler), which is what differs between dav1d and rav1d. You may not introduce code into rav1d in a language other than Rust. We encourage you to ask questions early on in issues or by emailing us so as to avoid investing heavily in something that might not be eligible!
  5. Get your performance improvements merged into the relevant project per the project's standard contribution process and under its open source license(s), then email us per the instructions in the official rules to enter and potentially be rewarded for your contribution.
  6. When the contest ends (likely either because we met our goal or time has run out) we will, at our discretion, divide the bounty proportionally between the largest contributors to performance gains.

At the end of the day, we reserve the right to award the money to the person(s) or team(s) that we deem to have helped us reach or exceed performance parity in the best possible way.

If we update the rules we'll post a note here and on the official rules page.

Good luck! Have fun!

联系我们 contact @ memedata.com