Skip to content

exploit symmetry in the hessian - #837

Open
KristofferC wants to merge 1 commit into
masterfrom
kc/symmetric_hessian
Open

exploit symmetry in the hessian#837
KristofferC wants to merge 1 commit into
masterfrom
kc/symmetric_hessian

Conversation

@KristofferC

@KristofferC KristofferC commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Instead of relying on the Jacobian of gradient for the Hessian, explicitly seed dual numbers and only calculate the upper triangular part when chunking, gives ~2x speedup as input length becomes big

┌─────────────────────┬───────────────────┬───────────────────────┐
│      function       │         n         │        speedup        │
├─────────────────────┼───────────────────┼───────────────────────┤
│ rosenbrock / ackley │ 10 (single chunk) │ ~1.0x (no regression) │
├─────────────────────┼───────────────────┼───────────────────────┤
│ rosenbrock / ackley │ 30                │ 1.45x / 1.57x         │
├─────────────────────┼───────────────────┼───────────────────────┤
│ rosenbrock / ackley │ 100               │ 1.85x / 1.94x         │
└─────────────────────┴───────────────────┴───────────────────────┘

Fixes #836 cc @gdalle

Basically one-shotted by Claude and then decringified with gpt.

instead of relying on the jacobian of gradient for the hessian
explicitly seed dual numbers and only calculate the upper triangular part when chunking, gives ~2x speedup as input length becomes big
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.35802% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.44%. Comparing base (569af35) to head (0091edd).

Files with missing lines Patch % Lines
src/hessian.jl 91.35% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #837      +/-   ##
==========================================
- Coverage   90.68%   90.44%   -0.24%     
==========================================
  Files          11       11              
  Lines        1052     1120      +68     
==========================================
+ Hits          954     1013      +59     
- Misses         98      107       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Take advantage of symmetry in hessian

1 participant