Skip to content

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

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

[core] Don't preload jemalloc for worker.#39446
fishbone merged 4 commits intoray-project:masterfrom
fishbone:no-je-worker

Conversation

@fishbone
Copy link
Copy Markdown
Contributor

@fishbone fishbone commented Sep 8, 2023

Why are these changes needed?

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

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
@rkooo567
Copy link
Copy Markdown
Contributor

rkooo567 commented Sep 8, 2023

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
Copy link
Copy Markdown
Contributor

rkooo567 commented Sep 8, 2023

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

@rkooo567
Copy link
Copy Markdown
Contributor

rkooo567 commented Sep 8, 2023

test_advanced_4.py failure seems related

Copy link
Copy Markdown
Contributor

@rkooo567 rkooo567 left a comment

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
Copy link
Copy Markdown
Contributor Author

fishbone commented Sep 8, 2023

@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.

Signed-off-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
@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 <jimthompson5802@gmail.com>
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 <vctr.y.m@example.com>
@Myasuka
Copy link
Copy Markdown
Contributor

Myasuka commented Aug 13, 2024

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 <myasuka@live.com>
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 <myasuka@live.com>
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