Skip to content
Merged
48 changes: 25 additions & 23 deletions docs/faqs/max_execution_time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ a job exceeds this time limit, it is forcibly cancelled and a ``RuntimeJobMaxTim
exception is raised.

.. note::
As of August 7, 2023, the ``max_execution_time`` value is based on quantum
time instead of wall clock time. Quantum time represents the time that the QPU
As of August 7, 2023, the ``max_execution_time`` value is based on job execution time, which is the time that the QPU
complex (including control software, control electronics, QPU, and so on) is engaged in
processing the job.
processing the job, instead of wall clock time.

Simulator jobs continue to use wall clock time because they do not have quantum time.
Simulator jobs continue to use wall clock time.

You can set the maximum execution time (in seconds) on the job options by using one of the following methods:

Expand All @@ -32,12 +31,12 @@ You can set the maximum execution time (in seconds) on the job options by using
# Create the options object with attributes and values
options = {"max_execution_time": 360}

You can also find quantum time used by previously completed jobs by using:
You can also find the job execution time for previously completed jobs by using:

.. code-block:: python

# Find quantum time used by the job
print(f"Quantum time used by job {job.job_id()} was {job.metrics()['usage']['quantum_seconds']} seconds")
# Find the job execution time
print(f"Job {job.job_id()} job execution time was {job.metrics()['usage']['seconds']} seconds")

In addition, the system calculates an appropriate job timeout value based on the
input circuits and options. This system-calculated timeout is currently capped
Expand All @@ -61,29 +60,32 @@ You can set the maximum session timeout value using the ``max_time`` parameter:
with Session(max_time="1h"):
...

If you don't specify a session ``max_time``, the system defaults are used:
If you don't specify a session ``max_time``, the system defaults are used (see table below).

+--------------+------------------+--------------+-----------+
| Primitive programs | Private programs |
+==============+==================+==============+===========+
| Premium User | Open User | Premium User | Open User |
+--------------+------------------+--------------+-----------+
| 8h | 4h | 8h | N/A |
+--------------+------------------+--------------+-----------+

Note that a *premium user* here means a user who has access to backends in providers other than ``ibm-q/open/main``.

.. note::
Session ``max_time`` is based on wall clock time, not quantum time.
Additionally, there is an *interactive* timeout value. If there are no session jobs queued within that window, the session is temporarily deactivated and normal job selection resumes. During job selection, if the job scheduler gets a new job from the session and its maximum timeout value has not been reached, the session is reactivated until its maximum timeout value is reached. The interactive timeout value is based on the plan type:

.. note:: The timer for the session's ``max_time`` is not paused during any temporary deactivation periods.

Additionally, there is a 5 minute *interactive* timeout value. If there are no session jobs queued within that window, the session is temporarily deactivated and normal job selection resumes. During job selection, if the job scheduler gets a new job from the session and its maximum timeout value has not been reached, the session is reactivated until its maximum timeout value is reached.
+---------------------+--------------------------+--------------------------+
| | Primitive programs | Private programs |
+=====================+==============+===========+==============+===========+
| | Premium user | Open user | Premium user | Open user |
+---------------------+--------------+-----------+--------------+-----------+
| Max time defaults | 8h | 15m | 8h | N/A |
+---------------------+--------------+-----------+--------------+-----------+
| Interactive timeout | 5m | 2s | 5m | N/A |
+---------------------+--------------+-----------+--------------+-----------+

.. note:: The timer for the session's ``max_time`` is not paused during any temporary deactivation periods.
Note that a *premium user* here means a user who has access to backends in providers other than ``ibm-q/open/main``.

.. note::
Session ``max_time`` is based on wall clock time.

Other limitations
***************************

- Programs cannot exceed 750KB in size.
- Inputs to jobs cannot exceed 64MB in size.
- Inputs to jobs cannot exceed 64MB in size.
- Open plan users are limited to 10 minutes of job execution time per month. This is the time that the QPU
complex (including control software, control electronics, QPU, and so on) is engaged in
processing the job. Open plan users can track current progress toward the limit on the `Platform dashboard, <https://quantum-computing.ibm.com/>`__ `Jobs, <https://quantum-computing.ibm.com/jobs>`__ and `Account, <https://quantum-computing.ibm.com/account>`__ pages.
8 changes: 7 additions & 1 deletion docs/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ How long a session stays active

The length of time a session is active is controlled by the *maximum session timeout* (``max_time``) value and the *interactive* timeout value (TTL). The ``max_time`` timer starts when the session becomes active. That is, when the first job runs, not when it is queued. It does not stop if a session becomes inactive. The TTL timer starts each time a session job finishes.

.. note::
For an Open plan user, the maximum session timeout is 15 minutes.

Maximum session timeout
++++++++++++++++++++++++++++

Expand All @@ -93,7 +96,10 @@ Interactive timeout value

Every session has an *interactive timeout value*, or time to live (TTL), of five minutes, which cannot be changed. If there are no session jobs queued within the TTL window, the session is temporarily deactivated and normal job selection resumes. A deactivated session can be resumed if it has not reached its maximum timeout value. The session is resumed when a subsequent session job starts. Once a session is deactivated, its next job waits in the queue like other jobs.

After a session is deactivated, the next job in the queue is selected to run. This newly selected job (which can belong to a different user) can run as a singleton, but it can also start a different session. In other words, a deactivated session does not block the creation of other sessions. Jobs from this new session would then take priority until it is deactivated or closed, at which point normal job selection resumes.
After a session is deactivated, the next job in the queue is selected to run. This newly selected job (which can belong to a different user) can run as a singleton, but it can also start a different session. In other words, a deactivated session does not block the creation of other sessions. Jobs from this new session would then take priority until it is deactivated or closed, at which point normal job selection resumes.

.. note::
When running jobs through the Open Plan, the interactive timeout value is two seconds.

.. _ends:

Expand Down