Skip to content

v0.37.0

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Oct 11:28
· 66 commits to main since this release
ef9f380

Release Notes

v0.37.0

Prelude

qiskit_serverless v0.37.0 removes the Ray-coupling client helpers that
were deprecated in 0.34.0: the distribute_task decorator, the get,
put and get_refs_by_status helpers, distribute_qiskit_function and
qiskit_serverless.core.remote. Functions that need in-function
parallelism should use Ray directly. The deprecated compute_profile
input on run() is also removed in favour of function_size, whose
label is restricted to S, M, L and XL. This release also adds a
provider filter to function listing, reports a new STOPPING status
when a job is cancelled, and raises the required qiskit-ibm-runtime
version to 0.50.

New Features

  • qiskit-fermions==0.2.0 has been added to the dynamic dependencies
    allowlist bundled in the custom functions image. Qiskit Functions that
    declare it as a dependency can now use it.
  • The custom functions image now ships the CUDA runtime libraries
    gpu4pyscf needs at import, so GPU chemistry functions no longer have
    to install those wheels themselves.
  • Listing Qiskit Functions now accepts a provider argument that
    returns only the functions belonging to that provider:

    client.functions(provider="q-ctrl")
    

    The filter narrows the functions the caller can already see, so it
    never widens access, and a provider the caller has no functions under
    returns an empty list.

  • Cancelling a job now reports a new STOPPING status, shown by the
    client SDK as CANCELING, until the job has really stopped and its
    compute is released. Previously the job was reported as stopped
    straight away, while its compute was still being released. Sub-status
    and error reporting keep working while a job is stopping.
  • Running Qiskit Functions can now read the compute sizing their job
    resolved to, with two new helpers,
    ~qiskit_serverless.get_function_size and
    ~qiskit_serverless.get_compute_profile:

    from qiskit_serverless import get_function_size, get_compute_profile
    
    get_function_size()     # e.g. "M"
    get_compute_profile()   # e.g. "24x120x1a100p"
    

    This lets a function check which function_size the user submitted
    and which compute profile it mapped to. Both are always set for Fleets
    jobs (the requested size, or the function's default when none was
    requested) and are empty when sizes do not apply, i.e. a non-Fleets
    (Ray) job. The values are set by the gateway at job submission through
    the ENV_JOB_FUNCTION_SIZE and ENV_JOB_COMPUTE_PROFILE environment
    variables.

  • The gateway now injects an authoritative Qiskit user configuration
    file (settings.conf) into every Ray and Code Engine Fleets job
    container and points QISKIT_SETTINGS at it. The file currently sets
    a single key, min_qpy_version (default 13, configurable fleet-wide
    with the QISKIT_MIN_QPY_VERSION environment variable), which makes
    Qiskit reject QPY payloads older than that version. For Fleets the
    file is written by the job wrapper at container startup; for Ray it is
    written into the job working directory and referenced by a
    cwd-relative QISKIT_SETTINGS.

