diff --git a/axon/layerparams.go b/axon/layerparams.go index b388d0bf..ba6414c8 100644 --- a/axon/layerparams.go +++ b/axon/layerparams.go @@ -715,7 +715,8 @@ func (ly *LayerParams) SpikeFromG(ctx *Context, ni, di uint32, lpl *Pool) { SetNrnV(ctx, ni, di, SpkMax, spkmax) } } - bin := ctx.Cycle / 50 + spksper := ctx.ThetaCycles / 4 + bin := ctx.Cycle / spksper spk := NrnV(ctx, ni, di, Spike) switch bin { case 0: @@ -724,7 +725,7 @@ func (ly *LayerParams) SpikeFromG(ctx *Context, ni, di uint32, lpl *Pool) { AddNrnV(ctx, ni, di, SpkBin1, spk) case 2: AddNrnV(ctx, ni, di, SpkBin2, spk) - case 3: + default: AddNrnV(ctx, ni, di, SpkBin3, spk) } } diff --git a/axon/shaders/gpu_cycle.spv b/axon/shaders/gpu_cycle.spv index 0340e5c8..05705b12 100644 Binary files a/axon/shaders/gpu_cycle.spv and b/axon/shaders/gpu_cycle.spv differ diff --git a/examples/objrec/bench_results.md b/examples/objrec/bench_results.md index f928b921..e2decf47 100644 --- a/examples/objrec/bench_results.md +++ b/examples/objrec/bench_results.md @@ -1,3 +1,48 @@ +# v2.0.0-dev0.2.0 + +Linear approximation to synaptic calcium integration: + +## MacBook Pro M3 Max + +Major improvements for GPU at all NData, major for NData 32 (5x), 16 (4x): +``` +GPU: +* NData 1: 59 +* NData 2: 39 +* NData 4: 27 +* NData 8: 20 +* NData 16: 15 +* NData 32: 12 +``` + +Not much diff for ndata now on CPU beyond 4, NThreads = 16 +``` +CPU: +* NData 1: 90 +* NData 2: 76 +* NData 4: 69 +* NData 8: 63 +* NData 16: 62 +* NData 32: 62 +``` + +## HPC2 ccnl-0 AMD EPYC 7502 32-Core Processor + NVIDIA A100 GPU + +``` +GPU: +* NData 4: 105 +* NData 8: 83 +* NData 16: 76 +* NData 32: 77 +``` + +``` +CPU: +* NData 16: 180 (ccnl-0) +* NData 16: 280 (Node 3) +* NData 16: 385 (Node 3, v0.0.8 -- previous SynCa) +``` + # v1.8.0 results are PerTrlMSec diff --git a/examples/objrec/config.go b/examples/objrec/config.go index 21db8891..df92bf03 100644 --- a/examples/objrec/config.go +++ b/examples/objrec/config.go @@ -82,6 +82,9 @@ type RunConfig struct { //types:add // total number of trials per epoch. Should be an even multiple of NData. NTrials int `default:"128"` + // total number of cycles per trial. + NCycles int `default:"300"` + // how frequently (in epochs) to compute PCA on hidden representations to measure variance? PCAInterval int `default:"5"` diff --git a/examples/objrec/objrec.go b/examples/objrec/objrec.go index 7993790b..df6a649f 100644 --- a/examples/objrec/objrec.go +++ b/examples/objrec/objrec.go @@ -107,6 +107,7 @@ func (ss *Sim) New() { ss.RandSeeds.Init(100) // max 100 runs ss.InitRandSeed(0) ss.Context.Defaults() + ss.Context.ThetaCycles = int32(ss.Config.Run.NCycles) // ss.Context.SlowInterval = 100 } @@ -265,20 +266,21 @@ func (ss *Sim) InitRandSeed(run int) { func (ss *Sim) ConfigLoops() { man := looper.NewManager() + ncyc := ss.Config.Run.NCycles trls := int(math32.IntMultipleGE(float32(ss.Config.Run.NTrials), float32(ss.Config.Run.NData))) man.AddStack(etime.Train). AddTime(etime.Run, ss.Config.Run.NRuns). AddTime(etime.Epoch, ss.Config.Run.NEpochs). AddTimeIncr(etime.Trial, trls, ss.Config.Run.NData). - AddTime(etime.Cycle, 200) + AddTime(etime.Cycle, ncyc) man.AddStack(etime.Test). AddTime(etime.Epoch, 1). AddTimeIncr(etime.Trial, trls, ss.Config.Run.NData). - AddTime(etime.Cycle, 200) + AddTime(etime.Cycle, ncyc) - axon.LooperStdPhases(man, &ss.Context, ss.Net, 150, 199) // plus phase timing + axon.LooperStdPhases(man, &ss.Context, ss.Net, ncyc-50, ncyc-1) // plus phase timing axon.LooperSimCycleAndLearn(man, ss.Net, &ss.Context, &ss.ViewUpdate) // std algo code for mode := range man.Stacks { diff --git a/examples/objrec/params.go b/examples/objrec/params.go index 29465c10..efb99025 100644 --- a/examples/objrec/params.go +++ b/examples/objrec/params.go @@ -24,6 +24,16 @@ var ParamSets = netparams.Sets{ "Layer.Learn.LrnNMDA.Tau": "100", // 100 def "Layer.Learn.LrnNMDA.Gbar": "0.006", "Layer.Learn.RLRate.SigmoidLinear": "true", // true > false later; more stable + "Layer.Learn.CaLearn.Norm": "80", // 80 works + "Layer.Learn.CaLearn.SpkVGCC": "true", // sig better.. + "Layer.Learn.CaLearn.SpkVgccCa": "35", // 70 / 5 or 35 / 10 both work + "Layer.Learn.CaLearn.VgccTau": "10", // 10 > 5 ? + "Layer.Learn.CaLearn.Dt.MTau": "2", + "Layer.Learn.CaLearn.Dt.PTau": "50", + "Layer.Learn.CaLearn.Dt.DTau": "50", + "Layer.Learn.CaSpk.Dt.MTau": "5", + "Layer.Learn.CaSpk.Dt.PTau": "50", + "Layer.Learn.CaSpk.Dt.DTau": "50", }}, {Sel: "#V1", Desc: "pool inhib (not used), initial activity", Params: params.Params{ diff --git a/examples/ra25x/config.go b/examples/ra25x/config.go index 4c7c3b4e..90862959 100644 --- a/examples/ra25x/config.go +++ b/examples/ra25x/config.go @@ -64,6 +64,9 @@ type RunConfig struct { // total number of trials per epoch. Should be an even multiple of NData. NTrials int `default:"32"` + // total number of cycles per trial. + NCycles int `default:"300"` + // how often to run through all the test patterns, in terms of training epochs -- can use 0 or -1 for no testing TestInterval int `default:"5"` diff --git a/examples/ra25x/ra25x.go b/examples/ra25x/ra25x.go index eb427117..b6289783 100644 --- a/examples/ra25x/ra25x.go +++ b/examples/ra25x/ra25x.go @@ -105,6 +105,7 @@ func (ss *Sim) New() { ss.RandSeeds.Init(100) // max 100 runs ss.InitRandSeed(0) ss.Context.Defaults() + ss.Context.ThetaCycles = int32(ss.Config.Run.NCycles) } //////////////////////////////////////////////////////////////////////////////////////////// @@ -235,20 +236,21 @@ func (ss *Sim) InitRandSeed(run int) { func (ss *Sim) ConfigLoops() { man := looper.NewManager() + ncyc := ss.Config.Run.NCycles trls := int(math32.IntMultipleGE(float32(ss.Config.Run.NTrials), float32(ss.Config.Run.NData))) man.AddStack(etime.Train). AddTime(etime.Run, ss.Config.Run.NRuns). AddTime(etime.Epoch, ss.Config.Run.NEpochs). AddTimeIncr(etime.Trial, trls, ss.Config.Run.NData). - AddTime(etime.Cycle, 200) + AddTime(etime.Cycle, ncyc) man.AddStack(etime.Test). AddTime(etime.Epoch, 1). AddTimeIncr(etime.Trial, trls, ss.Config.Run.NData). - AddTime(etime.Cycle, 200) + AddTime(etime.Cycle, ncyc) - axon.LooperStdPhases(man, &ss.Context, ss.Net, 150, 199) // plus phase timing + axon.LooperStdPhases(man, &ss.Context, ss.Net, ncyc-50, ncyc-1) // plus phase timing axon.LooperSimCycleAndLearn(man, ss.Net, &ss.Context, &ss.ViewUpdate) // std algo code for m, _ := range man.Stacks { diff --git a/simscripts/20-Fetch.cosh b/simscripts/20-Fetch.cosh index eaf233b6..46da752e 100644 --- a/simscripts/20-Fetch.cosh +++ b/simscripts/20-Fetch.cosh @@ -27,7 +27,7 @@ func FetchJob(jid string, force bool) { // fmt.Println(ff) rfn := "@1:" + ff scp {rfn} {ff} - if sstat == "Finalized" && strings.HasSuffix(ff, ".tsv") { + if (sstat == "Finalized" || sstat == "Fetched") && strings.HasSuffix(ff, ".tsv") { if strings.Contains(ff, "_epc.tsv") { databrowser.CleanCatTSV(ff, []string{"Run", "Epoch"}) idx := strings.Index(ff, "_epc.tsv")