-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Wait for #2563] [ Mixed ] Create weight with var32 tensor #2566
Conversation
We will add Var32 Tensor if the Variable Weight is not Full precision (FP32). This eables the Weight Update with full precision and only Apply Gradient Process ueses this Tensor. Therefore, the lifespan of this tensor should be "ApplyGradient". . Modify TensorPool to generate Weigth considering Mixed Precsion. **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon <[email protected]>
This pr create the variable fp32 tensor when we create the Weight and Optimizer Weight. . update the manager to create Weight with var32 tensor which requested to weight pool. . update the weight requests with Weight Spec and var, grad and var32 tensors which created already. . add clone Tensor with specific type in tensor.h Resolves: **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon <[email protected]>
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2566. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
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.
@jijoongmoon, 💯 All CI checkers are successfully verified. Thanks.
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.
Looks good to me except for minor fixes.
@@ -224,7 +224,8 @@ class Manager { | |||
*/ | |||
std::vector<Tensor *> requestWeightOptimizerVariables( | |||
const std::vector<TensorDim> &dims, const std::string &name, | |||
const TensorLifespan &lifespan, bool is_grad_clip, bool is_mixed_type, | |||
const std::string &suffix, const TensorLifespan &lifespan, | |||
bool is_grad_clip, bool is_mixed_type, |
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.
this func has incorrect description. might need to update the doc.
* @brief Get the Weight Gradient tensor object | ||
* | ||
* @param idx Identifier of the weight | ||
* @return Tensor& Reference to the weight grad tensor |
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.
* @brief Get the Weight Gradient tensor object | |
* | |
* @param idx Identifier of the weight | |
* @return Tensor& Reference to the weight grad tensor | |
* @brief Get the single-precision master weight tensor object | |
* | |
* @param idx Identifier of the weight | |
* @return Tensor& Reference to the master weight tensor |
* @brief Get the Weight Gradient tensor object | ||
* | ||
* @param idx Identifier of the weight | ||
* @return Tensor& Reference to the weight grad tensor |
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.
same here
* @brief Get the Weight Gradient tensor object | |
* | |
* @param idx Identifier of the weight | |
* @return Tensor& Reference to the weight grad tensor | |
* @brief Get the single-precision master weight tensor object | |
* | |
* @param idx Identifier of the weight | |
* @return Tensor& Reference to the master weight tensor |
@@ -114,6 +114,7 @@ class Weight : public Var_Grad { | |||
* | |||
* @param v Already created variable object | |||
* @param g Already created gradient object | |||
* @param v32 Already created gradient object |
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.
* @param v32 Already created gradient object | |
* @param Already created variable32 object |
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
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!
closed by #2663 |
In this PR
This pr create the variable fp32 tensor when we create the Weight and
Optimizer Weight.
. update the manager to create Weight with var32 tensor which
requested to weight pool.
. update the weight requests with Weight Spec and var, grad and var32
tensors which created already.
. add clone Tensor with specific type in tensor.h
Resolves:
Self evaluation:
Signed-off-by: jijoong.moon [email protected]