-
Notifications
You must be signed in to change notification settings - Fork 14
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
add se resnet 152 profile script #84
Conversation
fluid/se_resnet_152/train.py
Outdated
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser('resnet152 parallel profile.') |
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.
resnet152
->SE-Resnet-152
fluid/se_resnet_152/train.py
Outdated
feed_dict = feeder.feed(data) | ||
|
||
for pass_id in range(1): | ||
with profiler.profiler('All', 'total', '/tmp/profile') as prof: |
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.
Exchange line 223 and line 224?
fluid/se_resnet_152/train.py
Outdated
exe.run(fluid.default_main_program(), | ||
feed=feed_dict, | ||
fetch_list=[], | ||
use_program_cache=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.
I prefer writing the line229~line238 together.
exe.run(fluid.default_main_program(),
feed=feeder.feed(train_reader_iter.next()) if args.use_python_reader else feed_dict,
fetch_list=[],
use_program_cache=True)
fluid/se_resnet_152/train.py
Outdated
use_program_cache=True) | ||
train_stop = time.time() | ||
if step_id > args.skip_first_steps: | ||
train_time += train_stop - train_start |
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.
Maybe the prof also needs warm up.
fluid/SE-ResNeXt-152/train.py
Outdated
regularization=fluid.regularizer.L2Decay(1e-4)) | ||
opts = optimizer.minimize(avg_cost) | ||
|
||
# fluid.memory_optimize(fluid.default_main_program()) |
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.
Why do you remove this?
For big batch_size, such as 12, the model will be oom, if without memory_optimize.
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.
add back, I think it's a option for user to test.
|
||
|
||
def time_stamp(): | ||
return int(round(time.time() * 1000)) |
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.
What is time_stamp
used to do?
regularization=fluid.regularizer.L2Decay(1e-4)) | ||
opts = optimizer.minimize(avg_cost) | ||
|
||
fluid.memory_optimize(fluid.default_main_program()) |
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.
Maybe it is better that adding an argument, such as use_memopt
.
No description provided.