Skip to content
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

Tabor: redundant waveform upload #795

Closed
mloberlaender opened this issue Sep 28, 2023 · 8 comments · Fixed by #797
Closed

Tabor: redundant waveform upload #795

mloberlaender opened this issue Sep 28, 2023 · 8 comments · Fixed by #797

Comments

@mloberlaender
Copy link

When uplading a program which for some reason has multiple segments of equal waveforms in a TaborProgram, the _find_place_for_segments_in_memory-function does not check for unique values but uploads all segments from this batch of segments regardless.
It seems to me thast this may be preventable by checking for unique hashes. Is this assumption correct?

@Nomos11 Nomos11 linked a pull request Sep 28, 2023 that will close this issue
@terrorfisch
Copy link
Member

Equal waveforms should already have been detected and deduplicated in TaborProgram itself.

@Nomos11
Copy link
Collaborator

Nomos11 commented Sep 28, 2023

That would have been my expectation, too, but in the case in which we observed this behavior - multiple AWGs connected - it somehow did not happen. Does it explicitly check for duplicate waveforms on this device, or duplicate segments in the whole program?

@terrorfisch
Copy link
Member

What nesting level does the program have?

The deduplication should happen based on the sampled waveforms. Here is where:
https://github.com/qutech/qupulse/blob/master/qupulse/_program/tabor.py#L670
https://github.com/qutech/qupulse/blob/master/qupulse/_program/tabor.py#L712

Are you sure the waveforms are equal? Both channels and markers have to be equal for that.

@Nomos11
Copy link
Collaborator

Nomos11 commented Sep 28, 2023

I am quite certain that the waveform are physically equal, since the hash values are equal later on when it's uploaded (and from PT definition I know they are equal [but just for this channel pair]).
The nesting level is such that it is parsed in parse_aseq_program, if this is what the question aims at. There, interestingly, the waveform objects differ from one another (they are of type SubsetWaveform and the waveform_loop has a waveform of type TransformingWaveform). How does it check if the waveforms are physically equal?

@Nomos11
Copy link
Collaborator

Nomos11 commented Sep 28, 2023

It seems to me as if - due to the sequence being non-equal on other channels - different waveform_loop objects are present, which then consequently are not evaluated to be equal objects when the subset-waveform is called; is this the correct way to interpret it?

@terrorfisch
Copy link
Member

My error, the deduplication happens based on the Waveform not on the TaborSegment. The equality of Waveform requires structurally equivalent objects (same classes and the same attributes) implemented via the compare_key property.

Looks like we need another deduplication step after the sampling.

@terrorfisch
Copy link
Member

terrorfisch commented Sep 28, 2023

  • Add a _waveform_to_segment lookup list to TaborProgram
  • Populate it in TaborProgram._calc_sampled_segments
  • Translate waveform indices in get_sequencer_tables

Greatest difficulty is to not get confused with 0-based and 1-based indexing. I think that the translation to 1-based indexing only happens directly before loading the segments and tables to the instrument but I am not sure.

@Nomos11
Copy link
Collaborator

Nomos11 commented Sep 28, 2023

Does the hacky approach from #796 have (non-)obvious bugs/drawbacks to be aware of when using it in the meantime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants