Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

[1/x] clean up casting functions #345

Closed
wants to merge 1 commit into from
Closed

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Jul 26, 2024

Stack from ghstack (oldest at bottom):

Summary:

This is a start of a cleanup of private casting functions in preparation for
rowwise scaling. In this PR:

  1. create float8_scaling_utils.py to unify functions which take a
    high precision tensor and return a float8 tensor, taking care of
    scaling
  2. delete Float8Tensor.to_float8 and move callsites to
    ToFloat8ConstrFunc, since the two functions do the same thing

The end result is a slightly cleaner state, future PRs will do more
cleanups.

Test Plan:

./test/test_everything.sh

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D60291448

Summary:

This is a start of a cleanup of private casting functions in preparation for
rowwise scaling.  In this PR:
1. create `float8_scaling_utils.py` to unify functions which take a
   high precision tensor and return a float8 tensor, taking care of
   scaling
2. delete `Float8Tensor.to_float8` and move callsites to
   `ToFloat8ConstrFunc`, since the two functions do the same thing

The end result is a slightly cleaner state, future PRs will do more
cleanups.

Test Plan:

```
./test/test_everything.sh
```

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@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 26, 2024
@vkuzo
Copy link
Contributor Author

vkuzo commented Jul 26, 2024

@vkuzo has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@vkuzo
Copy link
Contributor Author

vkuzo commented Jul 26, 2024

@vkuzo has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@vkuzo
Copy link
Contributor Author

vkuzo commented Jul 26, 2024

@vkuzo has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 214da1f.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants