Skip to content

Conversation

@janeyx99
Copy link
Contributor

@janeyx99 janeyx99 commented Jan 17, 2023

Stack from ghstack (oldest at bottom):

cc @ezyang @gchanan


BC-breaking note

Algorithms {Adadelta, Adagrad, Adam, Adamax, AdamW, ASGD, NAdam, RAdam, RMSProp, RProp, SGD} default to faster foreach implementation when on CUDA + differentiable=False

When applicable, this changes the default behavior of step() and anything that calls into adadelta(...), adagrad(...), adam(...), adamax(...), adamw(...), asgd(...), nadam(...), radam(...), rmsprop(...), rprop(...), sgd(...) directly to use the foreach implementation instead of the for-loop for better performance. Applicable means

  1. the user has not specified kwargs relating to implementation (foreach, fused, or differentiable),
  2. all tensors are native tensors (not subclasses) and on CUDA,
  3. torch.jit.is_scripting is False.

When these conditions are satisfied, the implementation used will match the implementation used when one passes foreach=True. The user defined flag for foreach will NOT be overwritten in order to preserve user selections. For more details, check the documentation. There should be no significant differences between the results returned by these optimizers. To revert to the old behavior, say, for adam, pass in adam(..., foreach=False, ...) or initialize Adam with Adam(..., foreach=False, ...).

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 17, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/92306

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b78c9b2:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@janeyx99 janeyx99 added module: bc-breaking Related to a BC-breaking change release notes: nn release notes category labels Jan 17, 2023
@pytorch-bot pytorch-bot bot added topic: bc breaking topic category labels Jan 17, 2023
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

SGTM

…le=False"

cc ezyang gchanan

[ghstack-poisoned]
…le=False"

cc ezyang gchanan

[ghstack-poisoned]
janeyx99 added a commit that referenced this pull request Jan 17, 2023
@janeyx99
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 17, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot facebook-github-bot deleted the gh/janeyx99/8/head branch June 8, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: bc-breaking Related to a BC-breaking change release notes: nn release notes category topic: bc breaking topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants