Skip to content

[ROCm] Enable float8 utils and base tests on ROCm#3942

Open
brucechanglongxu wants to merge 1 commit intopytorch:mainfrom
brucechanglongxu:rocm/enable-float8-utils-tests
Open

[ROCm] Enable float8 utils and base tests on ROCm#3942
brucechanglongxu wants to merge 1 commit intopytorch:mainfrom
brucechanglongxu:rocm/enable-float8-utils-tests

Conversation

@brucechanglongxu
Copy link
Copy Markdown
Contributor

@brucechanglongxu brucechanglongxu commented Feb 24, 2026

  • Remove @skip_if_rocm from test_round_scale_down_to_power_of_2 in test_float8_utils.py and test_linear_from_recipe in test_base.py
  • Fix expected value for "largest normal number" test case: _round_scale_down_to_power_of_2(2^127 * (2 - 2^-23)) returns 2^127 on ROCm vs inf on CUDA. This is because log2(FLT_MAX) rounds to exactly 127.0 on ROCm (giving 2^127) while CUDA rounds up slightly (giving 2^128 = inf). Both are valid behaviors for this edge case value (3.4028235e+38).

Validated on MI300X (gfx942), PyTorch 2.9.0a0, ROCm 7.1.

cc: @BowenBao

- Remove @skip_if_rocm from test_round_scale_down_to_power_of_2 in
  test_float8_utils.py and test_linear_from_recipe in test_base.py
- Fix expected value for "largest normal number" test case:
  _round_scale_down_to_power_of_2(2^127 * (2 - 2^-23)) returns 2^127
  on ROCm vs inf on CUDA. This is because log2(FLT_MAX) rounds to
  exactly 127.0 on ROCm (giving 2^127) while CUDA rounds up slightly
  (giving 2^128 = inf). Both are valid behaviors for this edge case
  value (3.4028235e+38).

Validated on MI300X (gfx942), PyTorch 2.9.0a0, ROCm 7.1.
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 24, 2026

🔗 Helpful Links

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

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

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

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Feb 24, 2026

Hi @brucechanglongxu!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 27, 2026
@brucechanglongxu
Copy link
Copy Markdown
Contributor Author

@vkuzo @drisspg This PR has been approved and CI checks are passing. It enables float8 utils and base tests on ROCm. Could one of you merge when you get a chance? Thanks!

@brucechanglongxu
Copy link
Copy Markdown
Contributor Author

Gentle ping — approved and mergeable. Enables float8 utils and base tests on ROCm.

@brucechanglongxu
Copy link
Copy Markdown
Contributor Author

@vkuzo Gentle ping — approved by BowenBao and mergeable. Enables float8 utils and base tests on ROCm. Would appreciate a merge when you get a chance.

@brucechanglongxu
Copy link
Copy Markdown
Contributor Author

@vkuzo @BowenBao Bowen approved; float8 utils/base tests on ROCm. Trying to merge by end of week.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants