Share via


Azure Quantum 配額

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

提示

第一次用戶會自動取得 免費 $500 美元(美元)的 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 命令列介面 (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 列會顯示帳戶具有 8333334 qgs IonQ 的限制,其中 33334 qgs 已使用過。 該帳戶也有 HQC 的限制 8000 其中已使用 Quantinuum。

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

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

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

  • 每月:使用量會在每個月 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 列會顯示帳戶具有 8333334 qgs IonQ 的限制,其中 33334 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 配額覆寫要求
    2. 選取 [問題類型] 的技術
    3. 選取工作區位於的訂用帳戶
    4. 選取 [所有服務]
    5. 選擇 [Azure Quantum – 預覽 ] 作為 [服務類型]
    6. 選擇您想要在 [資源] 下 變更配額的工作區
    7. 針對問題類型選擇 [其他 ]
    8. 前進到 解決方案 ,然後再前往 詳細數據
    9. 填寫所有欄位。 針對 [描述 ] 包含下列專案:
    • 您要變更配額的提供者名稱
    • 您是否要變更訂用帳戶範圍或工作區範圍的配額
    • 您想要變更的配額,以及要變更多少配額
    • 您增加配額的原因,任何理由都有助於我們在某些情況下做出決定。

後續步驟