-
Notifications
You must be signed in to change notification settings - Fork 127
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
Proposal for deprecation of flatten_result=False #1207
Comments
If I may chime in, since I've looked into why ExperimentData initialization takes so long in the past - the biggest time consumer seemed to be these lines where network communications happen, and they are triggered when |
Thanks @yiiyama . This makes sense. Could you please open a PR to change the initialization of the experiment data container? Apart from performance, another intention of the proposed change here is the separation of data container and analysis subroutine. |
Thanks @yiiyama. Please note that setting |
@nkanazawa1989 Right, I read the motivation for this proposal and agree that this is a good idea. I just stumbled upon this issue while browsing the Issues page and wanted to share what I found before. |
Closed and merged into #1268 |
Suggested feature
Performance of the composite analysis is of vital importance to support 100+ qubit calibration with Qiskit Experiments. As we have previously investigated, the most time consuming part of analysis is the figure generation, but this overhead can be easily alleviated by selectively generating the figures, e.g. generating figure for bad quality results.
Apart from the figure generation, we can further reduce computational time cost by introducing better fitting subroutine #1192. Lastly (in this proposal), we can completely remove nested experiment data container structure for more speedup.
Above benchmark is a typical pattern in system maintenance where we run same kind of experiment in parallel (Figure generation is disabled to focus on the rest of steps). In this situation,
CompositeAnalysis
doesWhen
flatten_results=False
When
flatten_results=True
As you can see,
flatten_results
option is just a difference of how to deliver the outcomes, and sub containers are initialized anyways. According to the benchmark, sub container initialization consumes 30% of analysis time in total (wait block is mainly time for fitting, and this is not analyzed with this profiler because the process is in another thread).Proposal
In #1133 , we support table representation of analysis results. So far nested container structure might be preferred to efficiently analyze the results. In above parallel experiment example, if we want T1 value of Qubit3,
With table, user can get nice html overview of all analysis results.
This makes me think we no longer have motivation to keep complicated nested data structure. Given we agree with this, we don't need to make sub containers at all. Note that we still need to marginalize the count data, but this does NOT need to be an expensive
ExperimentData
container.With this modification,
BaseAnalysis
would look likeand
CompositeAnalysis
would becomeThe
CompositeAnalysis._margianlize
is a function that consumes a compositeExperimentResults
and generatesItertor[ExperimentResults]
for each component data. The marginal operation is implemented with Rust, so this subroutine must be performant.Note that
_run_analysis
is an abstract method and this is API break for existing (including community) experiment libraries. However, we can safely introduce deprecation warning withbecause the class must access
experiment_data.data()
to perform analysis (assumingExperimentResults
doesn't have this attribute).The text was updated successfully, but these errors were encountered: