-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add job_tags and max_execution_time to options #510
Changes from 6 commits
e2e3c89
756a2c0
543eefa
8efc285
15bb91f
20ed4c3
32076f3
3e2b0cc
1b55407
e3bfaef
eaeac76
5cc1fd5
a1afacf
00fad22
96226f9
2fc4e65
8c5beb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -104,6 +104,12 @@ class Options: | |||||
"""Options for the primitive programs. | ||||||
|
||||||
Args: | ||||||
max_execution_time: Maximum execution time in seconds. This overrides | ||||||
the max_execution_time of the program and cannot exceed it. | ||||||
|
||||||
job_tags: Tags to be assigned to the job. The tags can subsequently be used | ||||||
as a filter in the :meth:`jobs()` function call. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There is no |
||||||
|
||||||
optimization_level: How much optimization to perform on the circuits. | ||||||
Higher levels generate more optimized circuits, | ||||||
at the expense of longer transpilation times. | ||||||
|
@@ -195,6 +201,8 @@ class Options: | |||||
Default: ``True``. | ||||||
""" | ||||||
|
||||||
max_execution_time: int = None | ||||||
job_tags: List[str] = None | ||||||
jyu00 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created a new |
||||||
optimization_level: int = 1 | ||||||
resilience_level: int = 0 | ||||||
log_level: str = "WARNING" | ||||||
|
@@ -273,4 +281,6 @@ def _get_runtime_options(options: Dict) -> Dict: | |||||
return { | ||||||
"log_level": options.get("log_level"), | ||||||
"image": experimental.get("image", None), | ||||||
"job_tags": options.get("job_tags"), | ||||||
"max_execution_time": options.get("max_execution_time"), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is actually meant to return only fields inside the |
||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -860,6 +860,7 @@ def run( | |
inputs: Program input parameters. These input values are passed | ||
to the runtime program. | ||
options: Runtime options that control the execution environment. | ||
``job_tags`` and ``max_execution_time`` can also be set here. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your intent is to move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something we want to do? Deprecate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah since I think it's rather confusing to have some options inside |
||
|
||
* backend: target backend to run on. This is required for ``ibm_quantum`` runtime. | ||
* image: the runtime image used to execute the program, specified in | ||
|
@@ -937,8 +938,9 @@ def run( | |
hgp=hgp_name, | ||
log_level=options.get("log_level"), | ||
session_id=session_id, | ||
job_tags=job_tags, | ||
max_execution_time=max_execution_time, | ||
job_tags=job_tags or options.get("job_tags"), | ||
max_execution_time=max_execution_time | ||
or options.get("max_execution_time"), | ||
start_session=start_session, | ||
) | ||
except RequestsApiError as ex: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
upgrade: | ||
- | | ||
``job_tags`` and ``max_execution_time`` can now be passed into | ||
:class:`qiskit_ibm_runtime.Options`. :class:`qiskit_ibm_runtime.RuntimeOptions` | ||
has also been updated to include these two parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this description a bit confusing. What does "overrides the max_execution_time of the program" mean? Does it update the
max_execution_time
metadata of a program? I don't think that's how this works?