Conversation
…ingComposite with FixedEmbeddingComposite in advantage.py
| chain_strength: float | None = None, | ||
| use_clique_embedding: bool = False, | ||
| token: str | None = None, | ||
| elapse_times: bool = False, |
There was a problem hiding this comment.
Didn't we consider that the flag that refers to measuring time should be in the method, not in the whole class?
There was a problem hiding this comment.
I opened up an issue related to this: #57 (comment) (and your kacper3615/penalty_weights btw).
Please take a look at the Advantage.init function:

As we put the find_clique_embedding func. call in the .init (and rightly, follows later on why) and the timing measurements are optional, some flag needs to determine it.
Please note that a similar issue occurs with penalty_weights due to the same reason of find_clique_embedding in the .init.
|
|
||
| return SolverResult(result, {"penalty_weights": penalty_weights}, []) | ||
| return SolverResult( | ||
| result, {"penalty_weights": penalty_weights}, [], sampleset_info |
There was a problem hiding this comment.
It should be changed based on the changes suggested in the comment above
There was a problem hiding this comment.
Not sure I understand this one, could you take a look at it if it's ok now or describe it once again?
|
|
||
|
|
||
| def execute_timed( | ||
| func: Callable, measure_time: bool, times_dict: Dict, key: str |
There was a problem hiding this comment.
Here there should be no mesure_time flag. Unless we want to measure time we should not perform this method, so I would remove this flag
There was a problem hiding this comment.
Please take a look of how this method is called in the code.
The idea of this function is to wrap a function with the start = time.perf_counter() and end = time.perf_counter() clauses to facultatively measure function's execution time.
It is to avoid explicit "ifs" in the .solve code in many places (4 function calls to measure) (boilerplate).
Please let me know if you'd like to:
- stay with the execute_timed function - minimal overhead, quickest.
- a decorator function - esthetic reasons, minimally slower.
Unless we want to always measure time - the execution overhead is nothing - just time.perf_counter call). But I wouldn't do it, it's unclean.
kacper3615
left a comment
There was a problem hiding this comment.
I wrote comments next to the proposed changes
… into kacper3615/bug_fixes

Added optional DWave sampleset metadata extraction (https://docs.dwavequantum.com/en/latest/quantum_research/operation_timing.html).
Added optional time measurements to Advantage with units: