aai-institute / aai-institute/pyDVL

Implement two-level caching on utility (level 1) and subset of indicies (level 2).

Đang mở
#475 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
146
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Running a benchmark with multiple experiments results in similar calls to the utility object. In between experiments one has to decide if the cache needs to be emptied or not.

Despite the same samples CWS can't use the same cache as TMC. Abstractly speaking it might happen that there are multiple experiments `E1`, `E2`, `E3`. Assume the transition form `E1` to `E2` invalidates the cache, but `E3` can reuse the cache. By imposing the algorithmic knowledge when to invalidate caches on the user we disable the access to certain features to others. It would be favorable if there are multiple experiment caches. These high level caches might use a `LRU(10)` policy (the sub objects might use a `LRU(10000)` policy).

Verifying, that the same cache can be reused from a historic experiment `EH`, can be done with a signature of the utility object. As the value of the utility depends on the model, dataset and scorer. It also depends on the valuation method in our current state (CWS imposes a modified scorer), but this would be caught by estimating the equivalence of the scorer in the signature.

So my proposal would be to add:

- [ ] Calculate signature of utility function to be used for caching
- [ ] (Optional) Signature is a premature check and might be improved by using statistic sampling of input and output values
- [ ] Pass two numbers, `n_low_level` and `n_high_level` for specifying size of both `LRU` policies.
- [ ] Update documentation

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue mô tả việc thêm bộ nhớ đệm LRU hai cấp cho các utility object trong pyDVL. Trước tiên, hãy xác định phần triển khai utility object và cơ chế caching hiện tại của chúng. Tìm hiểu cách các thí nghiệm được chạy và các lời gọi utility được thực hiện ở đâu. Chữ ký để tái sử dụng cache có thể sẽ liên quan đến việc băm model, dataset và scorer. Tìm các triển khai LRU cache hiện có hoặc cân nhắc sử dụng functools.lru_cache. Cập nhật tài liệu để giải thích các tham số caching mới và hành vi của chúng.

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
machine-learning, performance
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
35/100

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.