New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi threaded version breaks on some queries (even with 1 thread) #56
Comments
So I think the That said those whole shenanigans with |
This depends, but extensive experiments have been performed before I initially implemented it with the distinction. The speedup for joins once all data is in memory was significant. I don't have archived results but the code should be in the Broccoli repository somewhere (I think the folder is called "trials" or something like that) Sure, if you only consider benchmarks that have to read everything from disk (e.g. every queries touches completely different relations), the speedup may be rather insignificant. But there are many cases where that isn't the bottleneck. To give a few examples: (1) The initial motivation: Broccoli-style queries. Some lists (just think of type.object.name) are taken from cache across queries and intersected / merged with tiny lists that are read freshly. More than that: queries are built incrementally. (2) Text operations that become leaves in the query tree. Writing variable size results somehow lead (3) Queries building cartesian products and thus producing long outputs form rather small (disk-read) input lists. I'm sure there are more cases, I cannot think of right now. If anything one COULD re-evaluate the feature and maybe hope that compiler optimizations for fixed-sized but not explicitly marked std::vectors became even better and somehow the feature has less impact overall now. |
PS: Unlike the split, though, the changing the sentinels-based intersections (and thus the const cast) to do classic bounds checking, could maybe be accomplished without significant time lost |
Interesting, yes I realize that there are significant in-memory performance considerations, still the impact on maintainability seems very very high. That said Anyway back on topic, I've tried adding debug code here to print the 0-th values (both via the const and non-const refs). And it's really weird: Single:
Multi:
so the data looks to be at least partially the same and not completely garbage and yet the Join yields no results in the multi thread case. I also tried forcing the non-galloping case this also doesn't yield a result. Interestingly when debugging that it does find the sentinal value. |
I did some testing with the freebase dataset and the query, and was able to reproduce the bug. |
It appears that pread does not read the entire object.type relation, leaving part of the ResultTable unfilled as the File class currently does not check the return value of the pread call. |
Looking at the return value of |
Working on a query set among about 50 queries that work fine with the multi threaded version I found the following query that gives no results on the multi threaded version but 3580 results on a8b495b (just before the addition of multi threading)
I'm still investigating but it seems that somehow join of fixed size tables is broken.
Here is debug output from the single thread version
singlethread.txt
And from the multi thread version
multithread.txt
Apart from the more verbose output because of the LRUCache changes and it being in TRACE mode the problems seems to occur at the following point (Note the end):
Single:
Multi:
Looking at the code there is a somewhat dangerous looking const-removal in the galloping code here, especially since the code is called with
_fixedSizeData
casted tostd::vector<std::array>
here but I'm not sure about the root cause yetThe text was updated successfully, but these errors were encountered: