-
Notifications
You must be signed in to change notification settings - Fork 33
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
Bug in LLVM mode when executing LCA on multiple trials #3164
Comments
To start excluding possible reasons for the discrepancy between python and llvm mode, I first set up my test to have completely separate mechanisms and compositions run in each mode. This is to make sure that the bug is not related to resetting the composition between runs. However, the discrepancy remains even when running it this way.
Next, I checked whether the issue was related to the LCA mechanism being the origin node of the composition, so I simply added a processing mechanism as origin node that projects to the LCA. The discrepancy remained. Next, I tried changing the termination_threshold on the LCAs from 2 to 1. Now the results align again between python mode and llvm mode. This raises the possibility that the discrepancy is somehow related to termination_threshold.
Turning the termination_threshold back to 2, I checked whether the issue is related to execute_until_finished. So I set it to false, and added a mechanism to the composition that receives input from the LCA and is scheduled to execute only when the lca is 'finished'. However, now the composition running in LLVM mode does not seem to finish. Whether that is a separate issue, or part of the problem, I do not know.
|
Just to add to the last bit of code posted in my previous comment: removing the scheduler condition for comp_llvm does allow the composition to finish, but now (as expected) its results are based on only a single execution of the lca per trial. This indicates to me that there might be something wrong with the LCA's internal 'finished' flag setting to True in LLVM mode when termination_threshold is > 1.
|
produces the same results for both Python and compiled run:
The LLVMExec and LLVM modes should be renamed to avoid user confusion. closing. feel free to reopen if there still is a problem when using LLVMRun |
Note: edited for typo in code Thank you for pointing out the difference between pnl.ExectionMode.LLVM and pnl.ExecutionMode.LLVMRun. While the basic example indeed produces the same results for both Python and compiled run, the example below still does not. In this example, the composition more closely resembles what I usually work with, where on each trial an LCA is first scheduled to execute a certain number of times and then the LCA and a DDM both execute on each pass until the DDM reaches threshold. A 'gate' mechanism is included in the composition, which is scheduled to only execute once the DDM finishes and thus prevents the trial from terminating until the DDM is finished.
Running this script returns
|
This looks similar to #3142. I'll check this example once I have a fix for #3142. |
collecting the same tracking information as #3142 :
shows the same issue. calls to reset update mechanism and output port values which is not done in the compiled version. |
The following two calls to run, once in Python mode and once in LLVM mode, do not provide the same results on the second trial.
The text was updated successfully, but these errors were encountered: