Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/tests/backends/test_braket.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ def test_other_simulators(device_arn):
cudaq.reset_target()


@pytest.mark.parametrize("polling_interval_ms", [10, 100])
def test_polling_interval(polling_interval_ms):
cudaq.set_target("braket", polling_interval_ms=polling_interval_ms)
test_qvector_kernel()
cudaq.reset_target()


# leave for gdb debugging
if __name__ == "__main__":
loc = os.path.abspath(__file__)
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/BraketExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BraketExecutor : public Executor {
char const *jobToken;
char const *reservationArn;

std::chrono::microseconds pollingInterval = std::chrono::milliseconds{100};
std::chrono::microseconds pollingInterval = std::chrono::milliseconds{2000};

/// @brief Utility function to check the type of ServerHelper and use it to
/// create job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ void BraketExecutor::setServerHelper(ServerHelper *helper) {
Aws::Utils::ARN(helper->getConfig().at("deviceArn")).GetRegion();
std::string defaultBucket = helper->getConfig().at("defaultBucket");

if (helper->getConfig().contains("polling_interval_ms")) {
long pollingIntervalMs{
std::stol(helper->getConfig().at("polling_interval_ms"))};
if (pollingIntervalMs <= 0) {
throw std::runtime_error(
"polling_interval_ms must be a positive integer.");
}
pollingInterval = std::chrono::milliseconds{pollingIntervalMs};
}

Aws::Client::ClientConfiguration clientConfig;
clientConfig.verifySSL = false;
Aws::S3Crt::ClientConfiguration s3ClientConfig;
Expand Down
5 changes: 5 additions & 0 deletions runtime/cudaq/platform/default/rest/helpers/braket/braket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ target-arguments:
type: string
platform-arg: default_bucket
help-string: "Specify a default S3 bucket for Amazon Braket results."
- key: polling_interval_ms
required: false
type: integer
platform-arg: polling_interval_ms
help-string: "Specify the polling interval (in milliseconds) for checking task completion status on Amazon Braket."
- key: noise-model
required: false
type: string
Expand Down
Loading