4 ms·
Which is an interesting aside, but unless I'm missing something the amount of wastage due to the prefetcher isn't at all proportional to the number of available
by mastax 3y ago
Which is an interesting aside, but unless I'm missing something the amount of wastage due to the prefetcher isn't at all proportional to the number of available memory channels so it's non sequitur.
- bayindirh 3y agoNo, the wastage is due to because I'm not accessing data in a "linear" fashion if I lay out the matrices naively (actually pulling n by n square submatrices from the big matrix), and prefetcher brings in data with its baked in locality rules, but its assumptions doesn't fit my access pattern. So 20 percent of the data is thrown away. If I change how I fill and lay my matrices out, I can align my data with how prefetcher assumes, and way less data will be trashed during the process. I didn't do that because it needed a codebase-wide refactorization, and my code was already 30x faster than reference implementation with better accuracy, so we didn't pursue that avenue.
- bobim 3y agoInteresting, but is it even possible to optimize access to very sparse and unstructured matrices from finite elements?
- bayindirh 3y agoMy matrices are dense. I’m working with boundary elements. But, there are sparse optimized libraries for efficient storage and access to sparse matrices (e.g.: Eigen has both sparse and dense sub-libraries). Also, there’s a whole literature concerned with sparse matrices and operations on those. However, my knowledge is limited on sparse side. If you want, I might try to dig into it a bit.