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

ORCA asynchronous sampling #2205

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

Omar-ORCA
Copy link
Contributor

Description

Support for asynchronous sampling for ORCA backend

Copy link

copy-pr-bot bot commented Sep 11, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 16, 2024

/ok to test

Command Bot: Processing...

@sacpis sacpis self-requested a review September 16, 2024 18:20
std::ifstream in("saveMe.json");
in >> readIn;

sleep_for(200ms); // wait for the job to be processed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to know what happens if the job does not complete within 200 ms?

runtime/common/Executor.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just have few comments.

@sacpis
Copy link
Collaborator

sacpis commented Sep 16, 2024

To fix Basic content checks CI job, please run these commands locally to see the issue on your local machine

bash scripts/run_clang_format.sh
bash scripts/run_all_spelling.sh

* Spell check
@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 16, 2024

/ok to test

Command Bot: Processing...

@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 18, 2024

/ok to test

Command Bot: Processing...

@khalatepradnya
Copy link
Collaborator

To fix Basic content checks CI job, please run these commands locally to see the issue on your local machine

bash scripts/run_clang_format.sh
bash scripts/run_all_spelling.sh

Fixed.

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 18, 2024
@@ -14,6 +14,7 @@
#include "Future.h"
#include "MeasureCounts.h"
#include "Registry.h"
#include "cudaq/orca.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the need to add orca-specific dependency at this level (common) is undesirable.

Since we would override the cudaq::QPU interface for ORCA anyway, we could encapsulate all changes via inheritance, e.g.,

class OrcaServerHelper: public ServerHelper {
public:
// Add a method, not override
ServerJobPayload createJob(cudaq::orca::TBIParameters params);
}

class OrcaExecutor: public Executor {

// Added method, no need to introduce to base clas
details::future execute(cudaq::orca::TBIParameters params,
                          const std::string &kernelName) {

						 ....
auto casted = dynamic_cast<OrcaServerHelper*>(serverHelper);
assert(casted);
auto [jobPostPath, headers, jobs] = casted->createJob(params);						 
						  
				....		  
}

}

class OrcaRemoteRESTQPU : public cudaq::QPU {


  std::unique_ptr<OrcaExecutor> executor; // use OrcaExecutor
	
	
  OrcaRemoteRESTQPU() : QPU() {
    ....
    executor = std::make_unique<OrcaExecutor>();
  }
}

At a cost of a dynamic_cast, we could encapsulate/localize all ORCA-specific changes.
@amccaskey interested to hear your opinion as well.

@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 19, 2024

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 19, 2024
@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 24, 2024

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 24, 2024
@khalatepradnya
Copy link
Collaborator

khalatepradnya commented Sep 29, 2024

/ok to test

Command Bot: Processing...

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 this pull request may close these issues.

4 participants