Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Fix torch v2 #484

Merged
merged 25 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e65cb24
Fix for SwinTransformer model in torchvision
davidt0x Mar 16, 2023
cdb8050
Merge branch 'development' of https://github.com/ModECI/MDF into test…
davidt0x Mar 16, 2023
8361bd7
Mark maxvit_t, inception_v3, and resnet101 as xfail.
davidt0x Mar 16, 2023
38b28a5
Remove version cap on torchvision.
davidt0x Mar 16, 2023
975af47
Add some code to speedup slow torchvision model tests
davidt0x May 18, 2023
7823fb7
Pin ir_version to 8
davidt0x May 18, 2023
7d25b9b
Disable SWIN model from torchvision for now
davidt0x Aug 2, 2023
2b398e6
Modelspec>=0.3
pgleeson Aug 8, 2023
5ad2579
Minimal updates to work with modelspec v0.3 - onnx examples use floats
pgleeson Aug 9, 2023
18f8851
Merge pull request #476 from ModECI/feature/latest_modelspec
pgleeson Aug 14, 2023
7a9608a
Fixes for newer ONNX
davidt0x Aug 30, 2023
c2d7618
Merge branch 'development' of https://github.com/ModECI/MDF into fix_…
davidt0x Aug 30, 2023
9e0950e
Update versions in github actions file
pgleeson Aug 30, 2023
c84978b
Merge branch 'feature/update_onnx' of https://github.com/ModECI/MDF i…
davidt0x Aug 30, 2023
45511d0
Run pre-commit
davidt0x Aug 30, 2023
649e0c6
Fix key name for ONNX example.
davidt0x Aug 30, 2023
b0f3ed0
Pin tensorflow
davidt0x Aug 30, 2023
ae0159e
Another attempted fix for TypeError: weight_decay
davidt0x Aug 30, 2023
4c55b92
Install graphviz cross-platform
davidt0x Aug 31, 2023
66e453a
Re-consolidate windows tests
davidt0x Aug 31, 2023
f0b0475
Pre-commit
davidt0x Aug 31, 2023
6042eca
Add full testing on 3.10
davidt0x Aug 31, 2023
ffee019
Drop 3.11 testing for now.
davidt0x Aug 31, 2023
783602f
Merge pull request #482 from ModECI/feature/latest_modelspec
pgleeson Sep 6, 2023
59f3963
Merge branch 'development' into fix_torch_v2
pgleeson Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files

