Azure Quantum 配額

Azure Quantum 配額是 QPU targets 使用量的提供者定義限制。 配額有助於防止使用者意外成本超額,同時保留提供者系統的完整性。 配額是以您的提供者方案選取為基礎,而且通常會隨著支援票證而增加。
配額追蹤的使用量不一定系結至成本或點數,但可能會相互關聯。

提示

第一次使用者會自動取得免費 $500 (USD) Azure Quantum 點數,以便與每個參與的量子硬體提供者搭配使用。 如果您已使用所有點數,但還需要更多,可以申請 Azure Quantum 點數方案

如何計算配額

在 Azure Quantum 中,硬體和軟體提供者會定義和控制其供應專案的配額。 如需詳細的配額資訊,請參閱每個提供者參考頁面。 如果提供者未出現在下列清單中,則該提供者不會定義任何配額。

檢視剩餘配額

Azure Quantum 使用量和配額會根據每個提供者的使用單位來測量。 某些提供者不會定義任何配額,而且不會顯示使用量資訊。

注意

如果您使用 Azure Quantum 點數方案,而不是計費方案,配額資訊會對應至您配置的點數。 在此情況下,配額會列出您收到的點數總數。

使用 Azure 入口網站 追蹤配額

  1. 使用 Azure 訂用帳戶的認證登入Azure 入口網站
  2. 選取您的 Azure Quantum 工作區
  3. 在左側面板中的 [ 作業] 底下,移至 [ 點數和配額 ] 刀鋒視窗,然後選取 [ 配額] 索引 標籤。
  4. 請參閱已取用和每個所選提供者的剩餘配額。 請注意,配額資訊會顯示在三個數據行中。
  • 工作區使用量:目前工作區的使用限制。 每個 Azure Quantum 工作區都有使用量限制。
  • Azure 訂用帳戶使用量:目前區域和訂用帳戶內所有工作區的使用量。 並非所有配額都會在此層級追蹤。
  • 頻率:更新配額的期間。 如果每月,則會在每個月 1 日重設使用量。 如果一次性,則永遠不會重設使用量。

Azure 入口網站中的 [配額] 刀鋒視窗

在此檢視中, Azure Quantum 點數 會包含為配額。 這可讓使用者根據提供者追蹤的單位以及相關聯的間隔來查看所表示的信用額度資訊。

使用 Azure CLI 追蹤配額

您可以使用 Azure Command-Line 介面 (Azure CLI) 來查看配額。 如需詳細資訊,請參閱 如何使用 Azure CLI 管理量子工作區

  1. 安裝Azure CLI quantum擴充功能。 開啟命令提示字元並執行下列命令,如果已安裝舊版,也會升級延伸模組。

    az extension add --upgrade -n quantum
    
  2. 使用您的認證登入Azure。 您將會看到與您帳戶相關聯的訂用帳戶清單。

    az login
    
  3. 指定您想要使用的 用帳戶。

    az account set -s <Your subscription ID>
    
  4. 選取您想要使用的 工作區 。 請注意,您也需要指定資源群組和位置。

    az quantum workspace set \
        -g MyResourceGroup \
        -w MyWorkspace \
        -l MyLocation \
        -o table
    
  5. az quantum workspace quotas 使用 命令來顯示所選工作區的配額資訊。

    az quantum workspace quotas -o table
    
    |Dimension | Holds | Limit   |   Period |   ProviderId | Scope | Utilization|
    |--------- | ----- | --------- | -------- | ----------|  ------------ | -----------|
    |qgs      |  0.0  |  8333334.0 | Infinite | ionq      |  Subscription | 33334.0|
    |hqc      |  0.0  |  800.0     | Infinite | quantinuum  | Subscription | 0.0|
    

請參閱上述輸出作為範例。 在此情況下,資料 qgs 列會顯示帳戶的 IonQ 33334 qgs 限制 8333334 qgs 已使用。 帳戶也有已使用 Quantinuum 的 0 HQC 限制 800

[ 範圍 ] 資料行會指出配額是參考目前的工作區還是訂用帳戶。

  • 工作區:會追蹤個別工作區的配額。
  • 用帳戶:會針對相同訂用帳戶/區域內的所有工作區一起追蹤配額。

[ 期間] 資料行指出配額更新的期間。

  • 每月:使用量會在每個月 1 日重設。
  • 無限:使用量永遠不會重設 (也稱為Azure 入口網站檢視) 一

使用 Python SDK 追蹤配額

  1. 安裝最新版的azure-quantum Python 套件

  2. 開啟新的 Python 檔案。 具現化Workspace 物件,可讓您連線到先前部署在 Azure 中的工作區。

    from azure.quantum import Workspace
    
    # Copy the following settings for your workspace
    workspace = Workspace ( 
      resource_id = "", # Add your resource_id 
      location = ""  # Add your workspace location (for example, "westus") 
    )
    
  3. get_quotas使用 方法來顯示所選工作區的配額資訊。

    quotas = workspace.get_quotas() 
    
    [{'dimension': 'qgs', 'scope': 'Subscription', 'provider_id': 'ionq', 'utilization': 33334.0, 'holds': 0.0, 'limit': 16666667.0, 'period': 'Infinite'}, 
    
     {'dimension': 'hqc', 'scope': 'Subscription', 'provider_id': 'quantinuum', 'utilization': 0.0, 'holds': 0.0, 'limit': 40.0, 'period': 'Infinite'}, 
    
     {'dimension': 'ehqc', 'scope': 'Subscription', 'provider_id': 'quantinuum', 'utilization': 0.0, 'holds': 0.0, 'limit': 160.0, 'period': 'Infinite'}, 
    
     {'dimension': 'combined_job_hours', 'scope': 'Workspace', 'provider_id': 'Microsoft', 'utilization': 0.0, 'holds': 0.0, 'limit': 20.0, 'period': 'Monthly'}, 
    
     {'dimension': 'combined_job_hours', 'scope': 'Subscription', 'provider_id': 'Microsoft', 'utilization': 0.011701412083333333, 'holds': 0.0, 'limit': 1000.0, 'period': 'Monthly'}]
    

請參閱上述輸出作為範例。 在此情況下,資料 qgs 列會顯示帳戶的 IonQ 33334 qgs 限制 8333334 qgs 已使用。 並行作業數目是一次每個工作區可排入佇列的作業數目。

專案 scope 會指出配額是參考目前的工作區或訂用帳戶。

  • 工作區:會追蹤個別工作區的配額。
  • 用帳戶:會針對相同訂用帳戶/區域內的所有工作區一起追蹤配額。

專案 period 會指出配額更新的期間。

  • 每月:使用量會在每個月 1 日重設。
  • 無限:使用量永遠不會重設 (也稱為Azure 入口網站檢視) 一

提示

方法會 get_quotas 以 Python 字典的形式傳回結果。 如需更人類看得懂的格式,請使用下列程式碼範例,在訂用帳戶和工作區層級列印剩餘配額的摘要 > 。

複製下列程式碼以追蹤訂用帳戶 層級的配額。

# This gathers usage against quota for the various providers (quota is set at the subscription level).
# Note that a provider may have mutiple quotas, such as Quantinuum that limits usage of their Emulator.

rigetti_quota = 0
ionq_quota = 0
quantinuum_hqc_quota = 0
quantinuum_ehqc_quota = 0

rigetti_quota_utilization = 0
ionq_quota_utilization = 0
quantinuum_hqc_quota_utilization = 0
quantinuum_ehqc_quota_utilization = 0

for quota in workspace.get_quotas():
    if (quota['provider_id'] == 'rigetti'):
        rigetti_quota = quota['limit']
        rigetti_quota_utilization = quota['utilization']
    if (quota['provider_id'] == 'ionq'):
        ionq_quota = quota['limit']
        ionq_quota_utilization = quota['utilization']
    if (quota['dimension'] == 'hqc'):
        quantinuum_hqc_quota = quota['limit']
        quantinuum_hqc_quota_utilization = quota['utilization']
    if (quota['dimension'] == 'ehqc'):
        quantinuum_ehqc_quota = quota['limit']
        quantinuum_ehqc_quota_utilization = quota['utilization']

