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

[draft] Make xgboost spark support spark-connect #11050

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python-package/xgboost/spark/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,10 @@ def _run_job() -> Tuple[str, str]:
_train_booster, # type: ignore
schema="data string",
)
# TODO: In spark connect, use `dataframe.mapInPandas(..., barrier=True)`
# and remove `rdd.barrier().mapPartitions(lambda x: x)`
# and for stage scheduling, similarly, use
# `dataframe.mapInPandas(..., profile=...)` to set resource profile.
.rdd.barrier()
.mapPartitions(lambda x: x)
)
Expand Down Expand Up @@ -1384,6 +1388,8 @@ def _run_on_gpu(self) -> bool:

use_gpu_by_params = super()._run_on_gpu()

# TODO: To support spark connect, we can't use any SparkContext APIs,
# and we can't read any spark configurations. Remove them
if _is_local(_get_spark_session().sparkContext):
# if it's local model, no need to check the spark configurations
return use_gpu_by_params
Expand Down
Loading