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] VeloxBackend should know it run in executor or driver #7837

Open
leoluan2009 opened this issue Nov 7, 2024 · 10 comments · May be fixed by #7853
Open

[VL] VeloxBackend should know it run in executor or driver #7837

leoluan2009 opened this issue Nov 7, 2024 · 10 comments · May be fixed by #7853
Labels
enhancement New feature or request

Comments

@leoluan2009
Copy link
Contributor

Description

VeloxBackend show know where it run, executor or driver? for example if if run driver ,it should not init velox cache. There are two methods to this enhancement:

  1. pass a config spark.gluten.isDriver when creating VeloxBackend instance, this is simple.
  2. Add a member variables in VeloxBackend class, need to change jni code.
@leoluan2009 leoluan2009 added the enhancement New feature or request label Nov 7, 2024
@leoluan2009
Copy link
Contributor Author

@zhztheplayer @zhouyuan can you give some thoughts? thanks!

@zhztheplayer
Copy link
Member

Driver and executor do have different plugin entrypoints, https://github.com/apache/incubator-gluten/blob/main/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala, are you suggesting a new approach?

@zhztheplayer zhztheplayer changed the title VeloxBackend should know it run in executor or driver [VL] VeloxBackend should know it run in executor or driver Nov 7, 2024
@leoluan2009
Copy link
Contributor Author

leoluan2009 commented Nov 7, 2024

Driver and executor do have different plugin entrypoints, https://github.com/apache/incubator-gluten/blob/main/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala, are you suggesting a new approach?

But in VeloxBackend.cc, we can not know where it run. The info do not pass from java code to cpp code

@zhztheplayer
Copy link
Member

Driver and executor do have different plugin entrypoints, https://github.com/apache/incubator-gluten/blob/main/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala, are you suggesting a new approach?

But in VeloxBackend.cc, we can not know where it run. The info do not pass from java code to cpp code

I see. Do you know which part of C++ code requires for this information?

@leoluan2009
Copy link
Contributor Author

Driver and executor do have different plugin entrypoints, https://github.com/apache/incubator-gluten/blob/main/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala, are you suggesting a new approach?

But in VeloxBackend.cc, we can not know where it run. The info do not pass from java code to cpp code

I see. Do you know which part of C++ code requires for this information?

if it run in driver, it should not init velox cache. https://github.com/apache/incubator-gluten/blob/main/cpp/velox/compute/VeloxBackend.cc#L197

@zhztheplayer
Copy link
Member

zhztheplayer commented Nov 7, 2024

I am curious why it matters to initialize the cache in driver or not. Do you already see some issues or errors in your circumstance?

BTW I'll prefer changing the JNI API to have different paths for driver / executor native initializations if we have to do it.

@leoluan2009
Copy link
Contributor Author

I am curious why it matters to initialize the cache in driver or not. Do you already see some issues or errors in your circumstance?

BTW I'll prefer changing the JNI API to have different patches for driver / executor native initializations if we have to do it.

Yes, when initialize the cache, it will create cache dir and check remaining disk capacity while spark driver node may has smaller disk than executor.

@FelixYBW
Copy link
Contributor

FelixYBW commented Nov 7, 2024

Do we start any Velox pipeline on driver today? Where the cache is initialized?

Looks only the BHJ's hash build may be run on driver which we haven't implemented yet.

@LoseYSelf
Copy link

Do we start any Velox pipeline on driver today? Where the cache is initialized?

Looks only the BHJ's hash build may be run on driver which we haven't implemented yet.

this line will check ssd space.

const std::filesystem::space_info si = std::filesystem::space(ssdCachePathPrefix, ec);

@FelixYBW
Copy link
Contributor

FelixYBW commented Nov 7, 2024

Thank you. Then we should initialize velox on driver and worker differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants