• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PrincetonUniversity / PsyNeuLink / 13475398829
85%
master: 85%

Build:
Build:
LAST BUILD BRANCH: devel
DEFAULT BRANCH: master
Ran 22 Feb 2025 07:01PM UTC
Jobs 1
Files 155
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Feb 2025 06:13PM UTC coverage: 84.027% (-0.01%) from 84.037%
13475398829

Pull #3211

github

web-flow
Add support for batching to AutoDiffCompostion in PyTorch mode. (#3204)

* Changes to allow passing BatchedImpl tensors

When pytorch vmap is used on a function, the function
is called to trace it with tenors passed as inputs
which are not normal pytorch tensors. They are in fact
BatchedImpl tensors that have no underlying storage.
These cannot be converted to double() or numpy arrays
so I needed to remove calls to convert these tensors
in this special case.

* Fix bug in _batch_inputs

_batch_inputs was not actually returning batches of
size batch_size.

* Testing bactch support.

* Fix batch_size=1 case.

* WIP merge for pytorch batching in autodiff

* Fix for when minibatch_size is ndarray

* Cleanup

* Remove handling of batched_results.

* Handle dtype-object in _get_variable_from_input

Not sure this works in general to be honest.

* Fixes from merging in devel.

* Fixes for ragged things.

* More fixes for ragged things.

* Fix bad torch.stack call in execute_input_ports

* Add a real pytorch training test with batching

I made a test that implements an equivalent network
in PyTorch and PNL, initializes them with the same
weights, trains them both and then compares the losses. I think this is similar to some other
tests in the file but this one tests batch size > 1
and it actually trains the pytorch network as well.

* More fixes

* Disable update_autodiff_all_output_values

Now that all_output_values contains the
batch dimension in the first dimension it
is causing and error when passed to
output_CIM.execute because it has the incorrect
number of input ports (unless batch size happens
to match number of input ports). Not sure what
the best fix to this is but disabling this line
seems to work and pass all tests. Need to ask Jon.

* Handle 3D structure better in autodiff update_results.

* Fix formatting

* Fix ragged processing.

A bunch of fixes for things wrong with ragged processing.

* Fix logging test.

We need to add batch dimension to th... (continued)
Pull Request #3211: Devel

9626 of 12688 branches covered (75.87%)

Branch coverage included in aggregate %.

561 of 630 new or added lines in 23 files covered. (89.05%)

7 existing lines in 5 files now uncovered.

33436 of 38560 relevant lines covered (86.71%)

0.87 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
77.39
0.12% psyneulink/core/components/functions/function.py
1
78.88
-0.02% psyneulink/core/components/functions/nonstateful/transformfunctions.py
1
85.71
0.33% psyneulink/core/components/functions/stateful/statefulfunction.py
1
81.56
-0.24% psyneulink/core/components/ports/parameterport.py
1
90.83
0.03% psyneulink/core/compositions/composition.py
1
78.54
0.88% psyneulink/core/llvm/__init__.py
2
86.43
0.2% psyneulink/core/components/functions/stateful/integratorfunctions.py
2
84.45
0.74% psyneulink/library/compositions/autodiffcomposition.py
3
86.07
-0.93% psyneulink/core/scheduling/condition.py
3
84.73
0.59% psyneulink/library/compositions/compositionrunner.py
14
91.56
-1.11% psyneulink/library/compositions/pytorchwrappers.py
18
68.35
-1.16% psyneulink/core/globals/utilities.py
21
87.95
0.16% psyneulink/core/components/functions/nonstateful/transferfunctions.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
87.95
0.16% psyneulink/core/components/functions/nonstateful/transferfunctions.py
1
90.83
0.03% psyneulink/core/compositions/composition.py
1
82.79
-1.64% psyneulink/library/components/projections/pathway/autoassociativeprojection.py
2
84.73
-0.23% psyneulink/core/components/mechanisms/mechanism.py
2
90.73
-0.07% psyneulink/core/components/mechanisms/processing/transfermechanism.py
Jobs
ID Job ID Ran Files Coverage
1 13475398829.1 22 Feb 2025 07:01PM UTC 155
84.03
GitHub Action Run
Source Files on build 13475398829
  • Tree
  • List 155
  • Changed 23
  • Source Changed 0
  • Coverage Changed 23
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Pull Request #3211
  • PR Base - master (#13404300937)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc