Conversation
|
Some test failures are caused by initializing the cirq_google Sycamore devices in init files. These devices are instantiated using Is there a way to disable deprecation warning assertions during init? Alternatively, we could move Sycamore devices to |
I suppose this is the culprit? Cirq/cirq-google/cirq_google/devices/known_devices.py Lines 339 to 341 in c504c38 I think the right move is to convert this to the new, intended format (GridDevice?), but it's not immediately clear how we would handle deprecating the old |
Yup Definitely agree that deprecating Sycamore prior to replacing is the ideal approach, but deprecating won't resolve the error here I think, because there will still be warnings causing tests to fail. |
Blocking SerializableDevice deprecation (#5522) Recirq needs to be updated to use `Sycamore.metadata.qubit_set` in a follow-up. I put deprecation warnings as docstrings/comments since I don't expect them to have much usage outside Cirq (one exception being `_SYCAMORE_DURATION_PICOS` is used on server side to serialize DeviceSpecification the old way). Let me know if you'd prefer a full deprecation warning. @dstrain115 cc @MichaelBroughton @mpharrigan
* Migrate the different `processor.get_device()` methods and `Engine.get_engine_device()` to GridDevice * Deprecate the `gate_sets` parameter in various `get_device()` methods, and remove `gate_sets` usages. A dedicated deprecation decorator was added in order to handle `gate_sets` parameter being passed in as a positional argument. Originally I had planned to do this after the 0.15 release, but because library code is not allowed to rely on deprecated code within tests, this is blocking SerializableDevice deprecation (#5522). @dstrain115 @MichaelBroughton
Moves the various device-related functions in `virtual_engine_processor.py` to GridDevice. This is blocking SerializableDevice deprecation (#5522) because library code cannot call the deprecated SerializableDevice. * Rerouted functions in `virtual_engine_processor.py` to `GridDevice` * Deprecated the `gate_sets` parameter in `virtual_engine_processor.py` * Move `create_device_from_processor_id()` to GridDevice. @95-martin-orion * Made the return type more general by changing it to `cirq.Device` to allow for new device implementations in the future. * Created copies of existing rainbow and weber DeviceSpecifications and changed them to match the new DeviceSpecification format. * This update needs to happen now because `create_noiseless_virtual_engine_from_templates()` is updated to return a `GridDevice`, and the templates (rainbow and weber DeviceSpecifications) need to contain data in the new format in order to parse into GridDevice properly. * There are no publicly available devices since weber, so I chose to repurpose the existing rainbow and weber information. This was done manually since these devices are no longer available. * Gateset and gate_duration information should match previous versions. In particular, they both include the CZ gate with no duration information. **Reviewer Note**: The first 3 commits are from another pending PR (#5558); please start with the commit "[Move virtual engine functions to GridDevice](2e9ef33)". Don't be discouraged by the line count :) other than the 3 borrowed commits, ~600 lines are from the two new DeviceSpecification messages. @mpharrigan cc @MichaelBroughton @dstrain115
f7ae076 to
ce17a45
Compare
ce17a45 to
cc5246f
Compare
|
This is ready to for review! @MichaelBroughton @dstrain115 |
There was a problem hiding this comment.
LGTM, do we still want to use the from_proto @dstrain115 ?
|
There are a few references on the server side and in Recirq, but they can easily be swapped to GridDevice since they all expect a |
|
Confirmed with @dstrain115 offline - we want to move to GridDevice entirely so |
Blocking SerializableDevice deprecation (quantumlib#5522) Recirq needs to be updated to use `Sycamore.metadata.qubit_set` in a follow-up. I put deprecation warnings as docstrings/comments since I don't expect them to have much usage outside Cirq (one exception being `_SYCAMORE_DURATION_PICOS` is used on server side to serialize DeviceSpecification the old way). Let me know if you'd prefer a full deprecation warning. @dstrain115 cc @MichaelBroughton @mpharrigan
* Migrate the different `processor.get_device()` methods and `Engine.get_engine_device()` to GridDevice * Deprecate the `gate_sets` parameter in various `get_device()` methods, and remove `gate_sets` usages. A dedicated deprecation decorator was added in order to handle `gate_sets` parameter being passed in as a positional argument. Originally I had planned to do this after the 0.15 release, but because library code is not allowed to rely on deprecated code within tests, this is blocking SerializableDevice deprecation (quantumlib#5522). @dstrain115 @MichaelBroughton
Moves the various device-related functions in `virtual_engine_processor.py` to GridDevice. This is blocking SerializableDevice deprecation (quantumlib#5522) because library code cannot call the deprecated SerializableDevice. * Rerouted functions in `virtual_engine_processor.py` to `GridDevice` * Deprecated the `gate_sets` parameter in `virtual_engine_processor.py` * Move `create_device_from_processor_id()` to GridDevice. @95-martin-orion * Made the return type more general by changing it to `cirq.Device` to allow for new device implementations in the future. * Created copies of existing rainbow and weber DeviceSpecifications and changed them to match the new DeviceSpecification format. * This update needs to happen now because `create_noiseless_virtual_engine_from_templates()` is updated to return a `GridDevice`, and the templates (rainbow and weber DeviceSpecifications) need to contain data in the new format in order to parse into GridDevice properly. * There are no publicly available devices since weber, so I chose to repurpose the existing rainbow and weber information. This was done manually since these devices are no longer available. * Gateset and gate_duration information should match previous versions. In particular, they both include the CZ gate with no duration information. **Reviewer Note**: The first 3 commits are from another pending PR (quantumlib#5558); please start with the commit "[Move virtual engine functions to GridDevice](quantumlib@2e9ef33)". Don't be discouraged by the line count :) other than the 3 borrowed commits, ~600 lines are from the two new DeviceSpecification messages. @mpharrigan cc @MichaelBroughton @dstrain115
To be replaced by GridDevice.
To be replaced by GridDevice.