Skip to content

Commit

Permalink
update to tensorfs changes and better log opening and closing logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Nov 20, 2024
1 parent 96712db commit 21eaf64
Show file tree
Hide file tree
Showing 28 changed files with 483 additions and 1,741 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See the [ra25 example](examples/ra25/README.md) for a complete working example,

# Current Status / News

* November 2024: **v2.0.0-dev-x.x.x**: ongoing updates using the new [goal](https://cogentcore.org/core/goal) _Go augmented language_ framework that supports direct multidimensional tensor indexing, advanced `#` math mode expressions, and major improvements to `gosl` for converting Go to GPU shader language, based on WGPU, that now elminates _all_ hand-written GPU code: everything is fully generated entirely from the original Go source. Previously, we were maintaining a fair amount of redundant CPU and GPU code. All of the logging and data analysis code will be completely rewritten to take advantage of the `goal` expressions that make it much cleaner to directly compute all stats, which are managed by the `datafs` data filesystem that gives direct, flexible, general-purpose browser access to all data. Many files now have `.goal` extensions, which auto-generate corresponding `.go` files. New tooling in Cogent Code makes it easy to manage this, and support for VS Code and other editors is forthcoming.
* November 2024: **v2.0.0-dev-x.x.x**: ongoing updates using the new [goal](https://cogentcore.org/core/goal) _Go augmented language_ framework that supports direct multidimensional tensor indexing, advanced `#` math mode expressions, and major improvements to `gosl` for converting Go to GPU shader language, based on WGPU, that now elminates _all_ hand-written GPU code: everything is fully generated entirely from the original Go source. Previously, we were maintaining a fair amount of redundant CPU and GPU code. All of the logging and data analysis code will be completely rewritten to take advantage of the `goal` expressions that make it much cleaner to directly compute all stats, which are managed by the `tensorfs` data filesystem that gives direct, flexible, general-purpose browser access to all data. Many files now have `.goal` extensions, which auto-generate corresponding `.go` files. New tooling in Cogent Code makes it easy to manage this, and support for VS Code and other editors is forthcoming.

* August 2024: **v2.0.0-dev-x.x.x**: in process transition to Cogent Core infrastructure, and major improvements in the [Rubicon](Rubicon.md) framework. Also finally figured out how to avoid the computationally expensive integration of calcium at each individual synapse at a cycle-by-cycle level, using a reasonable linear model based on activity windows on the sending and receiving neuron, with multiplicative factors (r^2 is .96 at capturing the cycle-by-cycle values). A full "2.0" release will be made once Cogent Core gets to a 1.0 stable release, and all the tests etc are updated.

Expand Down
2 changes: 1 addition & 1 deletion axon/enumgen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

564 changes: 282 additions & 282 deletions axon/gosl.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion axon/network.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion axon/network.goal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package axon

//go:generate core generate -add-types
//go:generate core generate -add-types -gosl

import (
"crypto/md5"
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/ApplyExtsNeuron.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1079,6 +1078,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1087,10 +1087,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/BetweenGi.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1044,6 +1043,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1052,10 +1052,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/CycleInc.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1023,6 +1022,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1031,10 +1031,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/CycleNeuron.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1964,6 +1963,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1972,10 +1972,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/CyclePost.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1154,6 +1153,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1162,10 +1162,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/DWtFromDiSyn.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1021,6 +1020,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1029,10 +1029,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/DWtSubMeanPath.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1050,6 +1049,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1058,10 +1058,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
14 changes: 7 additions & 7 deletions axon/shaders/DWtSyn.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ fn PathParams_DWtSyn(pt: ptr<function,PathParams>, ctx: ptr<function,Context>, r
var spi = NeuronIxs[IndexU322D(NeuronIxs[0], NeuronIxs[1], u32(NrnSubPool),u32(ri))];
var pi = LayerParams_PoolIndex(rlay, spi);
var lpi = LayerParams_PoolIndex(rlay, u32(u32(0)));
switch ((*pt).PathType) {
switch ((*pt).Type) {
case RWPath: {
PathParams_DWtSynRWPred(pt, ctx, syni, si, ri, lpi, pi, di);
}
Expand Down Expand Up @@ -801,8 +801,8 @@ fn PathParams_DWtSynCortex(pt: ptr<function,PathParams>, ctx: ptr<function,Conte
var syCaP: f32;
var syCaD: f32;
PathParams_SynCa(pt, ctx, si, ri, di, &syCaP, &syCaD);
var dtr = syCaD; // delta trace, caD reflects entire window
if ((*pt).PathType == CTCtxtPath) { // layer 6 CT pathway
var dtr = syCaD; // delta trace, caD reflects entire window
if ((*pt).Type == CTCtxtPath) { // layer 6 CT pathway
dtr = Neurons[IndexF323D(Neurons[0], Neurons[1], Neurons[2],
u32(BurstPrv),u32(si),u32(di))];
}
Expand All @@ -829,7 +829,7 @@ fn PathParams_DWtSynCortex(pt: ptr<function,PathParams>, ctx: ptr<function,Conte
} else {
err *= lwt;
}
if ((*pt).PathType == CTCtxtPath) { // rn.RLRate IS needed for other pathways, just not the context one
if ((*pt).Type == CTCtxtPath) { // rn.RLRate IS needed for other pathways, just not the context one
SynapseTraces[IndexF323D(SynapseTraces[0], SynapseTraces[1], SynapseTraces[2], u32(DiDWt),u32(syni),u32(di))] = (*pt).Learn.LRate.Eff * err;
} else {
SynapseTraces[IndexF323D(SynapseTraces[0], SynapseTraces[1], SynapseTraces[2], u32(DiDWt),u32(syni),u32(di))] = Neurons[IndexF323D(Neurons[0], Neurons[1], Neurons[2], u32(RLRate),u32(ri),u32(di))] * (*pt).Learn.LRate.Eff * err;
Expand Down Expand Up @@ -1326,7 +1326,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1338,6 +1337,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1346,10 +1346,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/GatherSpikes.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1124,6 +1123,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1132,10 +1132,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/LayerGi.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1117,6 +1116,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1125,10 +1125,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
6 changes: 3 additions & 3 deletions axon/shaders/MinusPhaseNeuron.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ struct StartN {
pad1: u32, // todo: see if we can do without these?
}
struct PathIndexes {
PathIndex: u32,
RecvLayer: u32,
RecvNeurSt: u32,
RecvNeurN: u32,
Expand All @@ -1026,6 +1025,7 @@ struct PathIndexes {
RecvConSt: u32,
RecvSynSt: u32,
NPathNeurSt: u32,
pad: u32,
}
struct GScaleValues {
Scale: f32,
Expand All @@ -1034,10 +1034,10 @@ struct GScaleValues {
pad1: f32,
}
struct PathParams {
PathType: PathTypes,
Type: PathTypes,
Index: u32,
pad: i32,
pad1: i32,
pad2: i32,
Indexes: PathIndexes,
Com: SynComParams,
PathScale: PathScaleParams,
Expand Down
Loading

0 comments on commit 21eaf64

Please sign in to comment.