Skip to content

Conversation

@kailashg26
Copy link

Update the config.py file to fix (“negate”) the dimension mismatch issue that arises when enabling FP8 (8-bit floating point) precision support on AMD GPUs.

Error:
image

Update the config.py for AMD GPUs FP8
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 24, 2025

🔗 Helpful Links

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

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

meta-cla bot commented Oct 24, 2025

Hi @kailashg26!

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!

@vkuzo
Copy link
Contributor

vkuzo commented Oct 27, 2025

could you share how this is related to AMD GPUs? From the screenshot in the PR summary, it looks like the shapes being fed through the network do not adhere to the requirements of scaled_mm, which seems like a GPU independent problem.

@kailashg26
Copy link
Author

@vkuzo I agree, this is GPU independent problem. I just tried on MI300 and MI355 and this problem persists. But when I enable padding it works fine!
The issue related to this PR is meta-pytorch/torchtune#2833 (comment)

@vkuzo
Copy link
Contributor

vkuzo commented Oct 27, 2025

got it, can we just enable padding at the callsite for your use case instead of changing the default?

@kailashg26
Copy link
Author

kailashg26 commented Oct 27, 2025

@vkuzo not sure how do we do that at the callsite. You mean before I run my script using something like this?

find /opt/venv/lib/python3.10/site-packages/torchao/float8/config.py -type f -print0 | xargs -0 sed -i 's/pad_inner_dim: bool = False/pad_inner_dim: bool = True/g' \

I was just wondering if this might be very hacky

@vkuzo
Copy link
Contributor

vkuzo commented Oct 27, 2025

usually the user creates a Float8LinearConfig, like so

config = Float8LinearConfig(...)

in the place where that happens in torchtune, you could set the padding flag to True, or make that user configurable. Would that work?

@kailashg26
Copy link
Author

But if we use upstream torchtune we have to submit PR to upstream one right? Not sure if they are actively accepting PRs

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants