-
Notifications
You must be signed in to change notification settings - Fork 59
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
Make SequenceLearner points hashable by passing the sequence to the function. #266
Conversation
897d4c8
to
093f148
Compare
Co-Authored-By: Anton Akhmerov <[email protected]>
e5f7dd5
to
35930c7
Compare
I propose to:
@basnijholt what do you think? |
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 79.52% 79.68% +0.16%
==========================================
Files 32 33 +1
Lines 4424 4416 -8
Branches 815 814 -1
==========================================
+ Hits 3518 3519 +1
+ Misses 779 768 -11
- Partials 127 129 +2
Continue to review full report at Codecov.
|
Sorry, I'm having second thoughts. Passing the complete sequence of arguments to the function means we're distributing it across all workers. Is that definitely OK? It might be, but I think we should consider this carefully. |
Ultimately I think this would only be a problem in extremely exotic cases, and the simplification of the codebase justifies this downside. |
I actually lean towards not accepting the overhead. From learning the following function on a
Which will always return 1, I learn that the sequence will be serialized and send each point! As an alternative solution, I have opened https://github.com/python-adaptive/adaptive/pull/268/files. Which appeared to be way less work than I thought initially. |
Superseded by #268. |
I'm actually not sure whether creating multiple copies of a sequence is an important limitation and I am wondering whether we should merge this anyway. I still believe this implementation of a sequence learner is simpler, and therefore deserves consideration separate of its relation to #265. @jbweston, what do you think? |
@akhmerov, I've benchmarked this and the overhead is completely unacceptable. For example, at this exact moment I am doing simulations with
|
OK, fair enough. |
Description
With this change, the function of the
SequenceLearner
contains the sequence.This is needed because points that are passed to the
Runner
need to be hashable, and this is not required by the entries of thesequence
inSequenceLearner
.Fixes #265
Checklist
pre-commit run --all
(first install usingpip install pre-commit
)pytest
passedType of change
Check relevant option(s).