Skip to content

Optimized dot and iamax routines#84

Merged
tdehoff merged 9 commits into
mainfrom
tatiana-opt
Apr 16, 2026
Merged

Optimized dot and iamax routines#84
tdehoff merged 9 commits into
mainfrom
tatiana-opt

Conversation

@tdehoff

@tdehoff tdehoff commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Significantly improves the performance of dot and iamax routines.
Tested on float32, n = 134217728:
iamax was 5.24083 GBs, now 1032.5771.
dot was 631.325 GBs, now 1418.0388.

@tdehoff tdehoff requested a review from jacksonmowry April 15, 2026 18:30
@tdehoff

tdehoff commented Apr 15, 2026

Copy link
Copy Markdown
Owner Author

nrm2 was 380.57462 GBs, now 1104.4181 GBs.
It looks like you can't do sqrt on float64s on NVIDIA, so I cast to Float32 before applying sqrt. Surprisingly, it still passes correctness tests on my side.

@jacksonmowry

Copy link
Copy Markdown
Collaborator

I'm seeing ~2% of dot tests fail when I run 500 tests on both the main branch and for this PR. So nothing got worse, but something we should probably look into in the future. I'll create an issue for it.

Other than that looks good!

@tdehoff

tdehoff commented Apr 16, 2026

Copy link
Copy Markdown
Owner Author

@jacksonmowry it looks like BLAS++ uses check_gemm function to test dot error: https://github.com/icl-utk-edu/blaspp/blob/master/test/test_dot_device.cc. I'll fix our tests and see if this helps.

@tdehoff tdehoff closed this Apr 16, 2026
@tdehoff tdehoff reopened this Apr 16, 2026
@tdehoff tdehoff merged commit 0d9d1a0 into main Apr 16, 2026
2 checks passed
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