custom AD transform plugin: a use case from YaoCompiler
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc điểm vào nào được nêu tên. Hãy bắt đầu bằng việc làm rõ Diffractor nên tương tác với Julia SSA IR của YaoCompiler như thế nào, bao gồm các khối lượng tử và các bộ kết thúc lượng tử, đồng thời xác định ranh giới plugin và hành vi mong đợi đối với các thành phần cổ điển so với các thành phần lượng tử trước khi có thể xác định phạm vi triển khai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
this is just one thing I was waiting Diffractor to think about, it comes from the idea of integrating Diffractor and YaoCompiler, I'll leave a description of what we want to do on this here, I assume this could be similar for GPUs too, since the design of SSA IR can be seen as MLIR regions too.
in a quantum program, there are certain AD rules that makes use of the reversibility and (quantum specific) algebra rules, such as Pauli operators etc.
As a result there are three ways of doing AD on a quantum program
- parameter shift rule: forward mode AD, works on hardware, but on pure quantum circuits that satisfy the Pauli operator permutation rule
- reverse mode using circuit reverisbility: reverse mode, but only runs on simulator, the register (quantum state vector) will always be mutated to save memory (thus has side effect)
- transform the circuit to an integral of channel: forward mode, works on hardware, works on broader set of operators, but will create a hybrid program (may contain classical control flow)
these can be implemented on a pure quantum program without touching compiler transform, which we can do in short term, but
the problem becomes different when the program contains classical control flows (the long term goal),
which is one feature we aim to support in YaoCompiler - compile a general Julia program to quantum hardware,
in YaoCompiler, we extend Julia SSA IR to contain two new elements in the SSA IR:
- a quantum block: like basic block, but only contains quantum instructions/statements, this block is always inside a basic block
- a quantum terminator: statement that jump from a quantum block to a basic block
(I wish I could post a picture of this, but I don't have one at the moment)
so then the idea is to tell an AD compiler like Diffractor to know how to transform a piece of program like this using a plugin, or re-use Diffractor's transformation in another compiler plugin for the irrelavent part (for the quantum case, is to run Diffractor on classical statements, but run a custom pass on the quantum components above) but I'm not sure if this is the best way of doing it. And I think with the work of julia compiler plugin there would be more cases like this that someone may want to have a custom AD plugin used by Diffractor when differentiating under their compiler plugin context.
I guess some other folks might be interested in this, cc: @aviatesk @femtomc
- Ngôn ngữ chính
- Julia
- Star
- 453
- Fork
- 33
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 JuliaDiff/Diffractor.jl
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
JuliaDiff/Diffractor.jl#302 · 2 bình luận ·
-
Wrong derivative of exp(cos(x))Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
JuliaDiff/Diffractor.jl#294 ·
-
Incorrect Jacobian calculationĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
JuliaDiff/Diffractor.jl#293 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
JuliaDiff/Diffractor.jl#290 · 8 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
JuliaDiff/Diffractor.jl#280 · 1 bình luận ·
Tất cả issue của JuliaDiff/Diffractor.jl
Issue tương tự
-
R_to_gamma and R_to_v are wrong for |Z| != 1 (e.g. heavy ions)Có thể đã có người làm @DavidSagan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
bmad-sim/BeamTracking.jl#366 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TSDAE's docstring implies a theta argument it does not takeCó thể đã có người làm @singhharsh1708 đã nhận 1 ngày trước. Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
SciML/PETScDiffEq.jl#282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add more snippets to R and JuliaĐang mởenhancement good first issue help wanted
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 82/100
-
SavedSubsystem with an integer save_idxs maps the index the wrong way roundCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SciML/SciMLBase.jl#1643 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
authority-vechtstromen ready-for-agent
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Deltares/Ribasim-NL#890 ·
Maintainer thường phản hồi trong vòng 1 ngày