Skip to content
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

Implement set_scaling and stop_scaling JAX primitives. #20

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

balancap
Copy link
Contributor

@balancap balancap commented Nov 16, 2023

  • set_scaling: Set the scaling of a tensor, transforming into ScaledArray in autoscale mode.
  • stop_scaling: Stop scale propagation of a tensor, transforming back into a JAX array.

Both operations are no-op identity operations in normal JAX mode.

Note: as pointed by @DouglasOrr, these primitives could also be formalized as casting operations, where ScaledDtypes are properly defined. To be clarified whether it may be a better setting for the JAX implementation!

@balancap balancap marked this pull request as draft November 16, 2023 16:35
@balancap balancap force-pushed the implement-set-stop-scaling-primitives branch 4 times, most recently from e5eb23d to a91c734 Compare November 17, 2023 14:39
* `set_scaling`: Set the scaling of a tensor, transforming into `ScaledArray` in `autoscale` mode.
* `stop_scaling`: Stop scale propagation of a tensor, transforming back into a JAX array.

Both operations are no-op identity operations in normal JAX mode.

Note: as pointed by @DouglasOrr, these primitives could also be formalized as casting operations, where ScaledDtypes are
properly defined. To be clarified whether it may be a better setting for the JAX implementation!
@balancap balancap force-pushed the implement-set-stop-scaling-primitives branch from a91c734 to 07df3b6 Compare November 17, 2023 15:07
@balancap balancap marked this pull request as ready for review November 17, 2023 15:08
@balancap balancap merged commit b5920b7 into main Nov 17, 2023
2 checks passed
@balancap balancap deleted the implement-set-stop-scaling-primitives branch November 17, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant