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

Unify the type specification for scaling values and float constant values at the Device Op API #478

Open
qianfengz opened this issue Oct 18, 2022 · 0 comments

Comments

@qianfengz
Copy link
Contributor

Scaling values (eg. alpha and beta) and float constants (eg. epsilon) are used by our kernels and passed from the user through the Device Op API. The following is a list of how those values are used in C.K

  • alpha and beta are used in Reduction and Softmax
  • epsilon is used in BatchNorm and LayerNorm
  • averageFactor is used in BatchNorm

And currently, different component might use different methods to define the types of those values at the Device Op API layer. A unified specification to define these values is necessary to make our Device Op API stable and brings less potential issues.

The following is my suggested method to specify the types of scaling values and float constants:

  1. At each Device Op API, the arguments of scaling and float constant values are declared to be double
  2. Inside the Device Op codes, the scaling and float constant values are converted to some AccDataType and saved as the AccDataType variables
  3. At each kernel interface, the arguments of scaling and float constant values are declared to be some AccDataType
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

No branches or pull requests

1 participant