print('Rigetti quota use: ', "{:,}".format(rigetti_quota_utilization), '/', "{:,}".format(rigetti_quota))
print('IonQ quota use:', "{:,}".format(ionq_quota_utilization), '/', "{:,}".format(ionq_quota))
print('Quantinuum HQC quota use:', "{:,}".format(quantinuum_hqc_quota_utilization), '/', "{:,}".format(quantinuum_hqc_quota))
print('Quantinuum eHQC quota use:', "{:,}".format(quantinuum_ehqc_quota_utilization), '/', "{:,}".format(quantinuum_ehqc_quota))

複製下列程式碼以追蹤 工作區層級的配額。

# This gathers usage against quota for the various providers for the current workspace
# As there can be multiple workspaces in a subscription, the quota usage for the workspace is less or equal to usage against quota at the subscription level

amount_utilized_rigetti = 0
amount_utilized_ionq = 0
amount_utilized_quantinuum_hqc = 0
amount_utilized_quantinuum_ehqc = 0

for job in workspace.list_jobs():
    if (job.details.cost_estimate != None):
        for event in job.details.cost_estimate.events:
            if (event.amount_consumed > 0):
                #print(event.amount_consumed, event.dimension_name, 'on', job.details.provider_id)
                if (job.details.provider_id == 'rigetti'):
                    amount_utilized_rigetti += event.amount_consumed
                if (job.details.provider_id == 'ionq'):
                    amount_utilized_ionq += event.amount_consumed

                if (job.details.provider_id == 'quantinuum'):
                    #print(event.amount_consumed, event.dimension_name, 'on', job.details.provider_id)
                    #print(event)
                    if (event.dimension_id == 'hqc'):
                        amount_utilized_quantinuum_hqc += event.amount_consumed
                    else:
                        amount_utilized_quantinuum_ehqc += event.amount_consumed
                        print(job.id, event)


print('Rigetti quota use in current workspace: ', "{:,}".format(amount_utilized_rigetti), '/', "{:,}".format(rigetti_quota))
print('IonQ quota use in current workspace:', "{:,}".format(amount_utilized_ionq), '/', "{:,}".format(ionq_quota))
print('Quantinuum HQC quota use in current workspace:', "{:,}".format(amount_utilized_quantinuum_hqc), '/', "{:,}".format(quantinuum_hqc_quota))
print('Quantinuum eHQC quota use in current workspace:', "{:,}".format(amount_utilized_quantinuum_ehqc), '/', "{:,}".format(quantinuum_ehqc_quota))

要求其他配額

如果您未使用 Azure Quantum 點數方案,您可以藉由提出支援票證來要求增加配額。

  1. 使用 Azure 訂用帳戶的認證登入Azure 入口網站

  2. 選取您的 Azure Quantum 工作區

  3. 在左側面板中的 [ 作業] 底下,移至 [ 點數和配額 ] 刀鋒視窗,然後選取 [ 配額] 索引 標籤。

  4. 按配額頁面上的 [ 增加 ] 按鈕,或選取入口網站側邊面板上的 [ 新增支援要求 ] 按鈕。

  5. 將會開啟支援票證。 請遵循下列步驟來填寫要求。

    1. 將問題描述為 Azure Quantum Quota Override Request
    2. 選取 [問題類型] 的技術
    3. 選取工作區所在的訂用帳戶
    4. 選取 [所有服務]
    5. 選擇 [Azure Quantum – 預覽 ] 作為 [服務類型]
    6. 選擇您要在 [資源] 下變更配額的工作區
    7. 針對問題類型選擇 [其他 ]
    8. 前進到 [解決方案 ],然後再次移至 [詳細資料]
    9. 填寫所有欄位。 針對 [描述] 包含下列專案:
    • 您想要變更配額的提供者名稱
    • 您是否要變更訂用帳戶範圍或工作區範圍的配額
    • 您想要變更的配額,以及要變更多少配額
    • 您增加配額原因的任何理由,都有助於我們在某些情況下決定。

後續步驟