Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tests/autodiff: Add expected results to test_atomizer_specs Python only, the compiled implementation is broken. Signed-off-by: Jan Vesely <[email protected]> * llvm/builtins: Drop vec_copy Unused. Untested. Signed-off-by: Jan Vesely <[email protected]> * tests/llvm/intrinics: Drop temporary variables with results Signed-off-by: Jan Vesely <[email protected]> * llvm: Convert coth, csch, and tanh to builtin functions Signed-off-by: Jan Vesely <[email protected]> * llvm/tests/builtins: Add tanh, coth, and csch tests Includes benchmark. Signed-off-by: Jan Vesely <[email protected]> * llvm, mechanisms/DDM: Use helpers.fneg instead of opencoding it Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/DDI: Use helpers.fneg instead of opencoding it Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/Distance: Call fabs builtin instead of opencoding it Signed-off-by: Jan Vesely <[email protected]> * llvm/helpers: Convert 'is_close' to builtin function Use fabs builtins instead of opencoding them. Signed-off-by: Jan Vesely <[email protected]> * llvm, tests/builtins: Remove lcoal import of pycuda Signed-off-by: Jan Vesely <[email protected]> * tests/llvm/builtins_matrix: Consolidate 'dot' tests Signed-off-by: Jan Vesely <[email protected]> * github-actions: Restrict tests to 80 mins Signed-off-by: Jan Vesely <[email protected]> * dependabot: Allow up to 15 open pull requests for pip packages Signed-off-by: Jan Vesely <[email protected]> * treewide: Rename Composition argument: 'bin_execute' -> 'execution_mode' (#1924) Signed-off-by: Jan Vesely <[email protected]> * teewide: Don't use 'np.float' Deprecated in numpy 1.20 Signed-off-by: Jan Vesely <[email protected]> * llvm, composition: Preserve CompExecution instances across runs and executions GPU execution already did this, extend the approach to CPU execution. Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Move struct generators closer together Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Store binary buffer of scheduler structures locally Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Store binary structures of state,params, and data locally Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Consolidate debug_flag location to a new parent class Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Move _get_compilation_param to the shared ancestor This will be used by the Mech/FuncExecution. Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Store binary structures for function/mechanism param and state locally Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Deduplicate conversion of function variable Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Fix misleading comment Do not list 7 names for 6 parameters Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Use attribute names instead of object types when syncing back parameter values Improves autodiff benchmarks by 3-5%. Signed-off-by: Jan Vesely <[email protected]> * tests/composition: Run all compiled modes in the recurrent transfer mechanism test Signed-off-by: Jan Vesely <[email protected]> * tests/builtins_random: Drop misleading comment Signed-off-by: Jan Vesely <[email protected]> * llvm/execution: Use correct type to print scheduler conditions structure stats Add 'stat' to the test of debugging flags. Fixes: fd5a419 ("llvm/execution: Store binary buffer of scheduler structures locally") Signed-off-by: Jan Vesely <[email protected]> * tests: Use a new 'func_mode' fixture to parametrize function tests The fixture automatically parametrizes tests using 'Python', 'LLVM', and 'PTX' values. Testing: pytest --co > tests.out Before and after the change is the same (other than the collection time). Signed-off-by: Jan Vesely <[email protected]> * tests: Use a new 'mech_mode' fixture to parametrize mechanism tests The fixture automatically parametrizes tests using 'Python', 'LLVM', and 'PTX' values. Testing: pytest --co > tests.out Before and after the change is the same (other than the collection time). Signed-off-by: Jan Vesely <[email protected]> * llvm, tests/mechanisms: Enable partial LLVM/PTX tests for integration_rate_0_8_initial_0_5 Signed-off-by: Jan Vesely <[email protected]> * llvm, tests/control_mechanism: Remove unsupported per-node PTX execution mode Fixes: 5c5d747 ("llvm/cuda: Drop references to per node PTX execution") Signed-off-by: Jan Vesely <[email protected]> * tests: Use a new 'comp_mode' fixture to parametrize composition tests The fixture automatically parametrizes the test using 'Python', 'LLVM', 'LLVMExec', 'LLVMRun', 'PTXExec', and 'PTXRun' values. Testing: pytest --co > tests.out The only changes are slight reordering of tests and parameters, execution mode is put in the first place for 'test_run_composition_vector' and 'test_ddm_is_finished'. Signed-off-by: Jan Vesely <[email protected]> * llvm, tests/composition/control: Enable PTX variants of more tests test_multilevel_control test_recurrent_control test_grid_search_random_selection test_input_CIM_assignment Signed-off-by: Jan Vesely <[email protected]> * tests/mechanism: Add explanatory comments to tests that need compiled scheduler Signed-off-by: Jan Vesely <[email protected]> * tests/RecurrentTransferMechanism: Simplify parameter ids Signed-off-by: Jan Vesely <[email protected]> * tests/composition: Clarify comment in AAB_integrator test Signed-off-by: Jan Vesely <[email protected]> * tests: Use pytest helper to generate super sets of composition execution modes Signed-off-by: Jan Vesely <[email protected]> * tests/llvm/builtins_matrix: Add PTX variants of hadamard and scalar tests Signed-off-by: Jan Vesely <[email protected]> * tests/llvm/builtins_vector: Add PTX variants of all vector tests Signed-off-by: Jan Vesely <[email protected]> * tests/composition: Remove duplicate run input generator tests The exact same tests are in TestRunInputSpecifications. Signed-off-by: Jan Vesely <[email protected]> * llvm/cuda, tests/composition: Add PTXRun variant of the fallback test Fix PTXExec marks. Signed-off-by: Jan Vesely <[email protected]> * tests: Use a new 'autodif_mode' fixture to parametrize composition tests The fixture automatically parametrizes tests using 'Python' and 'LLVMRun' values. The following tests are now enabled and skipped at runtime: test_pytorch_loss_spec[LLVMRun] test_params_stay_separate[LLVMRun] test_xor_nested_no_train_then_train[LLVMRun-400-4-10-1e-05] Signed-off-by: Jan Vesely <[email protected]> * tests/integrator_mechanism: Rename 'mode' -> 'mech_mode' for consistency Signed-off-by: Jan Vesely <[email protected]> * tests/control_mechanism: Drop redundant 'mode' parameter Signed-off-by: Jan Vesely <[email protected]> * Buffer: do not replace initializer of 0s with default * LeabraFunction: make training_flag dependent on network * llvm, components/OutputPort: Use cost function of the port function instead of port's FunctionParam Signed-off-by: Jan Vesely <[email protected]> * llvm, AutodiffComposition: Use matrices of projection functions instead projections' alias Signed-off-by: Jan Vesely <[email protected]> * llvm, component: Do not include SharedParameters in compiled structures Values of SharedParameters are already stored elsewhere. Signed-off-by: Jan Vesely <[email protected]> * llvm, composition: Replace execution_mode string with enum.Flags Signed-off-by: Jan Vesely <[email protected]> * fix: monkey patch rich.console._is_jupyter for colab * Fixed the patch * Codestyle fixes and better documentation * requirements: Restrict rich to <9.13 Signed-off-by: Jan Vesely <[email protected]> * fix(Parameter): setting value of Parameter to a method code intended to ensure Components whose methods are set as a Parameter value after intiialization are marked for context initialization would mark any object, which could cause crashes * refac(utilities): exclude bool and enum from is_numeric * fix(utilities): copy_iterable_with_shared: failure for defaultdict * fix(utilities): numpy DeprecationWarning casting np.integer to float convert_all_elements_to_np_array: cast and pass through non-ragged arrays * fix(utilities): numpy array_equals DeprecationWarning for embedded arrays * tests: Add fixture for compiled composition tests that don't support per-node compilation This changes the order of generated tests slightly. Signed-off-by: Jan Vesely <[email protected]> * Component: make dot-notation base use get instead of _get * Component: only call _update_default_variable on Components * BayesGLM: fix attribute typo in error messages * IntegratorFunction: sort parameter names for incorrect length error * Feat/pnl progress (#1938) * • composition.py - run(): use rich.Progress for looping through trials * - * - * - * - * - * - * - * - * - * - * - * • composition.py - import placed at top * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): clean-up of rich.progress code * • composition.py - run(): clean-up of rich.progress code * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): simulation progress now working properly * • composition.py - run(): added show_progress and show_output args - execute(): added show_output arg * • composition.py - run(): modified example in controlsignal.py docstring to pass test * • composition.py - run(): modified example in controlsignal.py docstring to pass test * - * • Pulled from current devel * • composition.py: bug fixes * - * • composition.py - last commit before implementing PNLprogress * • composition.py - first draft using PNLProgress and _report_output * • composition.py - first draft using PNLProgress and _report_output * - * - * - * - * • PNLProgress working * - * • PNLProgress: elaborated for future support of pnl_view * - * • progress.py: added support for showing simulations * • progress.py: added support for showing simulations * - * - * - * • Fixed bug causing crash in test_nested_composition_run * • Fixed bug causing crash in test_nested_composition_run * - * • Codestyle fixes * • progress.py: - fixed simulation progress reporting - should consolidate all executions in a given simualation to a single task • composition.py: - limited progress reporting to execute() (no longer in run) • autodiffcomposition.py: - execute: added progress reporting - still need to handle output report * - * - * - * • Merged with devel * - * • Merged with devel * - * - * - * - * - * - * • progress.py: working for nested sims * - * - * - * - * - * • composition.py: docstring updated for output and progress reporting * • progress.py - bug fix • composition.py - change show_output default to False * • progress.py - bug fix * • progress.py - patch trial_num reporting bug (with hack) * • progress.py: before switch from rich_report to full_report * - * - * - * • Progress: before modifying PNLProgers._use_rich * • Progress: implemented CAPTURE option for rich output * - * - * • Preferences.rst - pointed to PreferenceSet.py • preferenceset.py - created docstring to describe Standard Preferences * - * - Co-authored-by: jdcpni <pniintel55> * llvm/execution/cuda: Inline '_get_ctype_bytes' into its only caller Disallow empty structures. This used to be the case for functions without any state. Every component has at least 'execution_count' in its state. Signed-off-by: Jan Vesely <[email protected]> * llvm/execution/cuda: Use numpy full to generate the number of runs Signed-off-by: Jan Vesely <[email protected]> * llvm/execution/cuda: Simplify generation of evaluation input buffer Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/GridSearch: Change select_min signature to use <start, stop) instead of count parameter Signed-off-by: Jan Vesely <[email protected]> * llvm/cuda: Don't reuse allocations array from cuda_evauate It's going away Signed-off-by: Jan Vesely <[email protected]> * llvm, mechanism/OptimizationControl: Add wrapper function to iterate over multiple evaluations. Evaluated sample is generated within the loop. This removes the need to prepopulate an array of possible evaluations. Signed-off-by: Jan Vesely <[email protected]> * llvm/cuda: Use locally generated samples in GPU evaluate Avoid generating allocation array in Python before invoking the GPU kernel. Signed-off-by: Jan Vesely <[email protected]> drop itertools * llvm, mechanisms/OptimizationControl: Move allocation generation to helpers Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/GridSearch: Generate allocation samples locally if not provided Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/GridSearch: Update the best value of the best allocation only once The allocation value is not used in the search loop, so it can be updated at the end after the index of the selected results is known. This avoids generating multiple allocation samples if they're not provided. Signed-off-by: Jan Vesely <[email protected]> * llvm, functions/GridSearch: Rename '_get_optimized_composition' -> '_get_optimized_controller' The function returns and instance of optimization control mechanism. Signed-off-by: Jan Vesely <[email protected]> * llvm/execution, functions/GridSearch: Implement multithreaded parallel evaluate Signed-off-by: Jan Vesely <[email protected]> * Refactor/pnl report (#1942) * • composition.py - run(): use rich.Progress for looping through trials * - * - * - * - * - * - * - * - * - * - * - * • composition.py - import placed at top * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): clean-up of rich.progress code * • composition.py - run(): clean-up of rich.progress code * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): simulation progress now working properly * • composition.py - run(): added show_progress and show_output args - execute(): added show_output arg * • composition.py - run(): modified example in controlsignal.py docstring to pass test * • composition.py - run(): modified example in controlsignal.py docstring to pass test * - * • Pulled from current devel * • composition.py: bug fixes * - * • composition.py - last commit before implementing PNLprogress * • composition.py - first draft using PNLProgress and _report_output * • composition.py - first draft using PNLProgress and _report_output * - * - * - * - * • PNLProgress working * - * • PNLProgress: elaborated for future support of pnl_view * - * • progress.py: added support for showing simulations * • progress.py: added support for showing simulations * - * - * - * • Fixed bug causing crash in test_nested_composition_run * • Fixed bug causing crash in test_nested_composition_run * - * • Codestyle fixes * • progress.py: - fixed simulation progress reporting - should consolidate all executions in a given simualation to a single task • composition.py: - limited progress reporting to execute() (no longer in run) • autodiffcomposition.py: - execute: added progress reporting - still need to handle output report * - * - * - * • Merged with devel * - * • Merged with devel * - * - * - * - * - * - * • progress.py: working for nested sims * - * - * - * - * - * • composition.py: docstring updated for output and progress reporting * • progress.py - bug fix • composition.py - change show_output default to False * • progress.py - bug fix * • progress.py - patch trial_num reporting bug (with hack) * • progress.py: before switch from rich_report to full_report * - * - * - * • Progress: before modifying PNLProgers._use_rich * • Progress: implemented CAPTURE option for rich output * - * - * • Preferences.rst - pointed to PreferenceSet.py • preferenceset.py - created docstring to describe Standard Preferences * - * - * • tests - composition: added test_progress.py with unit tests for PNLProgress • composition.py - execute(): modified context passed to node if it is a mechanism (assigns context.source as ContextFlags.COMPOSITION) * - * • composition.py and progress.py: refactoring show_output and show_progress into: report_output, report_progress, report_simulations, report_to_devices * - * - * • report.py: updated docstrings with new args/attrs * • report.py: - refactored args to use "report" as root - added _use_rich_console and _use_rich_capture - TODO: allow independent controle of consolse and capture * • test_report.py: updated to use report_progress and report_to_devices * - * • report.py: - added independent rich divert and report recording * - * - * - * - * - * - * - * - Co-authored-by: jdcpni <pniintel55> * bug(Report): add undefined imports * tests: reporting: add reportOutputPref output tests * Preferences: allow skipping validation prior to 8c0eecc, any value for reportOutputPref would pass Preference validation due to an iscompatible check of its reference setting (bool). 0f78ef3 allows reportOutputPref to take a str as well. Since there is no obvious non-workaround way to allow a str/bool value in the current validation, this commit allows passing of skip_validation=True to PreferenceSet.set_preference to mimic the old behavior and reenable the str/bool setting * Component: don't store self in parameter_components some Components have a parameter value of one of its methods, which will get parsed back to itself * Fix/report/sims (#1948) * • composition.py - run(): use rich.Progress for looping through trials * - * - * - * - * - * - * - * - * - * - * - * • composition.py - import placed at top * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): clean-up of rich.progress code * • composition.py - run(): clean-up of rich.progress code * - * • composition.py - run(): added support for indeterminate progress using rich * • composition.py - run(): simulation progress now working properly * • composition.py - run(): added show_progress and show_output args - execute(): added show_output arg * • composition.py - run(): modified example in controlsignal.py docstring to pass test * • composition.py - run(): modified example in controlsignal.py docstring to pass test * - * • Pulled from current devel * • composition.py: bug fixes * - * • composition.py - last commit before implementing PNLprogress * • composition.py - first draft using PNLProgress and _report_output * • composition.py - first draft using PNLProgress and _report_output * - * - * - * - * • PNLProgress working * - * • PNLProgress: elaborated for future support of pnl_view * - * • progress.py: added support for showing simulations * • progress.py: added support for showing simulations * - * - * - * • Fixed bug causing crash in test_nested_composition_run * • Fixed bug causing crash in test_nested_composition_run * - * • Codestyle fixes * • progress.py: - fixed simulation progress reporting - should consolidate all executions in a given simualation to a single task • composition.py: - limited progress reporting to execute() (no longer in run) • autodiffcomposition.py: - execute: added progress reporting - still need to handle output report * - * - * - * • Merged with devel * - * • Merged with devel * - * - * - * - * - * - * • progress.py: working for nested sims * - * - * - * - * - * • composition.py: docstring updated for output and progress reporting * • progress.py - bug fix • composition.py - change show_output default to False * • progress.py - bug fix * • progress.py - patch trial_num reporting bug (with hack) * • progress.py: before switch from rich_report to full_report * - * - * - * • Progress: before modifying PNLProgers._use_rich * • Progress: implemented CAPTURE option for rich output * - * - * • Preferences.rst - pointed to PreferenceSet.py • preferenceset.py - created docstring to describe Standard Preferences * - * - * • tests - composition: added test_progress.py with unit tests for PNLProgress • composition.py - execute(): modified context passed to node if it is a mechanism (assigns context.source as ContextFlags.COMPOSITION) * - * • composition.py and progress.py: refactoring show_output and show_progress into: report_output, report_progress, report_simulations, report_to_devices * - * - * • report.py: updated docstrings with new args/attrs * • report.py: - refactored args to use "report" as root - added _use_rich_console and _use_rich_capture - TODO: allow independent controle of consolse and capture * • test_report.py: updated to use report_progress and report_to_devices * - * • report.py: - added independent rich divert and report recording * - * - * - * - * - * - * - * - * - * • report.py - report_output: fixes for simulation reporting * - * • composition.py - evaluate(): added use of Report context in call to composition.run() * - * - * - * - * - * - * • report.py: docstring added * - * - * - * - * • report.py: modify to use ReportOutput enum * - * - * • report.py: refactored to use ReportOutput enum * • report.py: refactored to use ReportDevices enum * • Project: refactored to use ReportOutput and ReportDevices enums • Component: reportOoutputPref property and setter: enforce assigment and retrieval of ReportOutput * • Project: refactored to use ReportProgress and ReportSimulations enums * - * - * • basepreferenceset.py: - modified reportOutputPref handling to convert False to ReportOutput.OFF and True to ReportOutput.TERSE * - * • report.py: allow reportOutputPrefs to be a list that includes 'params' and a ReportOutput option * - * - * - Co-authored-by: jdcpni <pniintel55> Co-authored-by: Jan Vesely <[email protected]> Co-authored-by: Jan Vesely <[email protected]> Co-authored-by: David Turner <[email protected]> Co-authored-by: jdcpni <[email protected]>
- Loading branch information