Skip to content

Conversation

@jonahsamost
Copy link

Optimzed the logcumsumexp forward/backward by mainly moving things to float32 with no precision issues. In the forward I removed an unncessary branch. In the backward I added a fused multiply add.

logcumsumexp (N=4194304, 512x64x128)
  optimized correctness: forward=ok(2.38e-06), backward=ok(1.19e-06)
    forward            60.6 us  540.58 M elem/s
    backward          247.9 us  132.20 M elem/s
  forward (opt)       14.3 us  2286.18 M elem/s  4.23x speedup
  backward (opt)      10.2 us  3198.31 M elem/s  24.19x speedup
    forward (torch)    61.4 us  533.59 M elem/s
    backward (torch)  247.9 us  132.20 M elem/s
    forward (cpp)      28.7 us  1143.12 M elem/s
    backward (cpp)     89.1 us  367.96 M elem/s
    forward (graph)    25.6 us  1278.54 M elem/s
    ```

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.

1 participant