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

[spark] Make xgboost spark support large model size #10984

Merged
merged 10 commits into from
Nov 7, 2024

Conversation

WeichenXu123
Copy link
Contributor

Spark RDD can't support one line with very long content.

To make large size model training / saving / loading works,
I split model json string to chunks when collecting model in training, and modify saving / loading code too.

Signed-off-by: Weichen Xu <[email protected]>
@wbo4958
Copy link
Contributor

wbo4958 commented Nov 6, 2024

LGTM for the functionality except the CI issue.

Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
@wbo4958
Copy link
Contributor

wbo4958 commented Nov 6, 2024

Could you run python tests/ci_build/lint_python.py --format=1 --type-check=1 --pylint=1 to check the python format

Signed-off-by: Weichen Xu <[email protected]>
@WeichenXu123
Copy link
Contributor Author

I can't fully understand the linter error:

xgboost/spark/core.py:1162: error: Incompatible types in assignment (expression has type "str", variable has type "Booster")  [assignment]
xgboost/spark/core.py:1164: error: Argument 1 to "len" has incompatible type "Booster"; expected "Sized"  [arg-type]
Found 2 errors in 1 file (checked 41 source files)

@wbo4958 any ideas ?

@trivialfis
Copy link
Member

@WeichenXu123 XGBoost's Python package uses Python typehint. In the following line:

booster = booster.save_raw("json").decode("utf-8")

The booster was a xgboost.Booster object, the decode("utf-8") however, returns a string. Assigning a string to a Booster type violates static typing.

Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
@wbo4958
Copy link
Contributor

wbo4958 commented Nov 7, 2024

LGTM if the CI can pass

@trivialfis trivialfis merged commit 6d84fa9 into dmlc:master Nov 7, 2024
29 of 31 checks passed
@WeichenXu123
Copy link
Contributor Author

@trivialfis Can we make a patch release to include this fix ? We have several customers facing the issue. thanks!

@trivialfis trivialfis mentioned this pull request Nov 12, 2024
4 tasks
@trivialfis
Copy link
Member

@WeichenXu123 #10992 .

trivialfis pushed a commit to trivialfis/xgboost that referenced this pull request Nov 19, 2024
trivialfis added a commit that referenced this pull request Nov 19, 2024
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.

3 participants