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

[train][ci] Fix tune_hvd_keras import order #39223

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

justinvyu
Copy link
Contributor

Why are these changes needed?

The test is failing due to the ordering of horovod and tensorboardX.SummaryWriter imports. This is a known issue: pytorch/pytorch#30651. This PR fixes it by moving the horovod import into the training loop -- to happen after the tensorboardX import on the driver.

The tests was passing before the xgboost_ray version bump, so there's probably some underlying package that got updated that's the root cause.

Reproduction of the bug

Horovod first, then tensorboard fails with a segfault:

>>> import horovod.keras as hvd
2023-09-01 10:13:20.236734: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-09-01 10:13:20.236757: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> from tensorboardX import SummaryWriter
2023-09-01 10:13:29.194509: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-09-01 10:13:29.194539: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Segmentation fault

Tensorboard first then horovod works:

>>> from tensorboardX import SummaryWriter
>>> import horovod.keras as hvd
2023-09-01 10:14:36.773923: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-09-01 10:14:36.773949: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

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: Justin Yu <[email protected]>
@matthewdeng matthewdeng merged commit 586e5be into ray-project:master Sep 1, 2023
2 checks passed
@justinvyu justinvyu deleted the fix_py37 branch September 1, 2023 21:32
LeonLuttenberger pushed a commit to jaidisido/ray that referenced this pull request Sep 5, 2023
matthewdeng pushed a commit to matthewdeng/ray that referenced this pull request Sep 7, 2023
GeneDer pushed a commit that referenced this pull request Sep 7, 2023
…39368)

* fix tune_hvd_keras (#39223)

Signed-off-by: Justin Yu <[email protected]>

* [train] New persistence mode: Add backwards compatibility support for `local_dir` (#39282)

Signed-off-by: Justin Yu <[email protected]>

* [train] Add TrainContext.get_storage (#39281)

Signed-off-by: Justin Yu <[email protected]>

* [train] New persistence mode: Deprecate experimental distributed checkpointing configs (#39279)

Signed-off-by: Justin Yu <[email protected]>

* [Release] Fix `air_example_dolly_v2_lightning_fsdp_finetuning` with large cpu mem head node (#39263)

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

* Remove all "ray.init" cell output in the example notebooks. (#39283)

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

* [train] New persistence mode: Add storage type telemetry (#39286)

Signed-off-by: Justin Yu <[email protected]>

* [air-doc] Rework experiment tracking docs for Torch trainer. (#38684)

* Rework experiment tracking for DDP trainer.

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

* [docs] add Developer Guides landing page (#39296)

Signed-off-by: Matthew Deng <[email protected]>

* [2.7][Doc] Clean up more Ray Train examples (#39284)

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

* disable Train examples with authentication for now. (#39358)

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

* [air] move doc_code and examples into respective libraries (#39298)

Signed-off-by: Matthew Deng <[email protected]>

---------

Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: woshiyyya <[email protected]>
Signed-off-by: xwjiang2010 <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Co-authored-by: Justin Yu <[email protected]>
Co-authored-by: Yunxuan Xiao <[email protected]>
Co-authored-by: xwjiang2010 <[email protected]>
harborn pushed a commit to harborn/ray that referenced this pull request Sep 8, 2023
jimthompson5802 pushed a commit to jimthompson5802/ray that referenced this pull request Sep 12, 2023
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Jim Thompson <[email protected]>
vymao pushed a commit to vymao/ray that referenced this pull request Oct 11, 2023
Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: Victor <[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.

2 participants