Skip to content

[WIP] [float8] add float auto_filter_for_recipe #1319

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Jun 18, 2025

Fixes #1207

Problem

  • float8 rowwise + vanilla TP in torchtitan had flat perf with respect to bfloat.
  • RCA In float8 rowwise vanilla TP low throughput #1207 found attention.wk and attention.wv layers were so small that float8 rowwise conversion resulted in approx ~40% slowdown for those layers, thus the perf benefits from fp8 rowwise conversion on larger linears were nullified.
  • This is because the default filter_fqns for float8 model conversion are fine for the fp8 tensorwise recipe, but bad for the float8 rowwise recipe.

Solution

This has been a footgun for various users as well (including Poolside), so I created an "auto filter" (pytorch/ao#2410) which automatically filters Linears for a given float8 recipe, by checking for the following criteria:

  1. dims not divisible by 16 (hardware requirement for float8)
  2. dim sizes below thresholds that will result in worse perf for that given recipe, using simple heuristics based on the linked recipe perf tables above.
  3. fqn matches one of the user defined filter_fqns

It prevents users from hitting this common footgun, while also preserving the flexibility to define their model-specific fqns.

Results

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 18, 2025
@danielvegamyhre danielvegamyhre changed the title [WIP] [float8] add float auto_filter_for_recipe [float8] add float auto_filter_for_recipe Jun 18, 2025
@danielvegamyhre danielvegamyhre marked this pull request as draft June 18, 2025 22:13
@danielvegamyhre danielvegamyhre changed the title [float8] add float auto_filter_for_recipe [WIP] [float8] add float auto_filter_for_recipe Jun 18, 2025
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 Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

float8 rowwise vanilla TP low throughput
2 participants