-
Notifications
You must be signed in to change notification settings - Fork 179
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
Use new memory tracker for tile offsets #4929
Conversation
@@ -253,8 +253,7 @@ void SparseUnorderedWithDupsReader<BitmapType>::load_tile_offsets_data() { | |||
tile_offsets_min_frag_idx_ == std::numeric_limits<unsigned>::max() && | |||
tile_offsets_max_frag_idx_ == 0; | |||
uint64_t available_memory = | |||
array_memory_tracker_->get_memory_available() - | |||
array_memory_tracker_->get_memory_usage(MemoryType::TILE_OFFSETS); | |||
array_memory_tracker_->get_memory_available(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_memory_available should be changed so that tile offsets from the new counters are subtracted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done that.
72de436
to
2441e3d
Compare
4afb631
to
809c0bf
Compare
7ca6d12
to
14e35a7
Compare
a18b159
to
44d601e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add a few more comments please.
@@ -312,7 +312,10 @@ class MemoryTracker { | |||
*/ | |||
uint64_t get_memory_available() { | |||
std::lock_guard<std::mutex> lg(mutex_); | |||
return memory_budget_ - memory_usage_; | |||
if (memory_usage_ + counters_[MemoryType::TILE_OFFSETS] > memory_budget_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
// Finally set the size of the loaded data. | ||
ret[frag_idx] = num * tile_num * sizeof(uint64_t); | ||
ret[frag_idx] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to explain the 4 and 32.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
unsigned num_vectors = schema->attribute_num() + 1 + | ||
fragment->has_timestamps() + | ||
fragment->has_delete_meta() * 2; | ||
num_vectors += (fragment->version() >= 5) ? schema->dim_num() : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment on this line as to what it does... For fragments up to version 4, we use zipped coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// Other than the offsets themselves, there is also memory used for the | ||
// initialization of the vectors that hold them. This initialization | ||
// takes place in fragment_metadata.cc::load_footer() | ||
unsigned num_vectors = schema->attribute_num() + 1 + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the +1. I think it's the old zipped coords?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only thing I don't understand. What this +1 stands for. It is documented nowhere
// Other than the offsets themselves, there is also memory used for the | ||
// initialization of the vectors that hold them. This initialization | ||
// takes place in fragment_metadata.cc::load_footer() | ||
unsigned num_vectors = schema->attribute_num() + 1 + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned num_vectors = schema->attribute_num() + 1 + | |
unsigned num_fields = schema->attribute_num() + 1 + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Fixes the nightly tests in windows after #4929. The memory budgets tests were failing because structures take more memory in ASAN debug. Adjusting the budgeting values so they pass in all build flavors. Successful run here: https://github.com/TileDB-Inc/TileDB/actions/runs/9209028209. --- TYPE: NO_HISTORY DESC: Update budget tests to fix windows nightly builds.
This PR is responsible for two things:
[sc-46275]
TYPE: NO_HISTORY
DESC: Use new memory tracker for tile offsets.