Skip to content

Rename torchao.float8.Float8Tensor to torchao.float8.Float8TrainingTensor #2479

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

Open
wants to merge 1 commit into
base: jerryzh168/stack/4
Choose a base branch
from

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Jul 2, 2025

Stacked PRs:


Rename torchao.float8.Float8Tensor to torchao.float8.Float8TrainingTensor

Summary:
att, since we are introducing a inference version Float8Tensor

Test Plan:
regression tests for float8 training: pytest test/float8

Reviewers:

Subscribers:

Tasks:

Tags:

Copy link

pytorch-bot bot commented Jul 2, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit b39be5d with merge base 1fd34e4 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from aacfea0 to 5fe4319 Compare July 2, 2025 21:42
@facebook-github-bot facebook-github-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 Jul 2, 2025
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 2, 2025 23:44
@jerryzh168 jerryzh168 added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Jul 2, 2025
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from 5fe4319 to f9ba189 Compare July 2, 2025 23:44
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 2, 2025 23:44
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 00:09
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from f9ba189 to 782b53f Compare July 3, 2025 00:09
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 00:09
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 02:18
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from 782b53f to ea9092a Compare July 3, 2025 02:18
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 02:18
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 02:23
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from ea9092a to 1b8c7cc Compare July 3, 2025 02:23
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 02:23
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 02:36
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from 1b8c7cc to 2a00cd7 Compare July 3, 2025 02:36
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 02:36
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 02:37
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 02:38
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 02:44
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 02:44
@vkuzo
Copy link
Contributor

vkuzo commented Jul 3, 2025

can we test two more things:

  1. run the overall test script for float8 training
./test/float8/test_everything.sh
  1. verify torchtitan training still works: https://github.com/pytorch/torchtitan/blob/main/docs/float8.md

Also, there are some callsites for Float8Tensor in fbcode, so we should make sure this diff is landed in a way where we could fix them in the fbcode diff.

@danielvegamyhre
Copy link
Contributor

danielvegamyhre commented Jul 3, 2025

can we test two more things:

  1. run the overall test script for float8 training
./test/float8/test_everything.sh
  1. verify torchtitan training still works: https://github.com/pytorch/torchtitan/blob/main/docs/float8.md

Also, there are some callsites for Float8Tensor in fbcode, so we should make sure this diff is landed in a way where we could fix them in the fbcode diff.

+1, for torchtitan i would suggest (1) 2d parallel w/ FSDP+TP in torchtitan for all 3 recipes, (2) for tensorwise test enabling fp8 all gather enabled and enabling precompute fp8 weight scales

@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 20:58
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from 2a00cd7 to 4d04b4c Compare July 3, 2025 20:58
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 20:58
@jerryzh168
Copy link
Contributor Author

Also, there are some callsites for Float8Tensor in fbcode, so we should make sure this diff is landed in a way where we could fix them in the fbcode diff.

sg, in this case I can do a forward fix in diff train

@jerryzh168
Copy link
Contributor Author

./test/float8/test_everything.sh

Runs without errors.

for torchtitan I have tested:

CONFIG_FILE="./torchtitan/models/llama3/train_configs/llama3_8b.toml" ./run_train.sh --model.converters="float8" --float8.enable_fsdp_float8_all_gather --float8.precompute_float8_dynamic_scale_for_fsdp --float8.force_recompute_fp8_weight_in_bwd --training.compile

and

CONFIG_FILE="./torchtitan/models/llama3/train_configs/llama3_8b.toml" ./run_train.sh --model.converters="float8" --float8.recipe_name rowwise --training.compile

CONFIG_FILE="./torchtitan/models/llama3/train_configs/llama3_8b.toml" ./run_train.sh --model.converters="float8" --float8.recipe_name rowwise_with_gw_hp --training.compile

is this enough?

…nsor

Summary:
att, since we are introducing a inference version Float8Tensor

Test Plan:
regression tests for float8 training: pytest test/float8

Reviewers:

Subscribers:

Tasks:

Tags:

stack-info: PR: #2479, branch: jerryzh168/stack/11
@jerryzh168 jerryzh168 changed the base branch from jerryzh168/stack/4 to main July 3, 2025 21:57
@jerryzh168 jerryzh168 force-pushed the jerryzh168/stack/11 branch from 4d04b4c to b39be5d Compare July 3, 2025 21:57
@jerryzh168 jerryzh168 changed the base branch from main to jerryzh168/stack/4 July 3, 2025 21:57
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: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants