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

FP8 work in progress #678

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

FP8 work in progress #678

wants to merge 12 commits into from

Conversation

ademeure
Copy link
Contributor

@ademeure ademeure commented Jul 12, 2024

This is the current state of my FP8 branch, it's far from ready, but it's at the point where you could take a look if you're curious! The last version which was functionally correct was f7c53e3 from several hours ago, but that was missing some key optimisations and refactoring, so I'd focus on this one instead (3b286d7).

In terms of performance, this version should be representative of what's possible despite that bug, and it's currently >33% faster than BF16 on 1xH100 (+huge memory savings)! 🚀 And that's still with BF16 attention (which also affects which inputs/outputs can be FP8) so there's plenty more performance left on the table.

There are a number of things that need discussion & refactoring/rearchitecting, such as absmax_history (especially how tensors are pointed out with pointers and "associated tensors" etc...), CudaScratchAllocator, how to handle checkpointing & determinism, etc...

I'll write down some more explanations tomorrow, but I'll be away until Tuesday so won't make any further progress on the code until then! 🙂 Also keep in mind ~50% of the extra code is in /dev/cuda/ (including for experimental kernels I didn't end up using) so it's a very big change, but not quite as big as the lines imply.

@ademeure ademeure marked this pull request as draft July 12, 2024 01:32
…update every gpt2_forward + potential bugfix (now seems OK for final val_loss if inference is not run between start and end?...)
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.

None yet

1 participant