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

Cleaning hyperopt logging #2162

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Cleaning hyperopt logging #2162

merged 1 commit into from
Jun 17, 2022

Conversation

arnavgarg1
Copy link
Contributor

@arnavgarg1 arnavgarg1 commented Jun 17, 2022

This PR aims to resolve two different logging messages seen generally during training and also during hyperopt. (See issue here)

  • The scope global has keys logging messages during hyperopt show up because the verbosity for logging is set to 1 by default for HorovodConfig when using Ray 11.2. The easiest fix is to disable verbosity for the HorovodConfig in our 11.2 compatibility module.
  • Instead of creating a Tensor from the input/target feature ndarrays directly, pytorch wants us to create Tensors from a copy of the numpy array during training.

@arnavgarg1 arnavgarg1 self-assigned this Jun 17, 2022
@arnavgarg1 arnavgarg1 linked an issue Jun 17, 2022 that may be closed by this pull request
@arnavgarg1 arnavgarg1 changed the title Fixed numpy warnings in trainer and disabled horovod logging Cleaning hyperopt logging Jun 17, 2022
@arnavgarg1 arnavgarg1 requested a review from ShreyaR June 17, 2022 19:05
Copy link
Contributor

@ShreyaR ShreyaR left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for adding these!

@github-actions
Copy link

Unit Test Results

       6 files  ±0         6 suites  ±0   2h 23m 23s ⏱️ + 3m 25s
2 827 tests ±0  2 793 ✔️ ±0    34 💤 ±0  0 ±0 
8 481 runs  ±0  8 375 ✔️ ±0  106 💤 ±0  0 ±0 

Results for commit c422797. ± Comparison against base commit bed01a5.

@justinxzhao
Copy link
Collaborator

  • Instead of creating a Tensor from the input/target feature ndarrays directly, pytorch wants us to create Tensors from a copy of the numpy array during training.

Curious what the warning you are seeing from torch is. @geoffreyangus FYI

@arnavgarg1
Copy link
Contributor Author

arnavgarg1 commented Jun 17, 2022

here

@justinxzhao @geoffreyangus here's the error message that we were seeing:

(BaseWorkerMixin pid=3115, ip=10.124.9.3) /home/ray/anaconda3/lib/python3.8/site-packages/ludwig/models/trainer.py:974: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at  ../torch/csrc/utils/tensor_numpy.cpp:178.)

(BaseWorkerMixin pid=3115, ip=10.124.9.3)   i_feat.feature_name: torch.from_numpy(batch[i_feat.proc_column]).to(self.device)

@arnavgarg1 arnavgarg1 merged commit befd584 into master Jun 17, 2022
@arnavgarg1 arnavgarg1 deleted the 2156-hyperopt-clean-up-logs branch June 17, 2022 22:19
@justinxzhao
Copy link
Collaborator

Nice! I've seen this one all over the place, thanks for getting rid of it!

@justinxzhao justinxzhao added this to Done in AutoML Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[Hyperopt] Clean up logs
3 participants