Skip to content

testing: matrix forward mode, and (column-forward, row-reverse) mode.#3

Draft
mindeye33 wants to merge 5 commits into
mainfrom
batch-forward-mode-ad
Draft

testing: matrix forward mode, and (column-forward, row-reverse) mode.#3
mindeye33 wants to merge 5 commits into
mainfrom
batch-forward-mode-ad

Conversation

@mindeye33

Copy link
Copy Markdown
Collaborator

From these two different implementations, we're getting same speed as forward mode with the "matrix forward mode" which is good for sanity check I suppose.

The column-forward, row reverse, was to test our idea about mixing the different modes.

Next step is:
For the element-by-element forward mode, and the column-forward row-reverse mode, we should only constrain to the elements of env2 that are relevant.

@mindeye33

Copy link
Copy Markdown
Collaborator Author

Timing on my mac:

  • For small system:
./target/release/overhead molecules/h2/sto3g.txt                                                   
--- Timing Reverse Mode dS ---
count 4
total ovlp time:    0.000021 sec
total dovlp time:   0.000046 sec
average ovlp time:  0.000005 sec
average dovlp time: 0.000012 sec
avg overhead:       2.156284
--- Timing Forward Mode dS ---
count 4
total ovlp time:    0.000001 sec
total dovlp time:   0.000132 sec
average ovlp time:  0.000000 sec
average dovlp time: 0.000033 sec
avg overhead:       88.058706
--- Timing Matrix Forward Mode dS ---
AD calls:           6
primal time:        0.000002 sec
total dovlp time:   0.000159 sec
avg dovlp time:     0.000026 sec
avg overhead:       92.994145
--- Timing Row Reverse Mode dS ---
AD calls:           4
primal time:        0.000002 sec
total dovlp time:   0.000105 sec
avg dovlp time:     0.000026 sec
avg overhead:       49.588235
dS and dS_for match
env2.len() 6
  • And for bigger system:
./target/release/overhead molecules/c6h6/631g.txt                                                                   
--- Timing Reverse Mode dS ---
count 2304
total ovlp time:    0.001054 sec
total dovlp time:   0.016825 sec
average ovlp time:  0.000000 sec
average dovlp time: 0.000007 sec
avg overhead:       15.962207
--- Timing Forward Mode dS ---
count 2304
total ovlp time:    0.000916 sec
total dovlp time:   0.035719 sec
average ovlp time:  0.000000 sec
average dovlp time: 0.000016 sec
avg overhead:       39.001398
--- Timing Matrix Forward Mode dS ---
AD calls:           38
primal time:        0.000701 sec
total dovlp time:   0.039551 sec
avg dovlp time:     0.001041 sec
avg overhead:       56.454449
--- Timing Row Reverse Mode dS ---
AD calls:           10404
primal time:        0.000652 sec
total dovlp time:   3.121718 sec
avg dovlp time:     0.000300 sec
avg overhead:       4790.056028
dS and dS_for match
env2.len() 38

@ZuseZ4 ZuseZ4 force-pushed the batch-forward-mode-ad branch from 20d75fa to a87b15a Compare March 20, 2026 20:38
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.

2 participants