Skip to content
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

RFC-0030: FP8 dtype introduction to PyTorch #51

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

australopitek
Copy link
Contributor

This RFC proposes adding 8-bit floating point data types to PyTorch.

Since fp8 data type seems to be a natural evolution of currently used fp16/bf16, to reduce computation of big DL models, it’s worth to standardize this type. Few attempts of this were done recently:

* Nvidia, Arm and Intel - https://arxiv.org/pdf/2209.05433.pdf
* GraphCore and AMD - https://arxiv.org/pdf/2206.02915.pdf
Copy link

Choose a reason for hiding this comment

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

For completeness, these formats are proposed by Graphcore, AMD, and Qualcomm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll correct it when more comments are there.

@YinglinSun
Copy link

Curious what the progress for fp8 support looks like? Thanks!

@australopitek
Copy link
Contributor Author

@jakeh-gc ,
Is there any progress in the fp8 datatypes area?

@jakeh-gc
Copy link

jakeh-gc commented Jun 8, 2023

@australopitek I've been working more on the XLA side. The only activity I've seen in PyTorch was this pytorch/pytorch#97798, which didn't get merged.

@albanD
Copy link
Contributor

albanD commented Jun 15, 2023

Hey!
Wrote an update at pytorch/pytorch#91577 (comment) if you want to comment there!

@timljj
Copy link

timljj commented Jun 27, 2023

Hi @australopitek, in your md file, you mentioned that for E5M2 "there are many models that can be trained only with this variant".

May I know what models/type of models you are referring to?

Also, does your statement mean that those models would not be able to be trained with E4M3?

@australopitek
Copy link
Contributor Author

Hi @timljj ,
my wording was not precise. I wanted to say that some models can be trained with E5M2 without "help" of E4M3, i.e. E5M2 is sufficient (despite being "Applicable mainly for gradients in the backward pass of training").
Such experiments are described in the https://arxiv.org/pdf/1905.12334.pdf - Resnet18, Resnet34, Resnet50, GNMT, Transformer.

@maxpain
Copy link

maxpain commented Aug 12, 2023

Any updates?

@australopitek
Copy link
Contributor Author

@maxpain,
float8 dtypes are already delivered to pytorch - pytorch/pytorch#104242 - I guess they will be released in PT2.1
@albanD,
should we commit this RFC for the sake of completeness?

@albanD
Copy link
Contributor

albanD commented Aug 14, 2023

Yes I think this one is good.
Note that this only covers the basic (unscaled) data types and so we only expect "power users" to be able to use this at this point. End-user facing UX are being looked into but not ready right now.

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

Successfully merging this pull request may close these issues.

7 participants