-
Notifications
You must be signed in to change notification settings - Fork 435
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
[GLUTEN-7837][VL] Spark driver should not initialize cache if not in local mode #7853
Conversation
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?
See also: |
aab6184
to
cd23366
Compare
cd23366
to
eada4df
Compare
eada4df
to
8225aae
Compare
@zhztheplayer can you help review? |
@leoluan2009 Does this solve the cache issue mentioned in #7837? |
Yes, if VeloxBackend is running in driver, it will not init cache. |
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.
How does the change work with Spark local mode? I mean we may need to turn the cache on in local mode if user doesn't explicitly disable it.
cpp/velox/compute/VeloxBackend.cc
Outdated
@@ -195,7 +195,7 @@ void VeloxBackend::initJolFilesystem() { | |||
} | |||
|
|||
void VeloxBackend::initCache() { | |||
if (backendConf_->get<bool>(kVeloxCacheEnabled, false)) { | |||
if (backendConf_->get<bool>(kVeloxCacheEnabled, false) && !isDriver_) { |
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.
Could just change from the caller code, something like:
if (!isDriver_) {
initCache();
}
...
Would be enough and more readable.
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
00ef9b1
to
c2c0829
Compare
Hi @leoluan2009 , as |
it's ok and I will update the pr |
c2c0829
to
8071db6
Compare
@zhztheplayer I have updated this PR, please help to review, thanks! |
val parsed = GlutenConfigUtil.parseConfig(conf.getAll.toMap) | ||
var parsed = GlutenConfigUtil.parseConfig(conf.getAll.toMap) | ||
if (isDriver && !inLocalMode(conf)) { | ||
parsed += (GlutenConfig.COLUMNAR_VELOX_CACHE_ENABLED.key -> "false") |
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.
Would you like to add some comments in code? Or just leave a link to the relevant issue/PR. Thanks.
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, thanks
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.
👍
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala
Outdated
Show resolved
Hide resolved
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala
Outdated
Show resolved
Hide resolved
8071db6
to
604abc3
Compare
604abc3
to
a9dd5d7
Compare
@zhztheplayer resolved all comments |
@zhztheplayer @leoluan2009 If we have more than one, we should considered to seperate the initialization routine for driver and worker. |
Not much difference so far and it's also about our C++ API's encapsulation. We can make trade-offs once it's really needed. |
In future there will be different ways to implement differentiated initialization, but exposing Spark arch conceptions "driver" / "executor" / "task" to C++ code could be the last ones to consider. We can use configurations, or compose finer-grained JNI initialization APIs, etc. |
Let's re-evaluate the mythology once we have another exception. |
What changes were proposed in this pull request?
Fixes: #7837
Spark driver should not initialize cache if not in local mode
How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)