Upgrade Notes

  • Qiskit Serverless now requires qiskit-ibm-runtime==0.50, raised from
    0.49.
  • The optional ray extra (pip install qiskit-serverless[ray]) now
    requires ray>=2.59, raised from 2.58.
  • Several packages have been added to the dynamic dependencies allowlist
    bundled in the custom functions image: h5py, mpi4py, openmpi,
    pybind11 and qrmi[ibm]. Qiskit Functions that declare any of them
    as a dependency can now use them. ffsim is updated to 0.0.70 and
    qiskit-addon-sqd to 0.13.1.
  • qiskit-fermions==0.2.0 requires qiskit~=2.5.0, so the qiskit
    version in the custom functions image is now held to the 2.5 line.
    Functions that relied on an earlier qiskit in the image should
    review the Qiskit 2.3-2.5 release notes for API changes.
  • The distribute_task decorator and the get, put and
    get_refs_by_status helpers have been removed. They were
    deprecated in 0.34.0 as thin wrappers around Ray's native API, which
    must now be used directly. Functions that need in-function parallelism
    should import ray and use Ray's own decorators:

    Before (using the removed Qiskit Serverless wrappers):

    from qiskit_serverless import get_arguments, save_result, distribute_task, get
    
    @distribute_task()
    def distributed_transpilation(circuit, target_backend):
        ...  # returns an ISA circuit
        return isa_circuit
    
    refs = [distributed_transpilation(circuit, backend) for circuit in circuits]
    isa_circuits = get(refs)
    save_result({"results": isa_circuits})

    After (using Ray directly):

    import ray
    from qiskit_serverless import get_arguments, save_result
    
    @ray.remote
    def distributed_transpilation(circuit, target_backend):
        ...  # returns an ISA circuit
        return isa_circuit
    
    refs = [distributed_transpilation.remote(circuit, backend) for circuit in circuits]
    isa_circuits = ray.get(refs)
    save_result({"results": isa_circuits})
  • The distribute_qiskit_function decorator has been removed. It
    was deprecated in 0.30. Use the upload functionality of
    ~qiskit_serverless.ServerlessClient instead.
  • qiskit_serverless.core.remote, a thin proxy around
    ray.remote,
    has been removed. Use ray.remote directly, as shown above.
  • The OpenTelemetry spans that distribute_task injected around each
    distributed task have been removed along with it, including the
    per-task qs.meta.*, qs.resources.*, qs.args.* and qs.kwargs.*
    span attributes. The client-side job.*, function.* and files.*
    spans, and gateway and scheduler tracing, are unaffected.
  • The deprecated compute_profile input on POST /programs/run/ has
    been removed. Use function_size with one of the labels the function
    declares instead. Sending compute_profile now returns a 400 naming
    the replacement, instead of being silently ignored.

    The client SDK's compute_profile keyword on run() now raises
    QiskitServerlessException locally instead of sending the request, so
    upgrade the client to get a clear error rather than a generic 400 from
    the gateway.

  • The size label declared for a function is now restricted to S, M,
    L and XL. A size outside this catalog is rejected on
    /programs/upload. A size is accepted case-insensitively and stored
    and read back in uppercase.
  • A cancelled job stays in STOPPING until its compute is released, and
    counts against the user's active and running job limits for that time.
    A cancellation that is never confirmed is forced to stopped after 5
    minutes.
  • Stopping a job now answers "Serverless job stop has been requested."
    where it used to say the job "was running and has been stopped", since
    the request only asks for the stop and does not wait for it to finish.
  • The gateway-provided settings.conf is authoritative: a function's
    own Qiskit configuration file is no longer consulted in the Functions
    runtime. Qiskit reads exactly the one file QISKIT_SETTINGS names,
    with no merging, and the gateway sets QISKIT_SETTINGS in the
    system-controlled environment layer that overrides any value a
    function supplies. A function that shipped or wrote its own
    settings.conf (at the default ~/.qiskit/settings.conf or
    elsewhere) will find it ignored. Function vendors that need Qiskit
    configuration beyond min_qpy_version must apply it programmatically
    in their function code rather than through a configuration file.

Security Issues

  • The custom_token authentication mechanism no longer accepts the
    local channel, which checks a static mock token and needs no
    instance. The Helm chart also stops passing SETTINGS_AUTH_MOCK_TOKEN
    to the pods unless the mechanism is mock_token.

Bug Fixes

  • The gateway and the scheduler now exit when their startup migration
    fails, instead of starting against a database that does not match the
    code.
  • Fixed GPU chemistry functions silently running on the CPU, because the
    CUDA libraries gpu4pyscf loads at import were missing from the
    image. The image now installs them and its build checks that they
    resolve.
  • A request to the IBM Cloud and IBM Quantum Platform channels without
    the Service-CRN header now fails with an authentication error that
    asks for the header, instead of an internal server error.
  • A request whose authentication could not be completed because IBM
    Cloud was unreachable, timed out, or returned a server error now fails
    with HTTP 503 and a message asking the user to retry, instead of a
    401 telling them to review their API key or CRN. Valid credentials
    and a valid CRN are no longer reported as invalid during an IBM Cloud
    outage; the 401 messages are kept only when IBM Cloud actually
    rejects the API key or the CRN.
  • A request that fails to reach the service because the connection was
    dropped, the TLS handshake failed, or the request timed out now raises
    a QiskitServerlessException with code CONN1001 and a message
    saying the failure is usually temporary and to try again. These
    transient failures were previously reported with code AUTH1001 and a
    message telling the user to check their host and authentication, which
    pointed at configuration that was not the problem.
  • A successful response that arrives with an empty body, which happens
    on a transient blip and clears on retry, now raises a
    QiskitServerlessException with code EMPTY1001 and a message saying
    to try again. It was previously reported with code JSON1001 as a
    server json decoding error, which read as a permanent problem.

Changes

🐛 Bug Fixes