Expand All @@ -25,13 +27,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11"]
python-version: [ "3.8", "3.9", "3.10"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -67,41 +69,26 @@ jobs:
pip list

- name: Install graphviz
if: ${{ matrix.runs-on != 'windows-latest' }}
run: |
if [[ ${{ matrix.runs-on }} == *"macos"* ]]; then brew install graphviz ; fi
if [[ ${{ matrix.runs-on }} == *"ubuntu"* ]]; then sudo apt install graphviz ; fi
uses: ts-graphviz/setup-graphviz@v1

- name: Test interface ACT-R
if: ${{ matrix.python-version != '3.10' || matrix.runs-on != 'windows-latest' }}
run: |
python -m pytest -v -m "actr" tests/

- name: Test interface PyTorch
if: ${{ matrix.python-version != '3.10' || matrix.runs-on != 'windows-latest' }}
run: |
python -m pytest -v -m "pytorch" tests/

- name: Test interface NeuroML
if: ${{ matrix.python-version != '3.10' || matrix.runs-on != 'windows-latest' }}
run: |
python -m pytest -v -m "neuroml" tests/

- name: Test interface TensorFlow linux/mac
if: ${{ matrix.runs-on != 'windows-latest' }}
run: |
dot -V
python -m pytest -v -m "tensorflow" tests/

- name: Test interface TensorFlow windows
if: ${{ matrix.python-version != '3.10' && matrix.runs-on == 'windows-latest' }}
- name: Test interface TensorFlow
run: |
choco install graphviz
dot -V
python -m pytest -v -m "tensorflow" tests/

- name: Test interface PsyNeuLink
if: ${{ matrix.python-version != '3.10' }}
run: |
python -m pip install .[psyneulink]
python -m pytest -v -m "psyneulink" tests/
Expand All @@ -123,12 +110,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Build sdist and wheel
run: pipx run --spec build pyproject-build

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist

Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,16 @@ Thumbs.db #thumbnail cache on Windows
/examples/NeuroML/arm64
/examples/MDF/RNN/iaf.net
/examples/MDF/RNN/iaf.net2
/examples/NeuroML/PyNN/All*
/examples/NeuroML/PyNN/*dat
/examples/NeuroML/PyNN/*.png
/examples/NeuroML/PyNN/*.1
/examples/NeuroML/PyNN/InputWeights*
/examples/NeuroML/PyNN/OneCell*
/examples/NeuroML/PyNN/Sim*
/examples/NeuroML/PyNN/LEMS_Sim*
/examples/NeuroML/PyNN/HH*
/examples/NeuroML/PyNN/arm64
/examples/NeuroML/PyNN/*.pkl
*_code.gen.c
/examples/NeuroML/PyNN/Net1*
Binary file modified docs/sphinx/source/api/export_format/ONNX/ab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/sphinx/source/api/export_format/ONNX/simple_ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main():
for t in test_values:
print("===================\nEvaluating MDF model with input: %s" % t)
eg.evaluate(initializer={"input": t})
print("Output: %s" % eg.enodes["Mul_3"].evaluable_outputs["_4"].curr_value)
print("Output: %s" % eg.enodes["/B/Mul"].evaluable_outputs["_4"].curr_value)


if __name__ == "__main__":
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/NeuroML/FN__lems.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
</OnEvent>
</Dynamics>
</ComponentType>
<Component id="fn" type="fnCell" initial_w="0" initial_v="-1" a_v="-0.3333333333333333" b_v="0" c_v="1" d_v="1" e_v="-1" f_v="1" time_constant_v="1" a_w="1" b_w="-0.8" c_w="0.7" time_constant_w="12.5" threshold_exc="-1.0" mode="1" uncorrelated_activity="0" Iext="0" threshold="-1"/>
<Component id="fn" type="fnCell" initial_w="0.0" initial_v="-1" a_v="-0.3333333333333333" b_v="0.0" c_v="1.0" d_v="1" e_v="-1.0" f_v="1.0" time_constant_v="1.0" a_w="1.0" b_w="-0.8" c_w="0.7" time_constant_w="12.5" threshold_exc="-1.0" mode="1.0" uncorrelated_activity="0.0" Iext="0" threshold="-1.0"/>
</Lems>
36 changes: 19 additions & 17 deletions examples/ONNX/ab.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
"format": "ModECI MDF v0.4",
"generating_application": "Python modeci-mdf v0.4.7",
"graphs": {
"torch-jit-export": {
"torch_jit": {
"nodes": {
"Add_1": {
"/A/Add": {
"input_ports": {
"input": {
"shape": [
2,
3
]
],
"type": "float"
}
},
"parameters": {
"B": {
"value": 1.0
},
"Add_1": {
"/A/Add": {
"function": "onnx::Add",
"args": {
"A": "input",
Expand All @@ -27,45 +28,46 @@
}
},
"output_ports": {
"onnx_Mul_2": {
"value": "Add_1"
"_A_Add_output_0": {
"value": "/A/Add"
}
}
},
"Mul_3": {
"/B/Mul": {
"input_ports": {
"onnx_Mul_2": {
"_A_Add_output_0": {
"shape": [
2,
3
]
],
"type": "float"
}
},
"parameters": {
"B": {
"value": 5.0
},
"Mul_3": {
"/B/Mul": {
"function": "onnx::Mul",
"args": {
"A": "onnx_Mul_2",
"A": "_A_Add_output_0",
"B": "B"
}
}
},
"output_ports": {
"_4": {
"value": "Mul_3"
"value": "/B/Mul"
}
}
}
},
"edges": {
"Add_1.onnx_Mul_2_Mul_3.onnx_Mul_2": {
"sender": "Add_1",
"receiver": "Mul_3",
"sender_port": "onnx_Mul_2",
"receiver_port": "onnx_Mul_2"
"/A/Add._A_Add_output_0_/B/Mul._A_Add_output_0": {
"sender": "/A/Add",
"receiver": "/B/Mul",
"sender_port": "_A_Add_output_0",
"receiver_port": "_A_Add_output_0"
}
}
}
Expand Down
Binary file modified examples/ONNX/ab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 17 additions & 15 deletions examples/ONNX/ab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,47 @@ ONNX Model:
format: ModECI MDF v0.4
generating_application: Python modeci-mdf v0.4.7
graphs:
torch-jit-export:
torch_jit:
nodes:
Add_1:
/A/Add:
input_ports:
input:
shape:
- 2
- 3
type: float
parameters:
B:
value: 1.0
Add_1:
/A/Add:
function: onnx::Add
args:
A: input
B: B
output_ports:
onnx_Mul_2:
value: Add_1
Mul_3:
_A_Add_output_0:
value: /A/Add
/B/Mul:
input_ports:
onnx_Mul_2:
_A_Add_output_0:
shape:
- 2
- 3
type: float
parameters:
B:
value: 5.0
Mul_3:
/B/Mul:
function: onnx::Mul
args:
A: onnx_Mul_2
A: _A_Add_output_0
B: B
output_ports:
_4:
value: Mul_3
value: /B/Mul
edges:
Add_1.onnx_Mul_2_Mul_3.onnx_Mul_2:
sender: Add_1
receiver: Mul_3
sender_port: onnx_Mul_2
receiver_port: onnx_Mul_2
/A/Add._A_Add_output_0_/B/Mul._A_Add_output_0:
sender: /A/Add
receiver: /B/Mul
sender_port: _A_Add_output_0
receiver_port: _A_Add_output_0
15 changes: 10 additions & 5 deletions examples/ONNX/abc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"shape": [
2,
3
]
],
"type": "float"
}
},
"parameters": {
Expand All @@ -37,13 +38,15 @@
"B_loop_count": {
"shape": [
1
]
],
"type": "float"
},
"onnx_Loop_3": {
"shape": [
2,
3
]
],
"type": "float"
}
},
"parameters": {
Expand All @@ -58,7 +61,8 @@
"shape": [
2,
3
]
],
"type": "float"
}
},
"parameters": {
Expand Down Expand Up @@ -124,7 +128,8 @@
"x_3": {
"shape": [
1
]
],
"type": "float"
}
},
"parameters": {
Expand Down
5 changes: 5 additions & 0 deletions examples/ONNX/abc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ONNX Model:
shape:
- 2
- 3
type: float
parameters:
B:
value: 1.0
Expand All @@ -26,10 +27,12 @@ ONNX Model:
B_loop_count:
shape:
- 1
type: float
onnx_Loop_3:
shape:
- 2
- 3
type: float
parameters:
body:
value:
Expand All @@ -42,6 +45,7 @@ ONNX Model:
shape:
- 2
- 3
type: float
parameters:
B:
value: 10.0
Expand Down Expand Up @@ -80,6 +84,7 @@ ONNX Model:
x_3:
shape:
- 1
type: float
parameters:
B:
value: 100.0
Expand Down
Loading