Make size of TOS cache configurable
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
TOS caching was introduced by https://github.com/python/cpython/issues/135379, but it only supports a fixed number of registers.
We should make it configurable, so that we can choose the optimum number of registers for any hardware/OS combination.
Probably the simplest way to do this is to generate executor cases and stencils code for up to the overall maximum number of registers, and guard each case/function with an #if MAX_CACHED_REGISTER > N where N is the number of registers needed for that variant.
Some cases/functions will also need to guarded for when MAX_CACHED_REGISTER is too low.
For example the ideal number of output registers for _BINARY_OP variants is 3.
For machines where MAX_CACHED_REGISTER < 3, we will need to generate variants with outputs < 3, but we want to exclude those variants for machines with MAX_CACHED_REGISTER >= 3
Overall this could result in generating a lot more code, probably more than double, but if MAX_CACHED_REGISTER is unchanged then the executable size should also be unchanged.
If we increase the MAX_CACHED_REGISTER to 4 or 5 we would expect the stencils and supporting tables to increase by ~35% and ~80% respectively (growth being a bit more than linear as some instructions have N**2 variants)
Linked PRs
- gh-145830
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách đọc issue 135379 và phần công việc được liên kết trong PR 145830, sau đó lần theo các đường dẫn tạo thanh ghi và stencil của bộ nhớ đệm TOS được mô tả ở đây. Công việc được xem là hoàn tất khi MAX_CACHED_REGISTER có thể chọn các biến thể phù hợp cho những tổ hợp phần cứng và hệ điều hành khác nhau, đồng thời vẫn giữ nguyên hành vi về kích thước tệp thực thi như đã nêu khi không có thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100