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

Smart and user-controllable automatic Constant memory space placement for `static` variables

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

@distributedstatemachine đang làm issue này rồi.

Từ ngày 22/6/2025.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu bằng việc xem xét PR #217 và logic placement trong constant memory hiện tại mà nó đã thay đổi. Issue không nêu tệp hay test nào, vì vậy hãy lần theo các điểm vào của codegen từ pull request đó và nghiên cứu Rust project-goals issue #254. Để hoàn tất, cần có một design đã được thống nhất cho automatic placement, packing, spilling, manual limits và user controls.

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

Mô tả

enhancement good first issue help wanted

https://github.com/Rust-GPU/Rust-CUDA/pull/217 made codegen default to not using constant memory with an opt-in flag. But in the interest of performance we should try to use constant memory automatically as much as possible.

As it is, using the flag / turning on constant memory can blow up as constant memory placing logic isn't fully correct. Ideally we keep track of what we have put into constant memory and when it is filled up spill instead of only spilling when a static is too large on its own. We should also sometimes hard error rather than spilling...for example, if you annotate a bunch of things over the limit manually, the last annotation should fail at compile time.

We'll also probably want some packing strategy controlled by the user...for example, if you have one large static and many small ones, you might want the small ones to all be in constant memory or just the big one depending on your workload. We need some design work around this, and the design shouldn't require code to be annotated to support third party non-GPU-aware libraries.

Some designs off the top of my head:

  • Pack blindly by default, use the existing flag to turn automatic off and then rely on annotations and flags (?) to place. The flags could have a type name / path or an entire crate.
  • Different built-in packing and spilling strategies controlled by flags (largest first, smallest first, etc)
  • Use https://github.com/rust-lang/rust-project-goals/issues/254 to hand control to user code?
Ngôn ngữ chính
Rust
Star
5.4k
Fork
251
Merge trung bình
4 ngày 15 giờ
Pull request đã merge (30 ngày)
4

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 Rust-GPU/rust-cuda

Tất cả issue của Rust-GPU/rust-cuda

Issue tương tự

Thêm issue về Rust

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.