Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

[#168 fix] add context manager to fake ScalingTensor/ScalingParameter's __class__ as torch.Tensor - #169

Open
152334H wants to merge 2 commits into
Azure:mainfrom
152334H:main
Open

[#168 fix] add context manager to fake ScalingTensor/ScalingParameter's __class__ as torch.Tensor#169
152334H wants to merge 2 commits into
Azure:mainfrom
152334H:main

Conversation

@152334H

@152334H 152334H commented Mar 6, 2024

Copy link
Copy Markdown

Description
See #168. This is the most non-invasive fix I could come up with. Thanks to @aliencaocao for idea.

Minor Revision

  • adds msamp.common.tensor.tensor.pretend_scaling_is_torch, which can be used to fix GradScaler().step().

This is a non-breaking change as it does not deviate from prior behaviour without explicitly calling with pretend_scaling_is_torch().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant