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

Devel #2449

Merged
merged 151 commits into from
Jul 28, 2022
Merged

Devel #2449

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
532f270
llvm, mechanism: Simplify output port variable spec parsing
jvesely Mar 28, 2022
018474a
llvm: Split allocating new space in params with history from populati…
jvesely Mar 29, 2022
35d1c75
llvm, mechanism: Pass pointer to new mech value to functions invocation
jvesely Mar 29, 2022
486540f
llvm, mechanism: Reuse function output location if possible
jvesely Mar 29, 2022
957a6e1
llvm, mechanism/OCM: Convert function output to mechanism value on fu…
jvesely Mar 29, 2022
da76696
Merge remote-tracking branch 'origin/devel' into devel
jvesely Apr 2, 2022
33fdec2
llvm, mechanism: Make sure 'num_executions' parsed port inputs are 1d…
jvesely Apr 3, 2022
b1f3d67
llvm, mechanism: Restrict output port shape workaround to Control and…
jvesely Apr 3, 2022
d47897f
tests/ControlMechanism: Add checks for ControlMechanism allocation pa…
jvesely Apr 5, 2022
2573812
llvm, component: Use existing method to get Time values by TimeScale
jvesely Apr 6, 2022
8e9ee11
tests: Make sure all 'cuda' marked tests are also marked 'llvm'
jvesely Apr 6, 2022
6b7b41f
llvm, mechanism/LCControlMechanism: Prefer array type to struct when …
jvesely Apr 4, 2022
a025465
mechanism/ControlMechanism: Drop DefaultAllocationFunction
jvesely Apr 3, 2022
0c1d805
llvm, mechanism: Remove workaround for shape mismatch between mechani…
jvesely Apr 4, 2022
387f43b
mechanism/ControlMechanism: Remove obsolete workaround
jvesely Apr 4, 2022
56ad6d7
Scheduler, Composition: fix condition loss during scheduler rebuild (…
kmantel Apr 7, 2022
5772e4d
github-actions: Use v0.0.0.0 as dummy tag to compare documentation on…
jvesely Apr 7, 2022
0a9c27f
requirements: update pillow requirement from <9.1.0 to <9.2.0 (#2370)
dependabot[bot] Apr 7, 2022
12bc129
requirements: update pandas requirement from <=1.4.1 to <1.4.3 (#2373)
dependabot[bot] Apr 7, 2022
c96af61
Merge remote-tracking branch 'origin/devel' into devel
jvesely Apr 8, 2022
542fae8
llvm, mechanism: Reuse space for mechanism.value for function output …
jvesely Apr 8, 2022
6f0f0da
github-actions(deps): bump actions/github-script from 5 to 6 (#2317)
dependabot[bot] Apr 8, 2022
0c1b854
Component: don't exclude _init_args from deepcopy (#2380)
kmantel Apr 9, 2022
55fe051
Feat/compositon/additonal pathway syntax (#2381)
jdcpni Apr 10, 2022
15a2fb3
github-actions(deps): bump actions/download-artifact from 2 to 3 (#2378)
dependabot[bot] Apr 11, 2022
36c611a
Feat/compositon/additonal pathway syntax (#2382)
jdcpni Apr 11, 2022
e941c55
Composition: fix TERMINAL node detection (#2384)
kmantel Apr 12, 2022
d3639ca
Feat/compositon/additonal pathway syntax (#2385)
jdcpni Apr 12, 2022
a3bbf8b
requirements: update autograd requirement from <=1.3 to <1.5 (#2379)
dependabot[bot] Apr 13, 2022
150bec2
Feat/compositon/additonal pathway syntax (#2387)
jdcpni Apr 13, 2022
9030213
llvm/execution: Add support for structs to _element_dtype
jvesely Apr 11, 2022
ab152aa
tests: Add cmdline option to select compiler fp precision
jvesely Apr 14, 2022
89dcaab
tests/models/predator-prey: Add fp32 variant
jvesely Apr 12, 2022
6e7e498
llvm: Add support for different floating point precision conversions
jvesely Apr 15, 2022
646d790
llvm, UDF: Create Python float instance instead of string "Inf"
jvesely Apr 15, 2022
57f9984
llvm/builtins: Split 'is_close' builtin implementation by type
jvesely Apr 15, 2022
bf7383e
tests, llvm/helpers: Convert numpy arrays to expected fp format
jvesely Apr 15, 2022
029bf71
tests, llvm/mt_random: Use function parameter types instead of hardco…
jvesely Apr 15, 2022
3258bcc
tests, llvm/builtins_vector: Cast operands to the correct type
jvesely Apr 15, 2022
3f9ef5c
tests/llvm/builtins: Consolidate matrix ops tests
jvesely Apr 15, 2022
44f4123
tests/llvm/custom_func: Drop fixed dimension vector matrix multiply
jvesely Apr 15, 2022
9b9c725
tests/llvm/custom_func: Use pnlvm.ir instead of importing llvmlite ir…
jvesely Apr 15, 2022
8174a4e
tests/llvm/compile: Convert arguments to the correct fp precision
jvesely Apr 15, 2022
a65c3f4
tests: Consolidate spelling of 'Philox' to easily identify philox tests
jvesely Apr 15, 2022
627adc8
llvm/builtins: Change 'tanh' formula to better handle large input
jvesely Apr 16, 2022
0344cc8
tests/llvm/builtins: Convert parameters to correct type in PTX tests
jvesely Apr 16, 2022
1e01666
requirements: update graphviz requirement from <0.20.0 to <0.21.0 (#2…
dependabot[bot] Apr 19, 2022
0aa4359
github-actions/pnl-install: Check if a newly bumped dependency is rol…
jvesely Apr 19, 2022
4dbd0c9
github-actions/install-pnl: Fix lookup of dep packages (#2392)
jvesely Apr 20, 2022
191b216
github-actions/pnl-ci-docs: Skip removing zero tag if the tag creatio…
jvesely Apr 20, 2022
1f6a4ab
requirements: update networkx requirement from <2.8 to <2.9 (#2383)
dependabot[bot] Apr 20, 2022
34d79a9
Parameter: remove delivery_condition from _additional_param_attr_prop…
kmantel Apr 16, 2022
0ca4de0
tests: Parameters: add check for _additional_param_attr_properties
kmantel Apr 16, 2022
e1a9eb0
Merge remote-tracking branch 'origin/devel' into devel-llvm
jvesely Apr 21, 2022
d139b47
tests/llvm/builtins_{matrix,vector}: Make sure inputs are representab…
jvesely Apr 21, 2022
547ceb0
tests/models/necker_cube: Use higher tolerance when running in fp32 mode
jvesely Apr 21, 2022
e95af01
Merge pull request #2388 from kmantel/parameters
kmantel Apr 21, 2022
134196f
ControlMechanism: set function default to Identity
kmantel Apr 9, 2022
597cc53
ControlMechanism: set monitor_for_control default to []
kmantel Apr 9, 2022
b7b5846
Merge pull request #2394 from kmantel/cmech
kmantel Apr 23, 2022
e7b1118
llvm/builtins: Change 'coth' formula to better handle large input
jvesely Apr 25, 2022
4774674
llvm/builtins: Change 'csch' formula to better handle large input
jvesely Apr 25, 2022
9f6d48b
tests/functions/distribution: Refactor test parameters
jvesely Apr 24, 2022
04b660d
tests/functions/Distribution: Add fp32 expected values
jvesely Apr 25, 2022
d8b8f86
tests/functions/Selection: Add Philox fp32 results
jvesely Apr 25, 2022
1928717
test/functions/Memory: Remove dead code
jvesely Apr 25, 2022
077b890
tests/TestMiscTrainingFunctionality: Add fp32 results
jvesely Apr 25, 2022
c209061
tests/composition/control: Add testing for fp32 results and fp32 prec…
jvesely Apr 25, 2022
d88fe5e
tests/function/Memory: Adjust probabilities for storage/retrieve
jvesely Apr 25, 2022
5e84afa
requirements: update pytest requirement from <7.1.2 to <7.1.3 (#2396)
dependabot[bot] Apr 26, 2022
21eecbf
MemoryFunction: use Buffer _update_default_variable fix
kmantel Apr 20, 2022
9aa3ebd
MemoryFunction: _update_default_variable: handle ragged arrays
kmantel Apr 20, 2022
2be42da
Merge pull request #2395 from kmantel/memoryfunction
kmantel Apr 28, 2022
c7f21f8
KWTAMechanism: set matrix according to tests (#2398)
kmantel Apr 28, 2022
5e8fc13
tests/functions/Distribution: Pass PRNG type as explicit test parameter
jvesely Apr 29, 2022
cc3e743
tests/functions/Distribution: Add special case result for PTX fp32 test
jvesely Apr 29, 2022
96bb7f7
Merge remote-tracking branch 'origin/devel' into devel-llvm
jvesely Apr 29, 2022
f939a97
llvm: Add option to use 32bit floating point representation (#2400)
jvesely Apr 29, 2022
022aa4a
components: add default_variable as constructor_argument where missing
kmantel Apr 12, 2022
e96ad26
Component: set correct Parameter owner on Component deepcopy
kmantel Apr 28, 2022
1f80446
Merge pull request #2399 from kmantel/component
kmantel May 3, 2022
08552bb
Parameters: fix Parameter inheritance when setting attributes (#2402)
kmantel May 4, 2022
7957581
llvm/builtins: Drop dead code
jvesely May 6, 2022
3dd4a81
llvm/builder_context: Use llvm.ir module directly
jvesely May 6, 2022
cb1867b
llvm, functions/SoftMax: Add check for supported output types
jvesely May 6, 2022
ae5e496
tests/functions/transfer: Refactor tests to use pytest.param(id=)
jvesely May 6, 2022
482d36c
llvm, functions/OneHot: Add support for PROB output type
jvesely May 6, 2022
09e6969
llvm, functions/OneHot: Convert MAX_VAL and MAX_INDICATOR to use OneHot
jvesely May 6, 2022
f2b47d4
llvm, mech/ProcessingMechanism: Enable testing of "PROB" standard out…
jvesely May 6, 2022
a08f1b4
Revert "requirements: update pytorch requirement from <1.9.0 to <2.0.…
jvesely May 10, 2022
f79d94b
Parameters: allow specification in inner class or __init__
kmantel Mar 30, 2022
718decd
utilities: combine signature caches
kmantel May 4, 2022
707229d
Parameter: add specify_none flag
kmantel May 5, 2022
d1461ee
components: add check_user_specified decorator for _user_specified
kmantel Apr 7, 2022
7bcc202
Merge pull request #2406 from kmantel/parameters
kmantel May 12, 2022
ca5c19d
Merge remote-tracking branch 'origin/devel' into devel-llvm
jvesely May 14, 2022
e85dcf8
llvm, mechanism/RecurrentTransferMechanism: Drop combination_function…
jvesely May 15, 2022
0881dbf
llvm: Add support for more SoftMax output types (#2418)
jvesely May 16, 2022
08da75c
llvm/UDF: Reuse metadata from variable builder in codegen builder
jvesely May 17, 2022
00aa36c
llvm: Always emit debuginfo with LLVM IR
jvesely May 17, 2022
2e8349b
llvm/UDF: Update debug code location for every parsed AST node
jvesely May 17, 2022
af25311
llvm/UDF: Add detailed line debugging information to generated IR (#2…
jvesely May 17, 2022
6aaa9e7
llvm/builder_context: Simplify debug info handling
jvesely May 24, 2022
607449a
llvm, mechanisms/LCControlMechanism: Use helpers to load mechanism pa…
jvesely May 27, 2022
3af52ff
llvm, mechanisms/LCControlMechanism: Overload _gen_llvm_mechanism_fun…
jvesely May 27, 2022
3474991
llvm, mechanisms/DDM: Cleanup handling of PROBABILITY_UPPER_THRESHOLD…
jvesely May 27, 2022
24f0fd9
llvm, mechanisms/DDM: Move DDA decision selection to _gen_llvm_mechan…
jvesely May 27, 2022
274b233
llvm, mechanisms/DDM: Drop value shape workaround for integrator base…
jvesely May 28, 2022
f620ab8
mechanisms/ControlMechanism: Drop unused import of psyneulink.llvm
jvesely May 28, 2022
59610d7
llvm/builder_context: Use load_extract_scalar_array_one helper to loa…
jvesely May 30, 2022
06adf66
llvm, functions/DrifDiffusionIntegrator: Remove unneeded shape workar…
jvesely May 31, 2022
827ff8a
llvm, mechanisms/TransferMechanism: Use existing helper to load scala…
jvesely May 31, 2022
a90236a
llvm: Cleanup codegen of mechanisms that modify function return value…
jvesely May 31, 2022
c49919f
github-actions(deps): bump actions/setup-python from 3 to 4 (#2425)
dependabot[bot] Jun 9, 2022
480d2cc
requirements: update psyneulink-sphinx-theme requirement (#2426)
dependabot[bot] Jun 10, 2022
20598ad
DriftOnASphereIntegrator: change default dimension to 3 (#2428)
kmantel Jun 16, 2022
bd01378
Composition: add_projection: also detect feedback from node roles (#2…
kmantel Jul 7, 2022
a6bb29f
llvm/ConditionGenerator: Refactor structure/initializer methods to no…
jvesely Jun 28, 2022
e98c79f
functions/GridSearch: Rename '_run_grid' -> '_search_grid'
jvesely Jul 11, 2022
2cd3c70
llvm/execution: Check for errors in jobs submitted to thread pool exe…
jvesely Jul 12, 2022
f533feb
function/OptimizationFunction: Allow array based SampleIterator in co…
jvesely Jul 12, 2022
9c91851
JSON/MDF: determine fixed onnx noise values at test time (#2441)
kmantel Jul 14, 2022
7047db9
tests: MDF: correct os-specific filepaths
kmantel Jul 8, 2022
55de596
MDF: support v0.3.4; import from MDF classes
kmantel Mar 18, 2022
6c9ae3f
MDF: update interface methods
kmantel May 18, 2022
2c58d05
MDF: add yaml_summary
kmantel May 20, 2022
8c55719
MDF: rename JSONDumpable to MDFSerializable
kmantel May 20, 2022
61379d2
MDF: update all documentation from JSON to MDF
kmantel May 20, 2022
6f64cec
MDF: rename json files to mdf
kmantel May 20, 2022
44ec853
MDF: remove manual arg substitution in expressions
kmantel Jun 17, 2022
6e7a9b9
Merge pull request #2442 from kmantel/mdf-import-from-classes
kmantel Jul 18, 2022
c746c24
requirements: update graph-scheduler requirement (#2391)
dependabot[bot] Jul 19, 2022
8a8ee21
llvm/debug: Print parallel execution time when "time_stat" is set
jvesely Jul 19, 2022
42a61c8
Merge remote-tracking branch 'origin/devel' into devel
jvesely Jul 19, 2022
4ff53fa
llvm: Improve parallel execution handling (#2443)
jvesely Jul 19, 2022
c9cdd81
requirements: update pillow requirement from <9.2.0 to <9.3.0 (#2436)
dependabot[bot] Jul 19, 2022
053fdb7
function/OptimizationFunction: Move Python specific code to non-compi…
jvesely Jul 19, 2022
930c8af
functions/OptimizationFunction: Disable aggregation in compiled mode
jvesely Jul 19, 2022
21c74d7
functions/GridSearch: Refactor parallel compiled path to reuse existi…
jvesely Jul 19, 2022
21936e1
requirements: update pandas requirement from <1.4.3 to <1.4.4 (#2434)
dependabot[bot] Jul 20, 2022
f26a21e
github-actions: Install latest pip and wheel when testing new depende…
jvesely Jul 20, 2022
e12d05f
Merge remote-tracking branch 'origin/devel' into devel
jvesely Jul 20, 2022
39b7371
functions/GridSearch: Refactor parallel compiled path to reuse existi…
jvesely Jul 20, 2022
e68ad27
requirements: update elfi requirement from <0.8.4 to <0.8.5 (#2427)
dependabot[bot] Jul 21, 2022
fc961e4
requirements: update matplotlib requirement from <3.5.2 to <3.5.3 (#2…
dependabot[bot] Jul 21, 2022
3d1b64d
requirements: update torch requirement from <1.9.0 to <1.12.0 (#2446)
jvesely Jul 22, 2022
508935c
requirements: update pint requirement from <0.18 to <0.20 (#2447)
jvesely Jul 22, 2022
dccb43c
requirements: update llvmlite requirement from <0.39 to <0.40 (#2451)
dependabot[bot] Jul 27, 2022
5f6875f
github-actions: Drop python3.7 macos job (#2453)
jvesely Jul 27, 2022
c863276
requirements: Bump pycuda to <2023 (#2452)
jvesely Jul 27, 2022
0be359f
requirements: update numpy requirement from <1.21.4 to <1.21.7 (#2454)
jvesely Jul 27, 2022
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
19 changes: 19 additions & 0 deletions .github/actions/install-pnl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ runs:
[[ ${{ runner.os }} = Windows* ]] && pip install "pywinpty<1" "terminado<0.10"
fi

- name: Install updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') && matrix.pnl-version != 'base' }}
shell: bash
id: new_package
run: |
python -m pip install --upgrade pip wheel
export NEW_PACKAGE=`echo '${{ github.head_ref }}' | cut -f 4 -d/ | sed 's/-gt.*//' | sed 's/-lt.*//'`
echo "::set-output name=new_package::$NEW_PACKAGE"
pip install "`echo $NEW_PACKAGE | sed 's/[-_]/./g' | xargs grep *requirements.txt -h -e | head -n1`"
pip show "$NEW_PACKAGE" | grep 'Version' | tee new_version.deps

- name: Python dependencies
shell: bash
run: |
Expand All @@ -66,3 +77,11 @@ runs:
pip cache remove -v $P || true
fi
done

- name: Check updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') && matrix.pnl-version != 'base' }}
shell: bash
run: |
pip show ${{ steps.new_package.outputs.new_package }} | grep 'Version' | tee installed_version.deps
cmp -s new_version.deps installed_version.deps || echo "::error::Package version restricted by dependencies: ${{ steps.new_package.outputs.new_package }}"
diff new_version.deps installed_version.deps
4 changes: 2 additions & 2 deletions .github/workflows/compare-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: 'Download docs artifacts'
id: docs-artifacts
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
(diff -r docs-base docs-head && echo 'No differences!' || true) | tee ./result.diff

- name: Post comment with docs diff
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
var fs = require('fs');
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pnl-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
branch: master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
Expand Down Expand Up @@ -94,17 +94,21 @@ jobs:
- name: Add git tag
# The generated docs include PNL version,
# set it to a fixed value to prevent polluting the diff
# This needs to be done after installing PNL
# to not interfere with dependency resolution
id: add_zero_tag
if: github.event_name == 'pull_request'
run: git tag --force 'v999.999.999.999'
run: git tag --force 'v0.0.0.0'

- name: Build Documentation
run: make -C docs/ html -e SPHINXOPTS="-aE -j auto"

- name: Remove git tag
# The generated docs include PNL version,
# This was set to a fixed value to prevent polluting the diff
if: github.event_name == 'pull_request' && always()
run: git tag -d 'v999.999.999.999'
# A special tag was set to a fixed value
# to prevent polluting the diff
if: steps.add_zero_tag.outcome != 'skipped'
run: git tag -d 'v0.0.0.0'

- name: Upload Documentation
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -151,7 +155,7 @@ jobs:
ref: gh-pages

- name: Download branch docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
path: _built_docs/${{ github.ref }}
Expand All @@ -168,7 +172,7 @@ jobs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'

- name: Download main docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
# This overwrites files in current directory
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
extra-args: ['']
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# 3.7 is broken on macos-11, https://github.com/actions/virtual-environments/issues/4230
- python-version: 3.7
python-architecture: 'x64'
os: macos-10.15
# add 32-bit build on windows
- python-version: 3.8
python-architecture: 'x86'
Expand Down Expand Up @@ -54,7 +50,7 @@ jobs:
run: git fetch --tags origin master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -78,13 +78,13 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/
Expand Down Expand Up @@ -175,13 +175,13 @@ jobs:

steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: Python-dist-files
path: dist/

- name: Upload dist files to release
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
const fs = require('fs')
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Created by https://www.gitignore.io/api/osx,python,pycharm

# Ignore JSON files created in tests/json/
# Ignore JSON files created in tests/mdf/
# Maybe these should be generated in tmpdir instead
tests/json/*.json
tests/mdf/*.json

# Log files created by SLURM jobs in this directory
Scripts/Debug/predator_prey_opt/logs/
Expand Down
25 changes: 25 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@
def pytest_addoption(parser):
parser.addoption('--{0}'.format(mark_stress_tests), action='store_true', default=False, help='Run {0} tests (long)'.format(mark_stress_tests))

parser.addoption('--fp-precision', action='store', default='fp64', choices=['fp32', 'fp64'],
help='Set default fp precision for the runtime compiler. Default: fp64')

def pytest_sessionstart(session):
precision = session.config.getvalue("--fp-precision")
if precision == 'fp64':
pnlvm.LLVMBuilderContext.default_float_ty = pnlvm.ir.DoubleType()
elif precision == 'fp32':
pnlvm.LLVMBuilderContext.default_float_ty = pnlvm.ir.FloatType()
else:
assert False, "Unsupported precision parameter: {}".format(precision)

def pytest_runtest_setup(item):
# Check that all 'cuda' tests are also marked 'llvm'
assert 'llvm' in item.keywords or 'cuda' not in item.keywords

for m in marks_default_skip:
if m in item.keywords and not item.config.getvalue(m):
pytest.skip('{0} tests not requested'.format(m))
Expand Down Expand Up @@ -97,6 +112,16 @@ def comp_mode_no_llvm():
# dummy fixture to allow 'comp_mode' filtering
pass

@pytest.helpers.register
def llvm_current_fp_precision():
float_ty = pnlvm.LLVMBuilderContext.get_current().float_ty
if float_ty == pnlvm.ir.DoubleType():
return 'fp64'
elif float_ty == pnlvm.ir.FloatType():
return 'fp32'
else:
assert False, "Unknown floating point type: {}".format(float_ty)

@pytest.helpers.register
def get_comp_execution_modes():
return [pytest.param(pnlvm.ExecutionMode.Python),
Expand Down
2 changes: 1 addition & 1 deletion cuda_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pycuda >2018, <2022
pycuda >2018, <2023
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupyter<=1.0.0
pytest<7.1.2
pytest<7.1.3
pytest-benchmark<3.4.2
pytest-cov<3.0.1
pytest-helpers-namespace<2021.12.30
Expand Down
2 changes: 1 addition & 1 deletion doc_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
psyneulink-sphinx-theme<1.2.3.1
psyneulink-sphinx-theme<1.2.4.1
sphinx<4.2.1
sphinx_autodoc_typehints<1.16.0
Loading