-
Notifications
You must be signed in to change notification settings - Fork 157
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
[onert] Load tensor and optimizer data from the checkpoint file #13918
[onert] Load tensor and optimizer data from the checkpoint file #13918
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
assert(i <= _offset.size()); | ||
return DataBufferPair{_offset[i], _size[i]}; |
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.
Unlike std::map::operator[], std::vector::operator[] never inserts a new element into the container.
assert(i <= _offset.size()); | |
return DataBufferPair{_offset[i], _size[i]}; | |
assert(i < _offset.size()); | |
return DataBufferPair{_offset[i], _size[i]}; |
// Reset EOF bit | ||
_file.clear(); | ||
|
||
auto vindex = 0; |
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.
(optional)
How about using an explicit type like the above vindex
?
auto vindex = 0; | |
uint32_t vindex = 0; |
void updateAdamOptimizer(const std::unique_ptr<onert::exec::Execution> &exec) | ||
{ | ||
// Adam optimizer has two optimizer variables. (mean, variance) | ||
[[maybe_unused]] constexpr auto ADAM_VARIABLE_COUNT = 2; |
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.
(Optional)
How about using an explicit type? This variable is used for comparing unsigned integer.
By the way, is this initializing variable as constexpr
is meaningful? this variable seems to be used in runtime, not compile time.
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.
I carefully read this code.
It looks good to me 👍
This commit loads tensor and optimizer data from the checkpoint file. ONE-DCO-1.0-Signed-off-by: Jiyoung Yun <[email protected]>
ONE-DCO-1.0-Signed-off-by: Jiyoung Yun <[email protected]>
ONE-DCO-1.0-Signed-off-by: Jiyoung Yun <[email protected]>
4776cb0
to
3906443
Compare
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
This commit loads tensor and optimizer data from the checkpoint file.
ONE-DCO-1.0-Signed-off-by: Jiyoung Yun [email protected]
Related issue: #13670
Draft: #13561