KEMBAR78
Clarify torch.arange floating-point rounding behavior by axsseldz · Pull Request #141655 · pytorch/pytorch · GitHub
Skip to content

Conversation

@axsseldz
Copy link
Contributor

Added documentation note clarifying the rounding behavior of torch.arange when using floating-point dtypes, particularly for reduced precision types like bfloat16. This helps users understand potential issues like repeated values and provides guidance on using integer dtypes for precise sequences.

Changes

  • Added explanatory note about floating-point rounding behavior and its effects
  • Included specific mention of bfloat16 dtype issues
  • Added recommendation to use integer dtypes for precise sequences

Fixes #137774

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 27, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit d2e6730 with merge base 9b89fa4 (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 release notes: python_frontend python frontend release notes category label Nov 27, 2024
@axsseldz
Copy link
Contributor Author

Hi @cpuhrsch, could you take a look at these changes, please

Copy link
Contributor

@cpuhrsch cpuhrsch left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me

@cpuhrsch
Copy link
Contributor

@pytorchbot merge

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

pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
Added documentation note clarifying the rounding behavior of `torch.arange` when using floating-point dtypes, particularly for reduced precision types like `bfloat16`. This helps users understand potential issues like repeated values and provides guidance on using integer dtypes for precise sequences.

## Changes
- Added explanatory note about floating-point rounding behavior and its effects
- Included specific mention of `bfloat16` dtype issues
- Added recommendation to use integer dtypes for precise sequences

Fixes [pytorch#137774](pytorch#137774)
Pull Request resolved: pytorch#141655
Approved by: https://github.com/cpuhrsch
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 open source release notes: python_frontend python frontend release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.arange bf16 results are not accurate

4 participants