Skip to content

[core] Don't preload jemalloc for worker. - #39446

Merged
fishbone merged 4 commits into
ray-project:masterfrom
fishbone:no-je-worker
Sep 8, 2023
Merged

fishbone merged 4 commits into
ray-project:masterfrom
fishbone:no-je-worker

Conversation

@fishbone

@fishbone fishbone commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Some library is not compatible with jemalloc. This PR disable jemalloc for python workers.

Related issue number

Checks

Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
@rkooo567

rkooo567 commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

https://buildkite.com/ray-project/release-tests-pr/builds/52730#018a747a-c579-482c-8082-3c90eb54337a

passes,

cc @krfricke @can-anyscale did it fail consistently in the release branch>? How many times should we run to verify it is fixed?

@rkooo567

rkooo567 commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

Running lightgbm_tune_4x16 now https://buildkite.com/ray-project/release-tests-pr/builds/52784

@rkooo567

rkooo567 commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

test_advanced_4.py failure seems related

@rkooo567 rkooo567 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iycheng actually, I don't thnk I understand how this disables jemalloc only in workers. can you tell me some details?

@fishbone

fishbone commented Sep 8, 2023

Copy link
Copy Markdown
Contributor Author

@iycheng actually, I don't thnk I understand how this disables jemalloc only in workers. can you tell me some details?

Worker is started by raylet and raylet has LD_PRELOAD setup, so worker will have this too. Remove it will remove it from the worker.

@fishbone
fishbone merged commit 504757e into ray-project:master Sep 8, 2023
fishbone added a commit to fishbone/ray that referenced this pull request Sep 8, 2023
Some library is not compatible with jemalloc. This PR disable jemalloc for python workers.
GeneDer pushed a commit that referenced this pull request Sep 9, 2023
Some library is not compatible with jemalloc. This PR disable jemalloc for python workers.
jimthompson5802 pushed a commit to jimthompson5802/ray that referenced this pull request Sep 12, 2023
Some library is not compatible with jemalloc. This PR disable jemalloc for python workers.

Signed-off-by: Jim Thompson <[email protected]>
fishbone pushed a commit that referenced this pull request Sep 18, 2023
fishbone added a commit that referenced this pull request Sep 18, 2023
vymao pushed a commit to vymao/ray that referenced this pull request Oct 11, 2023
Some library is not compatible with jemalloc. This PR disable jemalloc for python workers.

Signed-off-by: Victor <[email protected]>
@Myasuka

Myasuka commented Aug 13, 2024 •

Copy link
Copy Markdown
Contributor

It seems I cannot enable Jemalloc on worker via setting the env "RAY_LD_PRELOAD": "0", I wonder how can I preload Jemalloc for workers? @fishbone

In other words, it seems this PR disabled Jemalloc totally for workers.

Myasuka added a commit to Myasuka/ray that referenced this pull request Jun 9, 2025
We can set `RAY_LD_PRELOAD_ON_WORKERS` as `true` with `RAY_JEMALLOC_LIB_PATH` and `RAY_JEMALLOC_PROFILE` provided to also preload jemalloc for worker.
This is a fix after ray-project#39446

Signed-off-by: Yun Tang <[email protected]>
edoakes pushed a commit that referenced this pull request Jun 9, 2025
The PR #39446 disables preloading
Jemalloc for workers totally. However, Jemalloc is still useful in some
cases, and we could make it configurable if user setting env
RAY_LD_PRELOAD as 0.

The batch inference example code, using a TF model to infer the batch
input of numpy's ndarray.
~~~python
ds = ray.data.read_tfrecords(xxx)
ds.map_batches(BatchPredictor)
.map_batches(BatchPostProcessor)
.write_parquet(path=output_path
~~~

I did a inference test with limited memory, and we can see the OOM
counts decrease from 900+ to 700.

Closes #47242

Signed-off-by: Yun Tang <[email protected]>
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.

Release test lightgbm_train_moderate.aws failed Release test lightgbm_tune_4x16.aws failed

4 participants