Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Adding Paralight to the Rust benchmarks?

Đang mở
#8 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
hpc, performance

Hướng nghiên cứu

Bắt đầu bằng cách xác định các entry point benchmark Rust hiện có của repository và comparison harness; issue không nêu tên các tệp cục bộ. Sử dụng cấu hình thread pool Paralight được cung cấp và tham khảo ví dụ benches/criterion.rs của Paralight, sau đó xác minh rằng các kết quả mới xuất hiện cùng với các benchmark sum hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Thanks for sharing your benchmarks and your thoughts on your blog.

Another framework you may want to consider in Rust is Paralight, which offers the best of both worlds: a functional API similar to Rayon together with a choice of strategies on the lightweight vs. work-stealing dimension (Rayon always operates in work-stealing mode, which may have its overhead depending on the workloads). See also this blog post that explains the inner workings of Rayon and the simpler parallelism strategy that ultimately became Paralight.

With Paralight, the following thread pool parameters should be low overhead, and close to the "manual" partitioning of the array items you've described in your post:

use paralight::{CpuPinningPolicy, RangeStrategy, ThreadCount, ThreadPoolBuilder};
use paralight::iter::{IntoParallelRefSource, ParallelIteratorExt, ParallelSourceExt};

let mut thread_pool = ThreadPoolBuilder {
    num_threads: ThreadCount::AvailableParallelism,  // Or a manual fixed number if you prefer
    range_strategy: RangeStrategy::Fixed,  // Fixed, low-overhead partitioning of the input array among worker threads
    cpu_pinning: CpuPinningPolicy::No,  // I don't think it matters much for your example
}
.build();

// Functional style sum, nothing more.
let sum = data.par_iter().with_thread_pool(&mut thread_pool).sum::<f32>();

I'm curious how it fares in your benchmarks :)

Incidentally, Paralight already has sum reduction benchmarks: https://github.com/gendx/paralight/blob/main/benches/criterion.rs#L150.


Note: Paralight is still in alpha version because some more advanced APIs aren't fleshed out yet, but reducing values from an array is available and fairly straightforward to use.

Ngôn ngữ chính
C++
Star
119
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ashvardanian/ParallelReductionsBenchmark

Tất cả issue của ashvardanian/ParallelReductionsBenchmark

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.