OpenMathLib / OpenMathLib/OpenBLAS

Performance variability

Open
#3,879 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
7.6k
Forks
1.7k
Avg merge
1d 3h
Merged PRs (30d)
42

Description

I am observing a lot of performance variability for matrix multiplication in sizes ranging from ~100 to ~1000 I have been investigating this without a lot of success. The timing can be up to twice as large, depending on the order in which I run the benchmarks. However, for any chosen order, the accuracy of the timing is high.

I am a bit at a loss here. Because the order only influences the position in memory of the input data to the benchmarks, I am inclined to think that this may be a memory alignment issue. The position of the matrices in the heap is rounded only to 16 bytes (double floats, alignment imposed by C++), but not to any other size and perhaps there is some kind of SIMD code making some kind of ugly magic that disturbs my benchmarks?

I have tested this with serial, openmp and pthreads versions, on Linux and on Windows, with similar outcomes. This is an AMD Ryzen processor, but I have witnessed even greater variability on Intel.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reproducing matrix-multiplication timings for sizes around 100–1000 in the serial, OpenMP, and pthreads variants on the reported platforms and processor types. Done means identifying the source of the order-dependent variability and documenting a reproducible fix or confirmed cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.