-
Notifications
You must be signed in to change notification settings - Fork 13
Fix erroneous use of Threads.nthreads
and Threads.threadid
#171
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
Conversation
This is an alternative to #170. |
I can't tell why the tests are failing: the error is happening in |
I think I have a clue of what's happening in the failing CI check. The errors are reported to happen in
Now, that line is (as part of a loop):
And the innermost error is reported to happen in a call to `setindex!, with the following message:
This is as if Here's where I am lost, because
When I debug it locally, at this point @Datseris : are you aware of such a change? If that's the case, maybe that change was considered a bug fix - normally |
Yes, I think I was in the right track. In version 2.4 of StateSpaceSets.jl:
But why the last change I attempted to test this doesn't work? In the compat section of
But in the ci report:
|
Ok, now the test is passing, but I'm still a bit concerned about the robustness of the fix. The last change is in a method with the signature:
where There I have changed |
Also, I have not checked the impact of these changes in performance, specially in threaded vs. "normal" versions, which in #170 suffered a regression according to @asinghvi17 |
I am sorry it took a while to answer. Yes, you have found the problem correctly: i have fixed the The concern you state in the above message, I don't think you should be concerned about it. Since @asinghvi17 do you mind reviewing here and discussing the differneces between this PR and yours? I have seen only your own comments on your PR that say that actually the PR's threaded version is drastically slower (and hence something must not be right?). |
@heliosdrm do you have any perfomrance problems with this PR? Is the threaded version faster as it should be? |
I haven't checked yet. This weekend I only had acces to a 10+ year old computer, and I think that benchmarks made with it would not be representative of "real world" performance. I'll try today or in coming days. Would |
yes. But you could also just run the same function with starting julia with 1 thread or with max threads. |
I tried with the script, although it is very outdated and needed a bit of a hack - using an old version of This is the output:
Julia Version 1.10.8 |
Oh... For reference, if you run the same script in the master branch, what do you get? |
In main (applying only the fix to This is the output in main (same machine and dependencies as before):
|
Let's wait for @asinghvi17 's input before. |
The last commit makes the code look much more as it was before: I have used Although to be fair, after re-running the benchmark script various times, I see that the timings are quite variable, and the regression seen between the two that I reported before is within the range of that variability. |
@heliosdrm thanks for doing this. So if I understand correctly, now with also using |
@asinghvi17 perhaps you also want to have a final look? |
That is how I see it, yes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks @heliosdrm!
@Datseris : ready to merge? |
yes, sorrry for the delay I am a bit swamped! please give me a couple of days and I will merge this in! |
Fixes #169 using
Channel
.