Optimize CallawaySantAnna covariate path (5-19x speedup)#194
Optimize CallawaySantAnna covariate path (5-19x speedup)#194
Conversation
…hing Cache Cholesky factorizations of X^T X across (g,t) pairs that share the same control design matrix, eliminating redundant OLS solves. Cache propensity score coefficients for IPW/DR methods. Achieves 5-19x speedup on covariate regression path depending on k. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Overall assessment: ⛔ BlockerExecutive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Address PR #194 review feedback: - Include cohort g in cho_key and control_key for not_yet_treated control group, preventing stale Cholesky/matrix reuse across groups - Add UserWarning when group-time cells are dropped due to non-finite regression results in covariate reg path - Add not_yet_treated validation scenarios (dr_2cov_nyt, reg_2cov_nyt) - Add regression test for DR/reg + covariates + not_yet_treated Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: Executive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Verification note: I could not execute the test suite in this sandbox because the available Python environment does not have |
…gthen validation - Revert _linear_regression skip_rank_check regression (always check rank) - Add one-time rank check to batched covariate path with lstsq fallback - Add dual-key IF payloads (treated_units/control_units + treated_idx/control_idx) - Extend validate_results.py with p-value, CI, event-study, and tighter SE checks - Add test_rank_deficient_action_warn_emits_warning test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: Executive Summary
Methodology
Code Quality Performance Maintainability Tech Debt Security Documentation/Tests
|
…e-07 Fix batched reg path: compute kept_cols on rank deficiency, skip per-pair Cholesky when rank-deficient, solve reduced system with zero-fill for dropped columns. Fix DR path: check rank before caching Cholesky factor, use False sentinel for rank-deficient keys, zero NaN coefficients for prediction. Add cond=1e-07 to all lstsq calls for solve_ols consistency. Add ipw_2cov_nyt validation scenario, DR rank test, reg nyt rank test, and bootstrap single-unit cohort edge case test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Address five failure modes observed after gpt-5.4 upgrade (PRs #192, #194, #195): documented deviations flagged as blockers, deferred work not accepted, moving goalposts on re-review, undefined approval criteria, and valid implementation choices treated as methodology errors. Changes to pr_review.md: - Exempt REGISTRY.md-documented deviations from P0/P1 (classify as P3) - Add implementation choice exception for valid numerical approaches - Add Deferred Work Acceptance section honoring TODO.md tracking - Add Assessment Criteria with objective verdicts and mitigation rules - Add Re-review Scope rules to prevent oscillation between rounds Changes to ai_pr_review.yml: - Add step to fetch previous AI review comment for re-review context - Inject prior review findings into compiled prompt on /ai-review reruns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessmentExecutive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
…es, batch warnings, validator fields - Normalize covariates=[] to None to prevent crash in covariate dispatch - Preserve invalid regression cells as NaN instead of dropping (REGISTRY.md compliance) - Filter NaN effects from aggregation in simple, event study, and group methods - Add summary warnings to batch bootstrap stats for insufficient samples and zero SE - Extend validator field coverage to include t_stat, p_value, conf_int, group_effects - Re-save baselines with extended schema Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology Affected methods: Callaway-Sant’Anna ATT(g,t) with optimized covariate regression, and bootstrap aggregation of ATT(g,t) into overall/event-study/group effects. Cross-checking against the registry, the caching is a valid numerical optimization; the remaining issue is the bootstrap treatment of preserved
Code Quality No separate findings. The earlier Performance No findings. The Cholesky/logistic-coefficient caching is a reasonable implementation choice and does not look like a methodology defect on its own. Maintainability No separate findings beyond the bootstrap/analytical aggregation drift above. Tech Debt No separate findings. Security No findings. Documentation/Tests
Path to Approval
|
Summary
_compute_all_att_gt_covariate_reg()batched method for the reg+covariates path, mirroring the existing_compute_all_att_gt_vectorized()patternSpeedups at 5K units:
Methodology references (required if estimator / math changes)
Validation
benchmarks/speed_review/bench_callaway.py,benchmarks/speed_review/validate_results.pySecurity / privacy
Generated with Claude Code