How should we use pyjulia in parallel?
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
- 25/100
Hướng nghiên cứu
Start by reviewing the decorator and the Parallel(..., mmap_mode="w+") example in the issue, then compare it with the linked test.py example. Decide whether per-process loading and memmapping should be supported or documented, and record the agreed parallel-usage guidance as done.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I want to propose a discussion about how pyjulia should be used in parallel computing.
I recently found a way that seems rather stable:
- we should make sure that code is loaded only once per each process
- we should use
w+mode formemmapping
Here is a mini snippet with a decorator that could be added to pyjulia to ensure point 1.
For point 2, instead, joblib has an option in Parallel. Should we may explicit this in the documentation?
def julia_import(module: str, filename: str):
def decorator(fn):
def wrapper(*args, **kwargs):
# including stuffs
from julia import Main
if not hasattr(Main, module):
Main.include(filename)
return fn(Main, *args, **kwargs)
return wrapper
return decorator
@julia_import("MyModule", "lib.jl")
def python_function_using_julia(Main, *args, **kwargs):
return Main.MyModule.julia_function(*args, **kwargs)
res = Parallel(n_jobs=-1, mmap_mode="w+")(
delayed(python_function_using_julia)(arr) for arr in tqdm(data))
Example from: https://github.com/00sapo/pyjulia-vs-juliacall/blob/master/test.py
- Ngôn ngữ chính
- Python
- Star
- 893
- Fork
- 101
- 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 JuliaPy/pyjulia
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Kill existing Julia sessionĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của JuliaPy/pyjulia
Issue tương tự
-
enhancement good first issue Stellar Wave trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Hochfrequenz/aibap.mcp#578 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mishraprafful/multihull#150 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
python-caldav/caldav#735 ·
Maintainer thường phản hồi trong vòng 1 ngày