Reuse the baseline across UK local-area breakdown runs

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đá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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, performance

Hướng nghiên cứu

Start by reading src/policyengine_simulation_executor/simulation_runtime.py, especially _uk_area_simulations, and inspect the JobStage.BASELINE spans to measure how much run time the baseline uses. If the cost is significant, compare the proposed cache and warm-worker options and choose an approach keyed by bundle, year, region, and the exact normalized baseline policy. Done means shared eligible runs reuse the baseline while disclosure checks and baseline stage reporting remain intact.

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

Mô tả

Problem

Each UK breakdown=local_areas run builds and computes its own baseline on the routed local-area dataset (_uk_area_simulations in projects/policyengine-simulation-executor/src/policyengine_simulation_executor/simulation_runtime.py). The baseline depends only on the bundle (model and dataset), the year, the region filter (UK-wide or a nation) and the baseline policy. For the usual case (current-law baseline), it is the same for every reform, but every breakdown request pays for it again.

The local-area dataset is the dense file, so the baseline is a large part of each breakdown's run time and cost.

Proposal

Reuse the baseline across breakdown requests that share the same bundle, year, region filter and baseline policy. Options:

  1. Cache the baseline's computed household-level outputs that the area builder reads (for example in the worker volume or object storage), keyed by bundle sha, year, region and a hash of the normalised baseline policy.
  2. Keep a warm baseline in the worker between jobs for the same key.

Things to keep: the disclosure checks, the stage reporting (JobStage.BASELINE), and an exact match on the baseline policy, so a custom baseline never reuses a current-law result.

Next step

Measure first: the share of a breakdown's run time that the baseline takes, from the stage spans. If it is large, choose option 1 or 2. Related: PolicyEngine/policyengine-app-v2#1411 (the app's duration estimate for a breakdown).

🤖 Generated with Claude Code

Ngôn ngữ chính
Python
Star
1
Fork
1
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
71

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

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 PolicyEngine/policyengine-sim-api

Tất cả issue của PolicyEngine/policyengine-sim-api

Issue tương tự

Thêm issue về Python

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.