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
20 changes: 10 additions & 10 deletions demo/qrmi/etc/slurm/qrmi_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"resources": [
{
"name": "test_eagle",
"type": "direct-access",
"type": "ibm-quantum-system",
"environment": {
"QRMI_IBM_DA_ENDPOINT": "http://localhost:8080",
"QRMI_IBM_DA_IAM_ENDPOINT": "https://iam.test.cloud.ibm.com",
"QRMI_IBM_DA_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_DA_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_DA_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_S3_ENDPOINT": "https://s3.us-east.cloud-object-storage.appdomain.cloud",
"QRMI_IBM_DA_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_DA_S3_REGION": "us-east"
"QRMI_IBM_QS_ENDPOINT": "http://localhost:8080",
"QRMI_IBM_QS_IAM_ENDPOINT": "https://iam.test.cloud.ibm.com",
"QRMI_IBM_QS_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_QS_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_QS_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_S3_ENDPOINT": "https://s3.us-east.cloud-object-storage.appdomain.cloud",
"QRMI_IBM_QS_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_QS_S3_REGION": "us-east"
}
},
{
Expand Down
40 changes: 20 additions & 20 deletions demo/qrmi/slurm-docker-cluster/file.patch
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,17 @@ diff -Naru slurm-docker-cluster.orig/qrmi_config.json slurm-docker-cluster/qrmi_
+ "resources": [
+ {
+ "name": "test_eagle",
+ "type": "direct-access",
+ "type": "ibm-quantum-system",
+ "environment": {
+ "QRMI_IBM_DA_ENDPOINT": "http://",
+ "QRMI_IBM_DA_IAM_ENDPOINT": "https://",
+ "QRMI_IBM_DA_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
+ "QRMI_IBM_DA_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
+ "QRMI_IBM_DA_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_DA_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_DA_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
+ "QRMI_IBM_DA_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
+ "QRMI_IBM_DA_S3_REGION": "<YOUR S3 BUCKET REGION>"
+ "QRMI_IBM_QS_ENDPOINT": "http://",
+ "QRMI_IBM_QS_IAM_ENDPOINT": "https://",
+ "QRMI_IBM_QS_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
+ "QRMI_IBM_QS_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
+ "QRMI_IBM_QS_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_QS_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
+ "QRMI_IBM_QS_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
+ "QRMI_IBM_QS_S3_REGION": "<YOUR S3 BUCKET REGION>"
+ }
+ },
+ {
Expand Down Expand Up @@ -344,17 +344,17 @@ diff -Naru slurm-docker-cluster.orig/qrmi_config.json.example slurm-docker-clust
+ "resources": [
+ {
+ "name": "test_eagle",
+ "type": "direct-access",
+ "type": "quantum-system",
+ "environment": {
+ "QRMI_IBM_DA_ENDPOINT": "http://",
+ "QRMI_IBM_DA_IAM_ENDPOINT": "https://",
+ "QRMI_IBM_DA_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
+ "QRMI_IBM_DA_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
+ "QRMI_IBM_DA_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_DA_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_DA_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
+ "QRMI_IBM_DA_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
+ "QRMI_IBM_DA_S3_REGION": "<YOUR S3 BUCKET REGION>"
+ "QRMI_IBM_QS_ENDPOINT": "http://",
+ "QRMI_IBM_QS_IAM_ENDPOINT": "https://",
+ "QRMI_IBM_QS_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
+ "QRMI_IBM_QS_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
+ "QRMI_IBM_QS_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
+ "QRMI_IBM_QS_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
+ "QRMI_IBM_QS_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
+ "QRMI_IBM_QS_S3_REGION": "<YOUR S3 BUCKET REGION>"
+ }
+ },
+ {
Expand Down
8 changes: 4 additions & 4 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Spank plugins for Slurm to support quantum resources
- [Vendor-Specific Context: IBM](#vendor-specific-context-ibm)
- [Vendor-Specific Definitions: IBM](#vendor-specific-definitions-ibm)
- [IBM Quantum Platform](#ibm-quantum-platform)
- [Direct Access API](#direct-access-api)
- [Quantum System API](#quantum-system-api)
- [High Level Structure](#high-level-structure)
- [Quantum resource for workload management systems](#quantum-resource-for-workload-management-system)
- [Quantum resource API](#quantum-resource-api)
Expand Down Expand Up @@ -62,8 +62,8 @@ Extension of the context overview of involved components, personas and backend s
### IBM Quantum Platform
Cloud-based quantum computing service providing access to IBM's fleet of quantum backends. Sometimes abbreviated as IQP.

### Direct Access API
Local interface to am IBM Quantum Computer. Sometimes abbreviated as DA API. Below the Direct Access API, classical preparation of jobs prior to the actual quantum execution can run in parallel (called *lanes* in the API definition).
### Quantum System API
Local interface to a IBM Quantum Computer. Below the Quantum System API, classical preparation of jobs prior to the actual quantum execution can run in parallel (called *lanes* in the API definition).

## Vendor-Specific Definitions: Pasqal

Expand All @@ -90,7 +90,7 @@ Additional resource definition might be needed depending on implementation from

![resource definition](./images/resource_definition.png)

The QPU resource definition does not expose individual parallelism abstracts. Each backend flavor can have specific qualifiers how to use backend specific capabilities (e.g. for common use case: if a user wants to exclusively use a backend, all parallel job preparation units will be available for use -- if not, several users could submit jobs and share these units. As execution lanes in DA API do not have any identities that could be managed explicitly, only quantities resp. exclusive/shared use should be user controlled).
The QPU resource definition does not expose individual parallelism abstracts. Each backend flavor can have specific qualifiers how to use backend specific capabilities (e.g. for common use case: if a user wants to exclusively use a backend, all parallel job preparation units will be available for use -- if not, several users could submit jobs and share these units. As execution lanes in IBM Quantum System API do not have any identities that could be managed explicitly, only quantities resp. exclusive/shared use should be user controlled).

![resource mapping](./images/resource_mapping.png)

Expand Down
12 changes: 6 additions & 6 deletions docs/ux.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ HPC user experience, HPC developer experience and usage patterns
- [HPC user scope](#hpc-user-scope)
- [HPC application scope](#hpc-application-scope)
- [Backend specifics](#backend-specifics)
- [IBM Direct Access API](#ibm-direct-access-api)
- [IBM Quantum System API](#ibm-quantum-system-api)
- [Qiskit Runtime Service](#qiskit-runtime-service)
- [Examples](#examples)
- [Running jobs with dependencies](#running-jobs-with-dependencies)
Expand All @@ -25,8 +25,8 @@ Slurm QPU resource definitions determine what physical resources can be used by
User source code should be agnostic to specific backend instances and even backend types as far as possible.
This keeps source code portable while the QPU selection criteria are part of the resource definition (which is considered configuration as opposed to source code).
The source code does not have to take care resp. is not involved in resource reservation handling (that is done when Slurm jobs are assigned QPU resources and start running, if applicable on the backend) or execution modes like sessions (these are automatically in place while the job is running, if applicable on the backend).
This makes the source code more portable between similar QPU resource types through different backend access methods (such as IBM's Direct Access API and IBM's Qiskit Runtime service through IBM Quantum Platform).
All backend types (such as IBM's Direct Access API, IBM's Qiskit Runtime service, or Pasqal's backends) follow these principles.
This makes the source code more portable between similar QPU resource types through different backend access methods (such as IBM's Quantum System API and IBM's Qiskit Runtime service through IBM Quantum Platform).
All backend types (such as IBM's Quantum System API, IBM's Qiskit Runtime service, or Pasqal's backends) follow these principles.

## Connecting physical resources to Slurm resources and how to use them

Expand Down Expand Up @@ -132,13 +132,13 @@ print(f">>> {result}")
See [examples directory](https://github.com/qiskit-community/qrmi/tree/main/examples/qiskit_primitives/) for example files.

### Backend specifics
#### IBM Direct Access API
#### IBM Quantum System API
##### HPC admin scope
Configuration of Direct Access API backends (HPC admin scope) includes endpoints and credentials to the Direct Access endpoint, authentication services as well as the S3 endpoint.
Configuration of Quantum System API backends (HPC admin scope) includes endpoints and credentials to the Quantum System endpoint, authentication services as well as the S3 endpoint.
Specifically, this includes:

* IBM Cloud API key for creating bearer tokens
* endpoint of Direct Access API
* endpoint of Quantum System API
* S3 bucket and access details

Access credentials should not be visible to HPC users or other non-privileged users on the system.
Expand Down
20 changes: 16 additions & 4 deletions plugins/spank_qrmi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ The `resources` array contains a set of available Quantum Resources which can be
| properties | descriptions |
| ---- | ---- |
| name | Quantum resource name. e.g. Quantum backend name. |
| type | Resource type (`direct-access`, `qiskit-runtime-service` and `pasqal-cloud`) |
| type | Resource type (`ibm-quantum-system`, `qiskit-runtime-service` and `pasqal-cloud`) |
| environment | A set of environment variables to work with QRMI. Current implementations assume API endpoint and credentials are specified via environment variable setting. |

If a user specifies a resource with the --qpu option that is not defined in the qrmi_config.json file, the specification will be ignored.

If the user sets the necessary environment variables for job execution themselves, it is not required to specify them in this file. In this case, the environment property will be `{}`.

> [!IMPORTANT]
> The IBM Direct Access API has been renamed to the IBM Quantum System API.
> As part of this change, the previously available resource type name has been updated from `direct-access` to `ibm-quantum-system`.
> During a transition period, both `direct-access` and `ibm-quantum-system` resource type names will be supported.
> After the transition period ends, support for the `direct-access` resource type name will be discontinued.

> [!NOTE]
> If you are using a QPU resource with the resource type `qiskit-runtime-service`, use an account that supports [opening a session](https://quantum.cloud.ibm.com/docs/en/guides/run-jobs-session#open-a-session), such as a Premium plan.
> If you are using an account that does not support opening a session, such as an Open plan account, add `QRMI_IBM_QRS_SESSION_MODE="batch"` to the environment variable list in qrmi_config.json as workaround:
Expand Down Expand Up @@ -168,8 +174,8 @@ srun -vv python /shared/qrmi/examples/qiskit_primitives/ibm/sampler.py
At runtime, each QRMI instance is linked to a single QPU resource. To enable the use of multiple Quantum resources within a single job script, this plugin sets environment variables with the resource name as a prefix. For example, if `--qpu=qpu1,qpu2` is specified, the environment variables will be set as follows:

```bash
qpu1_QRMI_IBM_DA_ENDPOINT=http://test1
qpu2_QRMI_IBM_DA_ENDPOINT=http://test2
qpu1_QRMI_IBM_QS_ENDPOINT=http://test1
qpu2_QRMI_IBM_QS_ENDPOINT=http://test2
```

This ensures that each QRMI instance operates with the configuration parameters set for its respective resource during the execution of the Slurm job.
Expand All @@ -181,7 +187,13 @@ This plugin also set the following 2 environment variables which will be referre
| environment varilables | descriptions |
| ---- | ---- |
| SLURM_JOB_QPU_RESOURCES | Comma separated list of QPU resources to use at runtime. Undocumented resources will be filtered out. For example, `qpu1,qpu2`. |
| SLURM_JOB_QPU_TYPES | Comma separated list of Resource type (`direct-access`, `qiskit-runtime-service` and `pasqal-cloud`). For example, `direct-access,direct-access` |
| SLURM_JOB_QPU_TYPES | Comma separated list of Resource type (`ibm-quantum-system`, `qiskit-runtime-service` and `pasqal-cloud`). For example, `ibm-quantum-system,ibm-quantum-system` |

> [!IMPORTANT]
> The IBM Direct Access API has been renamed to the IBM Quantum System API.
> As part of this change, the previously available resource type name has been updated from `direct-access` to `ibm-quantum-system`.
> During a transition period, both `direct-access` and `ibm-quantum-system` resource type names will be supported.
> After the transition period ends, support for the `direct-access` resource type name will be discontinued.

## License

Expand Down
40 changes: 20 additions & 20 deletions plugins/spank_qrmi/qrmi_config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
"resources": [
{
"name": "test_heron",
"type": "direct-access",
"type": "ibm-quantum-system",
"environment": {
"QRMI_IBM_DA_ENDPOINT": "http://",
"QRMI_IBM_DA_IAM_ENDPOINT": "https://",
"QRMI_IBM_DA_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_DA_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_DA_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
"QRMI_IBM_DA_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_DA_S3_REGION": "<YOUR S3 BUCKET REGION>"
"QRMI_IBM_QS_ENDPOINT": "http://",
"QRMI_IBM_QS_IAM_ENDPOINT": "https://",
"QRMI_IBM_QS_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_QS_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_QS_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
"QRMI_IBM_QS_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_QS_S3_REGION": "<YOUR S3 BUCKET REGION>"
}
},
{
"name": "test_eagle",
"type": "direct-access",
"type": "ibm-quantum-system",
"environment": {
"QRMI_IBM_DA_ENDPOINT": "http://",
"QRMI_IBM_DA_IAM_ENDPOINT": "https://",
"QRMI_IBM_DA_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_DA_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_DA_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_DA_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
"QRMI_IBM_DA_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_DA_S3_REGION": "<YOUR S3 BUCKET REGION>"
"QRMI_IBM_QS_ENDPOINT": "http://",
"QRMI_IBM_QS_IAM_ENDPOINT": "https://",
"QRMI_IBM_QS_IAM_APIKEY": "<YOUR IAM APIKEY FOR THIS BACKEND>",
"QRMI_IBM_QS_SERVICE_CRN": "<YOUR DIRECT ACCESS INSTANCE CRN>",
"QRMI_IBM_QS_AWS_ACCESS_KEY_ID": "<YOUR AWS ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY": "<YOUR AWS SECRET ACCESS KEY TO ACCESS S3 BUCKET>",
"QRMI_IBM_QS_S3_ENDPOINT": "<YOUR S3 ENDPOINT>",
"QRMI_IBM_QS_S3_BUCKET": "<YOUR S3 BUCKET NAME>",
"QRMI_IBM_QS_S3_REGION": "<YOUR S3 BUCKET REGION>"
}
},
{
Expand Down
Loading