Repository navigation
Delay Compensated Asynchronous Stochastic Gradient Descent - #9551
Conversation
|
Can one of the admins verify this patch? |
|
Thanks for this change!
Thanks again! |
|
ping for @alisidd ! |
|
@vrv Hi, I'm still working on it, I should hopefully have a working version by tomorrow. |
|
Can one of the admins verify this patch? |
|
@vrv I've made the requested changes, and I found quite a few problems with my implementations that required a few changes that I wasn't sure if I should be making, like an addition of an optional parameter to a method in the Optimizer class. It allows for multithreaded processing using one optimizer object. Regardless, I'm sure you can see what else I had to change. Furthermore, I tested and validated the implementation using a modified version of mnist_softmax.py with 12 asynchronous workers, and a variance parameter of 5. I found there to be an improvement of around 1.5% in test accuracy over asynchronous stochastic gradient descent, similar to improvements found in the research paper. |
|
Thanks for making these changes -- though I think changing the public API of optimizers just for this one case suggests that the Optimizer interface is now doing too much. I'm not too familiar with the optimizer interface personally, but one thought: the idea of delay compensated updates could theoretically apply to any gradient descent algorithm; instead of having this version descend from Optimizer, does it make sense to:
Let me know what you think! (Also, I'd probably be verbose on the names here: DelayCompensatedGradientDescent; the term "DC" isn't standard enough for it to be abbreviated). |
|
Also there aren't any tests that actually exercise more than 1 worker, so it's hard to tell the context in which it's needed. @jhseu in case he has any thoughts on optimizer interface |
|
@vrv A whole class for adding the ability to address updates by the worker index would have usage if more algorithms were added similar to this one that depended on having that kind of information. I need that information because I need to store a separate var for each worker, and keep them separate throughout the optimization. I don't think most gradient descent algorithms need that kind of information though. |
|
(I've assigned this the API review label so that the folks who look at API changes can assess whether this is something to accept.) |
|
@tensorflow-jenkins test this please |
|
@alisidd sorry it looks like you need to rebase again. |
|
@rmlarsen Should be good now |
|
No need to change the name! @tensorflow-jenkins test this please |
|
#10055 seems to have had the same problem when it was approved, not sure if I'm supposed to do something. |
|
@tensorflow-jenkins test this please (it looks like no GPU kernels are registered, but perhaps that can be added as a future PR if someone wants. it's pretty straightforward to copy the existing code for other optimizers). |
|
@alisidd @vrv the error is: the test code is here : the patch is here: |
|
I'm trying to learn more dcsgd and external optimizers for tf, I'm unsure how to implement this feature with the tf learn library examples. @zhuhyc $ python mnist_softmax_dc_asgd.py
|
|
@sesamesub |
|
I had some issues on my machine which I fixed, your code/patch is fine for
CPU tensorflow and works for per your example code.
…On Wed, Jul 5, 2017 at 10:21 PM, FANG Yang ***@***.***> wrote:
ping to check status
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9551 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVfXA1oxoqzHcrjF81KAVGr1y-WsuxyNks5sLFLVgaJpZM4NMkM0>
.
|
|
Ping to check status @alisidd |
| self._lambda = variance_parameter | ||
| self._num_workers = num_workers | ||
|
|
||
| def minimize(self, loss, global_step=None, var_list=None, |
There was a problem hiding this comment.
Why not use the minimize from the parent class? It seems this is copied exactly?
| grads_and_vars, | ||
| global_step=None, | ||
| name=None, | ||
| worker_index=None): |
There was a problem hiding this comment.
Also seems to be 95% copied from parent class?
There was a problem hiding this comment.
My preference was that delay-compensated-specific bits should not leak out to the parent class, which the original implementation did by adding worker_index to the public APIs. Where possible, it would be indeed nice to just reuse existing funtionality like in minimize(), but this function relies on extra state that is not available in the base APIs.
|
It looks like this PR was removed from master (commit 47949be), with the message "Remove Delay Compensated Asynchronous Stochastic Gradient Descent (DCASGD). The implementation is broken in its current form." What was wrong with the implementation? The message only references this PR and issue #8744, none of which seem to be mentioning problems. |
|
IIRC, it was lacking an _apply_dense() implementation, there were typos that caused failures when used, etc. The commit is obviously in the history for somebody to re-use and fix, if they wanted, but they'd need to write more tests and probably refactor it to make it something that the team could accept to TensorFlow. |
This adds the feature requested by #8744