Skip to content
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

refine the initial cpu memory flag for mkldnn #11525

Merged
merged 4 commits into from
Jun 19, 2018

Conversation

tensor-tang
Copy link
Contributor

@tensor-tang tensor-tang commented Jun 16, 2018

resolve #11481

@tensor-tang
Copy link
Contributor Author

When enabled WITH_MKLDNN:

python test_fit_a_line.py

image

When set from env:

FLAGS_initial_cpu_memory_in_mb=300 py test_fit_a_line.py

image

"Default initial 500MB of CPU memory for PaddlePaddle, in MD unit.");
DEFINE_uint64(initial_cpu_memory_in_mb,
#ifdef PADDLE_WITH_MKLDNN
1000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some comments to tell why 1000 works.

Copy link
Contributor Author

@tensor-tang tensor-tang Jun 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I am not sure why this exactly 1000 number may works.

I was trying to give more space, here gives 2x of original, for MKLDNN according to the comment from mozga-intel.

And that's why I add @mozga-intel to help to review.

Please @mozga-intel, could you please help check if it's this enough.

BTW, I add this flag to env, so users can change this from env if this default 1000MB is not enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tensor-tang Of course.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tensor-tang IMO I think that 1000MB of space of memory is too small. The good result is obtained when the memory is greater than 5000 MB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks @mozga-intel, I will replace it with 5000 MB.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @mozga-intel as well.

@luotao1 luotao1 added the Intel label Jun 19, 2018
@tensor-tang tensor-tang merged commit e8f5757 into PaddlePaddle:develop Jun 19, 2018
@tensor-tang tensor-tang deleted the refine/mem branch June 19, 2018 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants