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

Support running Pandas UDFs on GPUs in Python processes. #640

Merged
merged 72 commits into from
Sep 11, 2020

Conversation

firestarman
Copy link
Collaborator

@firestarman firestarman commented Sep 2, 2020

This PR is to add support to run Pandas UDFs on GPUs, mainly consisting of two things:

  1. Overriding all the 6 related plans to build GPU context of device and memory for Python processes.
  2. Introducing 2 new python modules rapids.worker and rapids.daemon to execute the GPU memory initialization by leveraging RMM Python APIs.

firestarman and others added 26 commits August 6, 2020 15:38
Fixing an EOFExcetpion by creating a new file object on the same
socket as output of the python worker process.
- Add a new object `PythonWorkerSemaphore`.
- Add a new conf `spark.rapids.python.concurrentPythonWorkers`
- Change class GpuSemaphore from `private` to `private[rapids]`
- Let GpuSemaphore support not to initialize the GPU
Currently the limitation only works when pool memory
is enabled.
- Separate the configs for Python.
- Add `OptionalConfEntry` for Python configs
including 5 types
  SQL_MAP_PANDAS_ITER_UDF
  SQL_GROUPED_AGG_PANDAS_UDF
  SQL_GROUPED_MAP_PANDAS_UDF
  SQL_SCALAR_PANDAS_ITER_UDF
  SQL_SCALAR_PANDAS_UDF
by 4 physical plans
  GpuMapInPandasExec
  GpuAggregateInPandasExec
  GpuFlatMapGroupsInPandasExec
  GpuArrowEvalPythonExec

along with a API update in python/worker.
These two types are
  SQL_COGROUPED_MAP_PANDAS_UDF and
  SQL_WINDOW_AGG_PANDAS_UDF,
mapping to
  GpuFlatMapCoGroupsInPandasExec and
  GPuWindowInPandasExec
respectively.
Fixing an EOFExcetpion by creating a new file object on the same
socket as output of the python worker process.
- Add a new object `PythonWorkerSemaphore`.
- Add a new conf `spark.rapids.python.concurrentPythonWorkers`
- Change class GpuSemaphore from `private` to `private[rapids]`
- Let GpuSemaphore support not to initialize the GPU
Currently the limitation only works when pool memory
is enabled.
- Separate the configs for Python.
- Add `OptionalConfEntry` for Python configs
including 5 types
  SQL_MAP_PANDAS_ITER_UDF
  SQL_GROUPED_AGG_PANDAS_UDF
  SQL_GROUPED_MAP_PANDAS_UDF
  SQL_SCALAR_PANDAS_ITER_UDF
  SQL_SCALAR_PANDAS_UDF
by 4 physical plans
  GpuMapInPandasExec
  GpuAggregateInPandasExec
  GpuFlatMapGroupsInPandasExec
  GpuArrowEvalPythonExec

along with a API update in python/worker.
These two types are
  SQL_COGROUPED_MAP_PANDAS_UDF and
  SQL_WINDOW_AGG_PANDAS_UDF,
mapping to
  GpuFlatMapCoGroupsInPandasExec and
  GPuWindowInPandasExec
respectively.
revans2
revans2 previously approved these changes Sep 10, 2020
@revans2
Copy link
Collaborator

revans2 commented Sep 10, 2020

build

@firestarman
Copy link
Collaborator Author

build

@firestarman
Copy link
Collaborator Author

build

@revans2
Copy link
Collaborator

revans2 commented Sep 10, 2020

This looks good to me if you don't have any other things you want to get in feel free to merge it.

@firestarman firestarman merged commit ade7a5f into NVIDIA:branch-0.2 Sep 11, 2020
@firestarman firestarman deleted the pandas-udf branch September 17, 2020 06:21
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
Add support to run Pandas UDFs on GPUs, mainly consisting of two things:

Overriding all the 6 related plans to build GPU context of device and memory for Python processes.
Introducing 2 new python modules rapids.worker and rapids.daemon to execute the GPU memory initialization by leveraging RMM Python APIs.

Signed-off-by: Firestarman <[email protected]>

Co-authored-by: Liangcai Li <[email protected]>
Co-authored-by: Robert (Bobby) Evans <[email protected]>
Co-authored-by: shotai <[email protected]>
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
Add support to run Pandas UDFs on GPUs, mainly consisting of two things:

Overriding all the 6 related plans to build GPU context of device and memory for Python processes.
Introducing 2 new python modules rapids.worker and rapids.daemon to execute the GPU memory initialization by leveraging RMM Python APIs.

Signed-off-by: Firestarman <[email protected]>

Co-authored-by: Liangcai Li <[email protected]>
Co-authored-by: Robert (Bobby) Evans <[email protected]>
Co-authored-by: shotai <[email protected]>
tgravescs pushed a commit to tgravescs/spark-rapids that referenced this pull request Nov 30, 2023
Signed-off-by: Peixin Li <[email protected]>

Signed-off-by: Peixin Li <[email protected]>
tgravescs pushed a commit to tgravescs/spark-rapids that referenced this pull request Nov 30, 2023
* Update submodule cudf to f817d96d8bdc47da9fb2725d0e5a7b18586a29ee (NVIDIA#635)

Signed-off-by: spark-rapids automation <[email protected]>

Signed-off-by: spark-rapids automation <[email protected]>

* Fixing empty columns when casting to integer or decimal crashing (NVIDIA#633)

* fixing empty columns

Signed-off-by: Mike Wilson <[email protected]>

* cudf submodule commit to v22.10.00 (NVIDIA#640)

Signed-off-by: Peixin Li <[email protected]>

Signed-off-by: Peixin Li <[email protected]>

* try use new token to fix automerge permission

* verify automerge fix of Token permission (NVIDIA#643)

Signed-off-by: Peixin Li <[email protected]>

Signed-off-by: Peixin Li <[email protected]>

* Revert not working automerge fix [skip ci] (NVIDIA#644)

* Revert "verify automerge fix of Token permission (NVIDIA#643)"

This reverts commit 8261117.

* Revert "try use new token to fix automerge permission"

This reverts commit 2a9acde.

Signed-off-by: Peixin Li <[email protected]>

Signed-off-by: Peixin Li <[email protected]>

* Auto-merge use submodule in BASE ref

Signed-off-by: Peixin Li <[email protected]>

Signed-off-by: spark-rapids automation <[email protected]>
Signed-off-by: Mike Wilson <[email protected]>
Signed-off-by: Peixin Li <[email protected]>
Co-authored-by: Jenkins Automation <[email protected]>
Co-authored-by: Mike Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants