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] Introduce fine tuning feature for training #12951
base: master
Are you sure you want to change the base?
Conversation
@@ -1695,7 +1742,7 @@ NNFW_STATUS nnfw_session::train_export_circle(const char *path) | |||
|
|||
auto subg = subgs->Get(0); // Get 1st subgraph | |||
if (!idx.valid() || idx.value() >= subg->tensors()->size()) | |||
throw std::runtime_error("Trainable tensor index is out of range"); | |||
return; |
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.
It's just a workaround for a problem reproduced even on master to enable exporting trained circle to a file (used in my test scripts to compare weights before and after training).
My assumption is that the trained graph can have more tensors because of the tensors consumed by a Loos function, but not sure how it worked before.
BTW:
auto model = ::circle::GetModel(mmapfile.buf());
if (!model)
throw std::runtime_error("Failed to get model from circle");
auto subgs = model->subgraphs();
if (!subgs || subgs->size() != 1)
throw std::runtime_error("Circle does not has valid subgraph or has multiple subgraphs");
auto subg = subgs->Get(0); // Get 1st subgraph
can be move outside iterateTrainableTensors
but I'll try to deal with it in a separate PR.
} | ||
|
||
const auto ir_op_index = onert::ir::OperationIndex{op_index}; | ||
auto &options = _coptions[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.
How about using TrainingInfo
instead of _coptions
?
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.
@jyoungyun I like this idea, introduced ;)
This commits extend TrainableOperation API with methods to disable/enable weights update of some particular trainable operations. In trainable operations is stored also status about contribution in backward propagation phase. ONE-DCO-1.0-Signed-off-by: Mateusz Bencer <m.bencer@partner.samsung.com>
Co-authored-by: Jiyoung Giuliana Yun <wldudyun10@gmail.com>
ONE-DCO-1.0-Signed-off-by: Mateusz Bencer <m.bencer@partner.samsung.com>
a0fcf8d
to
6ac060a
Compare
This PR adds fine tuning feature to onert. The new methods to nnfw API were added. onert_train tool was also extended to support this feature via
--frozen_ops_idx
argument.TEST ENVIRONMENT:
epoch
/batch size
/frozen ops
config to measure time and accuracyThe test methodology was described here and the results are collected in tests report
Issue: #12386