commit e4b04a538fb01a2a36049b2d23ae6721ae227058
parent 955d659eec7bd1efc0a00d0ad754f80873db4254
Author: umhau <umhau@users.noreply.github.com>
Date: Tue, 14 Feb 2017 18:16:48 -0500
change name of mpi options object
Diffstat:
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/mlaunch.lua b/mlaunch.lua
@@ -56,20 +56,20 @@ for i = 0,size-1 do
end
end
-opt = {}
+mpiOptions = {}
--[[ -- delete this stuff later.
-opt.name = 'downpour'
-opt.lr = 1e-4
-opt.su = 1
+mpiOptions.name = 'downpour'
+mpiOptions.lr = 1e-4
+mpiOptions.su = 1
--]]
-opt.name = 'eamsgd' -- using most efficient optimizer
---opt.lr = 1e-1
-opt.communicationPeriod = 100
-opt.movingRateAlpha = 0.9/6 -- this is \beta/p when p=6
-opt.learningRate = 1e-1 --1e-2 -- order of magnitude from the other - what's the difference?
-opt.momentum = 0.99
+mpiOptions.name = 'eamsgd' -- using most efficient optimizer
+--mpiOptions.lr = 1e-1
+mpiOptions.communicationPeriod = 100
+mpiOptions.movingRateAlpha = 0.9/6 -- this is \beta/p when p=6
+mpiOptions.learningRate = 1e-1 --1e-2 -- order of magnitude from the other - what's the difference?
+mpiOptions.momentum = 0.99
-opt.maxepoch = iterations
+mpiOptions.maxepoch = iterations
-- determine if the current node should be server or client. Seems like there
-- should be more clients than servers...investigate later. (change the '2'?)
@@ -105,9 +105,9 @@ else
-- done with configuring the processors. These are settings specific to the
-- node at hand, now that we know exactly what it's going to be doing.
- opt.gpuid = gpuid -- Tell the optimizer if GPUs are available.
- opt.pclient = pClient(conf) -- MPI settings for communicating with the other nodes.
- opt.rank = rank -- Simple access to the node number.
+ mpiOptions.gpuid = gpuid -- Tell the optimizer if GPUs are available.
+ mpiOptions.pclient = pClient(conf) -- MPI settings for communicating with the other nodes.
+ mpiOptions.rank = rank -- Simple access to the node number.
-- Time to run the training algorithm. This is not an arbitrary script,
-- and must contain some cruicial settings.
diff --git a/train.lua b/train.lua
@@ -348,17 +348,18 @@ elseif opt.optimizer == 'sgd' then
optim_state.dampening = 0
elseif opt.optimizer == 'eamsgd' then
optimizer = optim.eamsgd
- optim_state.learningRate = opt.learningRate
- optim_state.momentum = opt.momentum
- optim_state.pclient = opt.pclient
- optim_state.communicationPeriod = opt.communicationPeriod
- optim_state.movingRateAlpha = opt.movingRateAlpha
+ optim_state.learningRate = mpiOptions.learningRate
+ optim_state.momentum = mpiOptions.momentum
+ optim_state.pclient = mpiOptions.pclient
+ optim_state.communicationPeriod = mpiOptions.communicationPeriod
+ optim_state.movingRateAlpha = mpiOptions.movingRateAlpha
else
optimizer = optim.rmsprop
end
-- initialize MPI optimizer clients
-rank = opt.rank or -1
+rank = mpiOptions.rank or -1
+pclient = optim_state.pclient or nil
print('i am ' .. rank .. ' ready to run')
if pclient then
pclient:start(params,grad_params)