Skip to content
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

[VL] Refine memory changes logic when growCapacity #5690

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Yohahaha
Copy link
Contributor

@Yohahaha Yohahaha commented May 10, 2024

What changes were proposed in this pull request?

Changes:

  1. add new config spark.gluten.sql.columnar.backend.velox.memInitCapacity to reduce memory arbitration times, default value is 8M.
  2. set memoryPoolTransferCapacity_ with spark.gluten.memory.reservationBlockSize, move reservation computation logic from SparkAllocationListener to Arbitrator.
  3. refactor backend-wise config usage.

Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/apache/incubator-gluten/issues

Then could you also rename commit message and pull request title in the following format?

[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}

See also:

Copy link

Run Gluten Clickhouse CI

4 similar comments
Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

@zhztheplayer
Copy link
Member

/Benchmark Velox

Comment on lines -351 to -365
int64_t reserve(int64_t diff) {
std::lock_guard<std::mutex> lock(mutex_);
bytesReserved_ += diff;
int64_t newBlockCount;
if (bytesReserved_ == 0) {
newBlockCount = 0;
} else {
// ceil to get the required block number
newBlockCount = (bytesReserved_ - 1) / blockSize_ + 1;
}
int64_t bytesGranted = (newBlockCount - blocksReserved_) * blockSize_;
blocksReserved_ = newBlockCount;
maxBytesReserved_ = std::max(maxBytesReserved_, bytesReserved_);
return bytesGranted;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does VeloxMemoryManager::arrowPool_ still use this code? Can we move it into another independent gluten::AllocationListener implementation which can wrap another listener? Like the way BacktraceAllocationListener adopted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I move such logic to ListenableMemoryAllocator.

Copy link

Run Gluten Clickhouse CI

1 similar comment
Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

@Yohahaha
Copy link
Contributor Author

/Benchmark Velox

@GlutenPerfBot
Copy link
Contributor

===== Performance report for TPCH SF2000 with Velox backend, for reference only ====

query log/native_5690_time.csv log/native_master_05_13_2024_33f993554_time.csv difference percentage
q1 34.21 36.42 2.209 106.46%
q2 22.09 23.70 1.605 107.27%
q3 36.89 36.61 -0.283 99.23%
q4 38.02 37.83 -0.196 99.48%
q5 67.51 70.62 3.102 104.59%
q6 7.16 7.47 0.308 104.30%
q7 82.76 85.08 2.312 102.79%
q8 85.58 84.30 -1.282 98.50%
q9 120.02 121.00 0.979 100.82%
q10 47.74 45.37 -2.377 95.02%
q11 20.43 19.49 -0.937 95.41%
q12 24.85 26.52 1.671 106.72%
q13 53.62 55.08 1.459 102.72%
q14 20.26 21.53 1.269 106.26%
q15 30.02 29.02 -1.003 96.66%
q16 14.15 14.00 -0.147 98.96%
q17 104.53 103.62 -0.913 99.13%
q18 147.87 146.24 -1.637 98.89%
q19 13.53 13.35 -0.179 98.68%
q20 26.61 29.06 2.447 109.19%
q21 283.71 282.54 -1.169 99.59%
q22 14.66 14.61 -0.051 99.65%
total 1296.26 1303.44 7.188 100.55%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants