Job operations are not parallelizable
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy ví dụ multiprocessing.Pool được báo cáo với exec_job, sau đó lần theo các điểm vào solver.submit() và job.get_results() được SimulatedBifurcationMachine sử dụng. So sánh các dấu thời gian của cả hai worker và xác định nơi việc gửi hoặc truy xuất kết quả trở nên tuần tự. Được coi là hoàn tất khi các job độc lập có thể được gửi và xử lý đồng thời mà không gặp độ trễ vài phút đã quan sát.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm trying to submit and process results of multiple jobs in parallel but I'm noticing that, in many cases, jobs are submitted sequentially.
import datetime
import imp
from multiprocessing import Pool
from azure.quantum import Workspace
from azure.quantum.optimization import Problem, ProblemType, Term
from azure.quantum.target.toshiba import SimulatedBifurcationMachine
import logging
def create_problem():
problem = Problem('Test_Problem', problem_type=ProblemType.pubo)
problem.add_terms([
Term(c=1, indices=[]),
Term(c=2, indices=[1, 2]),
Term(c=-3, indices=[1, 2]),
Term(c=1, indices=[0, 2])
])
return problem
def exec_job(no):
workspace = Workspace (
resource_id = "<workspace-id>",
location= "<location>"
)
problem = create_problem()
solver = SimulatedBifurcationMachine(workspace, loops=0, timeout=10)
print(str(datetime.datetime.utcnow()), "\t[%d] solver.submit() start" % no)
job = solver.submit(problem)
print(str(datetime.datetime.utcnow()), "\t[%d] job.id=%s" % (no, str(job.id)))
print(str(datetime.datetime.utcnow()), "\t[%d] job.get_results() start" % no)
result = job.get_results()
print(str(datetime.datetime.utcnow()), "\t[%d] job.details=%s" % (no, str(job.details)))
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
njobs = 2
with Pool(processes=njobs) as pool:
pool.map(func=exec_job, iterable=range(njobs))
For the above, output is:
2022-04-21 18:40:23.466530 [0] solver.submit() start
2022-04-21 18:40:23.542727 [1] solver.submit() start
2022-04-21 18:40:28.752803 [1] job.id=810bc3bb-c1a2-11ec-baa1-b831b575aea6
2022-04-21 18:40:28.752803 [1] job.get_results() start
..........2022-04-21 18:40:52.826348 [1] job.details={..........}
2022-04-21 18:44:19.108243 [0] job.id=81018a8e-c1a2-11ec-adf4-b831b575aea6
2022-04-21 18:44:19.109211 [0] job.get_results() start
..........2022-04-21 18:44:42.799796 [0] job.details={..............}
You can see that job 1 was submitted and awaited while job 0 hasn't been submitted at the same time and was done 4 mins after the first job.
- Ngôn ngữ chính
- Python
- Star
- 160
- Fork
- 113
- Merge trung bình
- 6 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/azure-quantum-python
-
Infinite recursion error on deep copy `AzureBackendConfig` due to __getattr__ implementation Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
Export types Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
microsoft/azure-quantum-python#650 · 1 bình luận ·
-
azure-quantum
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 20/100
Tất cả issue của microsoft/azure-quantum-python
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·