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

[WIP] model averaging benchmark #83

Closed
wants to merge 7 commits into from
Closed

[WIP] model averaging benchmark #83

wants to merge 7 commits into from

Conversation

lgarithm
Copy link
Collaborator

@lgarithm lgarithm commented Jun 9, 2019

No description provided.

other_flt = 0.5 * (input.flat<float>() + other.flat<float>());
std::copy(other.tensor_data().begin(), other.tensor_data().end(),
const_cast<char *>(input.tensor_data().begin()));
// FIXME: don't write to input tensor
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@luomai @andrei3131 I think the memory bandwidth consumed by AverageAssign is 2/11 of the original implementation.

AverageAssign performs a single std::transform which operates on 2 tensors.

The original performs two std::copy, each operates on 2 tensors,
and I assume the expression other_flt = 0.5 * (input.flat<float>() + other.flat<float>()); opereates on 2 + 2 + 3 tensors in total.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed that this implementation gives a performance benefit on platypus2 on ResNet-32 when compared to the GPU version, but when run on 8 V100 with ResNet-50 it is worse than GPU averaging (using TF operators executed on GPU).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This operator is register on CPU only, will it run on GPU?

Copy link
Member

Choose a reason for hiding this comment

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

@andrei3131 means doing averaging using TensorFlow operators.

Copy link
Member

Choose a reason for hiding this comment

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

@andrei3131 Could you point Guo to the model averaging (GPU) operator?

@lgarithm We are not mainly using this model averaging operator for experiments right now as we find out that using CPU for averaging cannot let ResNet-50 to converge while the averaging through GPU can.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@luomai I see, that will be definitely better if the GPU is powerful.
But I think this commit would still help improve the CPU operator.

lgarithm added a commit that referenced this pull request Jun 11, 2019
* cleanup model store
cherrypicked from #83
lgarithm added a commit that referenced this pull request Jun 11, 2019
lgarithm added a commit that referenced this pull request Jun 14, 2019
@lgarithm lgarithm closed this Oct 19, 2019
@lgarithm lgarithm deleted the lg-model-ave branch October 19, 2019 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants