-
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
Draft-v2: Implement Circle+ Loader #12045
Conversation
3d140cd
to
ac17f9a
Compare
tmp ONE-DCO-1.0-Signed-off-by: SeungHui Youn <sseung.youn@samsung.com>
ac17f9a
to
8243c77
Compare
This comment was marked as resolved.
This comment was marked as resolved.
@@ -23,6 +23,7 @@ option(BUILD_ONERT_RUN "Build onert_run" ON) | |||
option(BUILD_ONERT_TRAIN "Build onert_train" ON) | |||
option(BUILD_TFLITE_LOADER "Build TensorFlow Lite loader" ON) | |||
option(BUILD_CIRCLE_LOADER "Build circle loader" ON) | |||
option(BUILD_TRAININFO_LOADER "Build circle traininfo loader" ON) |
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 circlr+
word instead of traininfo
? Because this pr is for loading circle+ file format. :)
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 intentionally choose the word traininfo
instead of circle+
.
Because circle+
range is a bit ambiguous.
What is circle+
exactly range?
- (1) both
circle format
andtrain info
- (2) only
train info
I thought circle+
means (1).
But this loader mainly focuses on loading train info
from metadata.
So, That's why I choose traininfo loader
.
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 thought circle+ contains all meta information included in circle+ file format.
This circle+ loader loads all meta information from circle+ file. And each function can select the meta data it is interested in.
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.
Oh, I see your point.
But still for me, the words "circle+ loader" look like it is responsible for loading both circle(subgraphs and tensors) and its metadata(train info and .. etc).
Therefore, How about the word circletr_meta_loader
?
+) I also thought the word circle+_meta_loader
, but I'm afraid that string "+" cause trouble later.
@@ -25,7 +25,7 @@ namespace onert | |||
{ | |||
namespace circle_loader |
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.
You can use different namespace for circle+ format.
auto is_given = [&vm](const std::string &s) -> bool { return not vm[s].defaulted(); }; | ||
|
||
if (is_given("batch_size") && is_given("learning_rate") && is_given("loss") && | ||
is_given("optimizer")) | ||
{ | ||
_is_training_info = true; | ||
} |
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 would be better to check if there is a given parameter in main function instead of using _is_training_info
variable.
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 agree.
But for now, It is hard to check in the main.
Because Arg
has a default value, It is hard to figure out whether the value is given or default in main.
ONE/tests/tools/onert_train/src/args.cc
Lines 212 to 222 in 8243c77
("epoch", po::value<int>()->default_value(5)->notifier([&](const auto &v) { _epoch = v; }), "Epoch number (default: 5)") | |
("batch_size", po::value<int>()->default_value(32)->notifier([&](const auto &v) { _batch_size = v; }), "Batch size (default: 32)") | |
("learning_rate", po::value<float>()->default_value(0.001)->notifier([&](const auto &v) { _learning_rate = v; }), "Learning rate (default: 0.001)") | |
("loss", po::value<int>()->default_value(0)->notifier([&] (const auto &v) { _loss_type = v; }), | |
"Loss type\n" | |
"0: MEAN_SQUARED_ERROR (default)\n" | |
"1: CATEGORICAL_CROSSENTROPY\n") | |
("optimizer", po::value<int>()->default_value(0)->notifier([&] (const auto &v) { _optimizer_type = v; }), | |
"Optimizer type\n" | |
"0: SGD (default)\n" | |
"1: Adam\n") |
@zetwhite Here are some points what I've talked you offline:
|
35220cb
to
2e7889a
Compare
b132b12
to
5ae009d
Compare
0b27235
to
7e876b0
Compare
Thanks for the summary. I found out how-to-append the loader on the current implementation wasn't clear. 😅 |
if (model_type == "circle+") | ||
return onert::circle_loader::loadModel(filename.c_str(), /*load metadata*/ true); |
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.
(notes)
namespace traininfo_loader | ||
{ | ||
|
||
std::unique_ptr<ir::train::TrainingInfo> loadTrainingInfo(std::shared_ptr<const ir::Model> model); |
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.
(notes)
related issue : #11692
ONE-DCO-1.0-Signed-off-by: SeungHui Youn sseung.youn@samsung.com