Comments (4)
This is an unfortunate situation that has been getting worse. Although C++ standards carefully specify how the random number generators should behave, they do not do the same for uniform_int_distribution
(reddit post). With seeding, the generator will produce the same values, but the distribution will not. When this codebase was first constructed, gcc, clang, icc, and suncc used the same distribution algorithm. Recently, there has been some divergence. On a linux box, g++ 9.4 and clang++ 12 produce the same right answer. However, on my mac, Apple clang 14 and g++-12 produce different results.
Fortunately, for those concerned about running the exact same benchmark graphs, SuiteSparse captured the graphs a couple years ago (https://sparse.tamu.edu/GAP).
I'm going to leave this issue open, since the only solutions I can think of are unsatisfactory. I would be grateful if anyone has a better idea. So far, the options I can think of all have downsides:
- Do nothing - Although randomly generated graphs will be subtly different, for most research purposes this is ok. The most worrisome part is a unit test not passing. For now, GitHub's CI is using a compiler that still has the same distribution function, so it is still passing.
- Replace the distribution with
%
- This will be portable, however, modulus can add bias to the distribution. This is especially likely as the range gets close to the size of the random numbers, which someone might do with SCALE=29 or SCALE=30. - Write a portable distribution function - This might be the least bad but the most work. Doing it well involves both removing bias as well as being high-performance. Typically, I duplicate functionality from the standard library as a last result.
- Make test case weaker - This might be an expedient solution, but then the test case may not be checking much.
from gapbs.
With CI failing, I checked to see the current state of which distribution each compiler is using.
In my lab, I had Linux boxes with gcc 9,10,11,13 and clang 12 and 14. Gcc 9 & 10 behaved like the original reference output. Gcc 11 onwards as well as the clang versions all behaved the same. With any luck, gcc & clang will continue to have the same implementation behavior.
Thus, going with a slightly modified version of option 1 (via commit 30197cf).
from gapbs.
Spoke too soon. Clang (14) on my Mac produces yet another answer.
Option 3 will probably be the best.
from gapbs.
I went with option 3 to further standardize this reference code.
from gapbs.
Related Issues (20)
- running on server with 32GB of RAM HOT 2
- The calculation of num_edges may cause problems. HOT 2
- "make test" dependency is missing HOT 1
- Unable to make bench-graphs HOT 1
- Generation of Kronecker graph HOT 4
- Atomic insert HOT 2
- Adding new kernels to the framework HOT 3
- Using graphs from LDBC HOT 2
- How to prove relabelling in triangle counting is effective? HOT 1
- How to set the path before we do CXX=g++-8 make HOT 1
- Segmentation fault found on SSSP HOT 2
- Certificate of the "web" dataset has expired HOT 3
- Issue in `converter` for machine with low config, can there other raw graph avaliable except twiter/sk/USA road? HOT 3
- Out-of-bounds access in builder.h? HOT 4
- Request help for additional function about get the start vertex from the file HOT 1
- bfs verification fails on kronecker graphs scale >= 16 HOT 5
- gzip error during make bench-graphs HOT 2
- Segmentation fault while running on large dataset HOT 6
- terminate called after throwing an instance of 'std::bad_array_new_length' HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gapbs.