8000 [Doc] Add deprecated autocast comments for doc by guangyey · Pull Request #126062 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Doc] Add deprecated autocast comments for doc #126062

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

Closed
wants to merge 7 commits into from

Conversation

guangyey
Copy link
Collaborator
@guangyey guangyey commented May 13, 2024

Stack from ghstack (oldest at bottom):

Motivation

We generalize a device-agnostic API torch.amp.autocast in #125103. After that,

  • torch.cpu.amp.autocast(args...) is completely equivalent to torch.amp.autocast('cpu', args...), and
  • torch.cuda.amp.autocast(args...) is completely equivalent to torch.amp.autocast('cuda', args...)

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate torch.cpu.amp.autocast and torch.cuda.amp.autocast to strongly recommend developer to use torch.amp.autocast that is a device-agnostic API.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @mcarilli @ptrblck @leslie-fang-intel

@guangyey guangyey requested a review from eqy as a code owner May 13, 2024 10:22
Copy link
pytorch-bot bot commented May 13, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit f37273e with merge base afda668 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label May 13, 2024
@guangyey guangyey changed the title Add deprecated autocast comments for doc [Doc] Add deprecated autocast comments for doc May 13, 2024
@guangyey guangyey added the topic: docs topic category label May 13, 2024
guangyey added a commit that referenced this pull request May 13, 2024
ghstack-source-id: e746615
Pull Request resolved: #126062
guangyey added 2 commits May 13, 2024 18:09
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
guangyey added a commit that referenced this pull request May 14, 2024
ghstack-source-id: 81d22fb
Pull Request resolved: #126062
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
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.

Sound good!
Can you add a small test using assertWarnsRegex to ensure these work as expected?

guangyey added a commit that referenced this pull request May 15, 2024
ghstack-source-id: 6dbf206
Pull Request resolved: #126062
@guangyey guangyey requested a review from albanD May 15, 2024 02:28
@guangyey
Copy link
Collaborator Author

Sound good! Can you add a small test using assertWarnsRegex to ensure these work as expected?

Updated.

guangyey added a commit that referenced this pull request May 15, 2024
ghstack-source-id: 92d7f58
Pull Request resolved: #126062
guangyey added a commit that referenced this pull request May 15, 2024
ghstack-source-id: c602180
Pull Request resolved: #126062
guangyey added 4 commits May 15, 2024 10:04
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10

[ghstack-poisoned]
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mcarilli ptrblck leslie-fang-intel

[ghstack-poisoned]
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mcarilli ptrblck leslie-fang-intel

[ghstack-poisoned]
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [#125103](#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mcarilli ptrblck leslie-fang-intel

[ghstack-poisoned]
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.

Thanks!

@guangyey
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 16, 2024
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@guangyey guangyey added the release notes: python_frontend python frontend release notes category label May 16, 2024
@guangyey
Copy link
Collaborator Author

@pytorchbot merge

@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

ZelboK pushed a commit to ZelboK/pytorch that referenced this pull request May 19, 2024
# Motivation
We generalize a device-agnostic API `torch.amp.autocast` in [pytorch#125103](pytorch#125103).  After that,
- `torch.cpu.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cpu', args...)`, and
- `torch.cuda.amp.autocast(args...)` is completely equivalent to `torch.amp.autocast('cuda', args...)`

no matter in eager mode or JIT mode.
Base on this point, we would like to deprecate `torch.cpu.amp.autocast` and `torch.cuda.amp.autocast` to **strongly recommend** developer to use `torch.amp.autocast` that is a device-agnostic API.

Pull Request resolved: pytorch#126062
Approved by: https://github.com/eqy, https://github.com/albanD
@github-actions github-actions bot deleted the gh/guangyey/31/head branch June 16, 2024 01:57
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: amp (automated mixed precision) autocast module: cpu CPU specific problem (e.g., perf, algorithm) open source release notes: python_frontend python frontend release notes category topic: docs topic category
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants
0