Skip to content

Conversation

@Skylion007
Copy link
Collaborator

detach().clone() is faster than .clone().detatch() since the gradients are not cloned. Let's update all the documentation and tests so that users do not use the inefficient op ordering.

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 6, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 91cfdbd with merge base f6488d8 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@Skylion007 Skylion007 force-pushed the skylion007/fix-detach-copy-docs-2025-01-06 branch from f37b6ae to e6f98a9 Compare January 6, 2025 17:59
@Skylion007 Skylion007 force-pushed the skylion007/fix-detach-copy-docs-2025-01-06 branch from e6f98a9 to 91cfdbd Compare January 6, 2025 18:00
@Skylion007 Skylion007 added better-engineering Relatively self-contained tasks for better engineering contributors topic: not user facing topic category labels Jan 6, 2025
@Skylion007 Skylion007 requested a review from awgu January 6, 2025 18:01
@Skylion007 Skylion007 changed the title [BE]: Fix docs recommending inefficient tensor op order [BE][Ez]: Fix docs recommending inefficient tensor op order Jan 6, 2025
Copy link
Collaborator

@awgu awgu left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me!

@XuehaiPan
Copy link
Collaborator

Maybe we can add similar changes to .cpu().detach().numpy().

@Skylion007
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 7, 2025
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

better-engineering Relatively self-contained tasks for better engineering contributors ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants