feat: integrate CV-space runtime, trainable channels, and optimization workflows - #154
Merged
Conversation
chaoming0625
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR establishes a differentiable cell optimization workflow around a CV-space density runtime. It reduces redundant mechanism state storage, introduces
Cell-owned trainable channel parameters, and adds gradient, fitting, and profiling tools. It also fixes point-local current handling and defines consistent
fixed-step current-clamp sampling.
CV-space runtime and numerical correctness
Commits:
0bf3725,f3be24a,22c52eedensity mechanism states as
(population, 5)instead of(population, 11).boundary-current contributions handled by that solver.
representation.
Initial trainable channel parameter API
Commit:
3767c2dIL,Na_HH1952, andK_HH1952.braincell.trainable.parameter,scale, andparameterized.row,population,cv, andallgrouping while retaining the original optimizer-facingParamStateobjects.Fixed-step current clamps and recording
Commit:
76da0cet + 0.5 * dtand hold the resulting current throughout the main integration step.ClampViewselection and recording, plusobserve.clamp_current()with summed or per-clamp output.Cell.run()schedules under JIT and differentiation.Gradient engines and correctness experiments
Commits:
5569582,ef5c766Parameter fitting, initialization, and stimulus design
Commits:
bcfe5c7,7328850,dea5ce4,7d78275Scaling and runtime profiling
Commits:
7ff9627,e542f13,d04188bSWC morphology export
Commit:
88c20fdMorphology.to_swc()for morphologies with complete point geometry.Documentation and experiment organization
Commits:
94a16b2,17993a5,17b82ab,9989d01,3126211docs/design/.How Has This Been Tested
Validation was performed on an isolated snapshot of this branch at
22c52ee.Environment: Python 3.11.4, JAX 0.8.0, CPU.
The following focused regression suite passed: 144 passed.
These checks cover CV layouts, parameter ownership and materialization, staggered integration, clamp sampling, recording, SWC export, gradient engine
behavior, and runtime ablation tooling.
Additional checks:
braincell.git diff --checkpassed.Historical CPU and A100 gradient, scaling, and training measurements are documented separately in
docs/design/optim/references/bptt-rtrl-experimental- results.md.Types of changes
Checklist
Other information
Compatibility considerations:
Cell.run()recording requiresstart=0and a duration divisible by each recording period.The gradient engines, fitting workflows, and benchmark tools remain experimental implementations under
examples/experimentalandexamples/profiling.