⚡ Bolt: BLAS 행렬 곱을 통한 alpha 그라디언트 및 EAP 계산 성능 향상 - #198
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head01da576f5474bd238e20a8dfd6b2392528d2a074. -
Head SHA:
01da576f5474bd238e20a8dfd6b2392528d2a074 -
Workflow run: 29765308309
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (4 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (4 files)"]
R1 --> V1["required checks"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage Decision
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (4 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (4 files)"]
R1 --> V1["required checks"]
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Optimizes two hot-path Python computations by replacing multiply-and-reduce patterns with BLAS-backed matrix products to reduce large intermediate allocations and improve runtime.
Changes:
- Reworked
grad_alphacomputation inneg_loglik_and_gradto use matrix multiplication instead of element-wise multiply + sum. - Reworked MMLE EAP
thetacalculation to useposterior @ nodesinstead of multiply + sum. - Updated changelog and internal optimization notes (
.jules/bolt.md) documenting the optimization approach.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| python/fast_mlsirm/objective.py | Replaces grad_alpha elementwise reduction with a BLAS matmul-based formulation. |
| python/fast_mlsirm/estimators/mmle.py | Replaces EAP theta elementwise reduction with a matmul (GEMV) formulation. |
| CHANGELOG.md | Documents the optimization (and mentions an additional lockfile sync). |
| .jules/bolt.md | Adds an internal note describing the matmul optimization pattern and rationale. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
`python/fast_mlsirm/objective.py` 및 `python/fast_mlsirm/estimators/mmle.py`에서 요소별 연산 후 차원 합을 구하는 과정을 수학적으로 동일한 행렬 곱셈(`@`)으로 대체하여 불필요한 중간 배열 할당을 피하고 캐시 지역성을 향상시켰습니다.
3df8249 to
1f107cd
Compare
…s; refresh head for re-review The previous CHANGES_REQUESTED verdict on this head was an infrastructure failure (the central coverage-evidence sandbox could not install numpy — fixed by ContextualWisdomLab/.github#611), not a code judgment. This commit documents the change and produces a fresh head so the scheduler dispatches a new review under the repaired pipeline.
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
python/fast_mlsirm/objective.py:142
np.arange(e.shape[1])is allocated twice in this hot path (once forgrad_alphaand again foridx[...] = a). Since this function is performance-critical, reuse a singleitem_idxarray to avoid repeated allocation and keep the optimized path allocation-free aside from the needed outputs.
grad_alpha = (e.T @ params.theta)[np.arange(e.shape[1]), factors] * a
# Optimized gradient computation: replace loop over dimensions with matrix multiplication
# We embed 'a' directly into the projection matrix to avoid a JxD intermediate array allocation during multiplication
idx = np.zeros((e.shape[1], params.theta.shape[1]), dtype=e.dtype)
|
Superseded: Bolt performance theme conflicts with current main (related landings e.g. #345 linear_predictor in-place ops). Closing as superseded; reopen from clean base if still valuable. |
|
Closing as superseded: Bolt theme already on main or blocked by unresolvable conflicts with current main. Prefer re-open from a fresh branch if still needed. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What:
python/fast_mlsirm/objective.py의alpha그라디언트 계산과python/fast_mlsirm/estimators/mmle.py의 EAPtheta계산에서 요소별 곱셈 후 차원 합(sum(axis=...))을 구하던 방식을 수학적으로 동일한 BLAS 기반 행렬 곱셈(@)으로 변경했습니다.🎯 Why: 기존 방식은
N x J또는N x Q크기의 거대한 중간 배열을 메모리에 할당하고 순회하는 오버헤드가 발생하여 성능 저하의 주요 원인이 되었습니다.📊 Impact:
objective.py의alpha그라디언트 계산 속도가 약 20배 향상되었습니다 (테스트 벤치마크 기준 1.00s -> 0.05s).mmle.py의theta계산 속도가 약 10배 향상되었습니다 (테스트 벤치마크 기준 6.83s -> 0.71s).🔬 Measurement: 수정한 수식이 정확하게 일치하는지 확인하기 위한 테스트 코드를 작성해 최대 오차가 허용 오차 범위 내(
~10^-15)에 들어오는 것을 확인하였으며,pytest를 실행하여 기존 테스트 스위트가 모두 통과하는 것을 확인했습니다. 또한 성능 측정 스크립트를 사용하여 최적화 전후의 실행 시간을 비교했습니다.PR created automatically by Jules for task 7118363944566956552 started by @seonghobae