-
Notifications
You must be signed in to change notification settings - Fork 326
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
[PyTorch] Proxy class for low-precision tensor #1127
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
timmoon10
force-pushed
the
proxy-tensor
branch
from
August 28, 2024 22:56
97a3c0b
to
77e71b8
Compare
for more information, see https://pre-commit.ci
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
timmoon10
changed the title
[WIP] [PyTorch] Proxy class for low-precision tensor
[PyTorch] Proxy class for low-precision tensor
Aug 30, 2024
ptrendx
reviewed
Aug 30, 2024
timmoon10
commented
Aug 30, 2024
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
13 tasks
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
ksivaman
reviewed
Sep 9, 2024
13 tasks
/te-ci pytorch |
ksivaman
approved these changes
Sep 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pipeline is clean on rerun: 18307147
yaox12
pushed a commit
to yaox12/TransformerEngine
that referenced
this pull request
Sep 12, 2024
* Add base class for tensor proxies Signed-off-by: Tim Moon <[email protected]> * Move tensor detaching logic to tensor proxy base class Signed-off-by: Tim Moon <[email protected]> * Use Python wrappers to PyTorch extensions Signed-off-by: Tim Moon <[email protected]> * Include transpose caching logic in proxy encode function Signed-off-by: Tim Moon <[email protected]> * Debug dimension mismatch with amax history Signed-off-by: Tim Moon <[email protected]> * Move dequantize logic to proxy_decode func Signed-off-by: Tim Moon <[email protected]> * Rename to "QuantizedTensor" Signed-off-by: Tim Moon <[email protected]> * Rename "proxy_detach" to "detach" Signed-off-by: Tim Moon <[email protected]> * Include transpose cache in detach and clone funcs Signed-off-by: Tim Moon <[email protected]> * Fix linter warnings Signed-off-by: Tim Moon <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update FP8 workspaces with QuantizedTensor functions Signed-off-by: Tim Moon <[email protected]> * Move logic for FP8 transpose cache in FP8 workspaces to base class Signed-off-by: Tim Moon <[email protected]> * Remove cast-transpose logic from linear op Signed-off-by: Tim Moon <[email protected]> * Remove unnecessary args for Float8Tensor when using FP8 attr dict Signed-off-by: Tim Moon <[email protected]> * Remove __torch_function__ to QuantizedTensor Signed-off-by: Tim Moon <[email protected]> * Fix linter warnings Signed-off-by: Tim Moon <[email protected]> * Update tests/pytorch/test_float8tensor.py Signed-off-by: Tim Moon <[email protected]> * Debug FP8 transpose test Signed-off-by: Tim Moon <[email protected]> * Debug cast functions Signed-off-by: Tim Moon <[email protected]> --------- Signed-off-by: Tim Moon <[email protected]> Signed-off-by: Tim Moon <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kirthi Shankar Sivamani <[email protected]>
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
Float8Tensor
class effectively implements a proxy design pattern: it internally encodes data in FP8 with FP32 scaling factors but externally presents the interface of a plain PyTorch tensor in FP32/FP16/BF16. This PR generalizes this logic by moving the proxy logic to an abstractProxyTensor
QuantizedTensor
class. I envision implementing other quantization schemes (e.g. block scaling) by subclassingProxyTensor
QuantizedTensor
Type of change
Changes
Checklist: