⚡ Bolt: MMLE-EM M-step 연산 성능 향상을 위한 벡터화 적용 - #173
Conversation
- `python/fast_mlsirm/estimators/mmle.py`의 `fit_mmle_2pl` 함수에서 문항 차원에 대해 수행되던 파이썬 `for` 루프를 제거 - `active_mask`를 활용한 벡터화된 NumPy 2차원 행렬 곱(`@`)을 도입하여 파이썬 인터프리터 오버헤드 대폭 감소 - `.jules/bolt.md`에 관련된 성능 최적화 학습 기록 추가
|
👋 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. |
- `python/fast_mlsirm/estimators/mmle.py`의 `fit_mmle_2pl` 함수에서 문항 차원에 대해 수행되던 파이썬 `for` 루프를 제거 - `active_mask`를 활용한 벡터화된 NumPy 2차원 행렬 곱(`@`)을 도입하여 파이썬 인터프리터 오버헤드 대폭 감소 - `.jules/bolt.md`에 관련된 성능 최적화 학습 기록 추가
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 headd8baedeb6af52cca37bf8f105aa5d6b2422c229e. -
Head SHA:
d8baedeb6af52cca37bf8f105aa5d6b2422c229e -
Workflow run: 29561909677
-
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 (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 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 (3 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (3 files)"]
R1 --> V1["required checks"]
|
|
중복 정리: 배경: 2026-07-14 이후 조직 coverage-evidence 인프라 문제로 모든 PR이 REQUEST_CHANGES 상태였습니다(인프라 수정: ContextualWisdomLab/.github#611). 필요 시 재오픈 가능합니다. Generated by Claude Code |
Understood. Acknowledging that this work is a duplicate of #162 and is now obsolete. Stopping work on this task. |
💡 What (구현된 최적화 내용)
python/fast_mlsirm/estimators/mmle.py내fit_mmle_2pl함수(M-Step)에 존재하던 거대한 문항(item) 차원에 대한 스칼라 파이썬 루프(for i in range(n_items))를 제거했습니다. 대신,active_mask를 도입하여 모든 비수렴 문항을 한 번에 처리하는 완전 벡터화된 NumPy 행렬 곱(@) 방식의 Newton-Raphson 업데이트 로직을 구현했습니다.🎯 Why (해결하고자 하는 성능 문제)
전통적인 파이썬 환경에서 배열의 크기가 클 경우 명시적인
for루프 안에서 수행되는 스칼라 연산(예:(resid * nodes).sum())들은 파이썬 인터프리터의 오버헤드로 인해 치명적인 성능 병목을 발생시킵니다. 대규모 문항 은행을 처리할 때 반복되는 이 M-Step의 내부 루프가 전체 EM 알고리즘 실행 시간을 지배하는 주원인이었습니다.📊 Impact (예상되는 성능 향상)
🔬 Measurement (개선 사항 검증 방법)
python -m pytest tests및cargo test --workspace명령을 통해 원래 코드의 수학적, 기능적 동치성이 완벽하게 유지되었는지 검증할 수 있습니다.n_items데이터를 생성하여 기존 구현체와 새로운 구현체의 런타임을 비교하면 성능 향상을 뚜렷하게 관찰할 수 있습니다.PR created automatically by Jules for task 2948180657126372287 started by @seonghobae