inplace_elemwise retries an input it already rejected, once per Elemwise output
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- compilers, performance
Hướng nghiên cứu
The retry loop is in InplaceGraphOptimizer.try_inplace_on_node, which calls tried_inputs.discard(i) after an InconsistencyError; the inplace_elemwise rewrite in pytensor/tensor/rewriting/elemwise.py drives it. Run the 400-output snippet with the py linker and time it, then compare against the excluded-rewrite run. Done when compile time drops substantially and the in-place node count in the test suite is unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
inplace_elemwise, the rewriter that lets Elemwise nodes overwrite their inputs, takes time close to cubic in the number of outputs of a fused Elemwise whose inputs can't be destroyed. When an attempt raises InconsistencyError, InplaceGraphOptimizer.try_inplace_on_node calls tried_inputs.discard(i) and offers the same input to the next output. Every reason DestroyHandler rejects a destroy depends on the input, not the output, so each retry fails, and each one replaces and reverts all of the node's outputs.
import time
import pytensor
import pytensor.tensor as pt
from pytensor.compile.mode import Mode
x = pt.matrix("x", shape=(7, 7))
X = x @ x
outputs = [pt.exp(X + k) for k in range(400)] # fused into one Elemwise with 400 outputs
y = pt.join(0, X, *outputs) # reads X and every output, so X can't be destroyed
start = time.perf_counter()
pytensor.function([x], y, mode=Mode(linker="py", optimizer="fast_run"))
print(f"{time.perf_counter() - start:.1f} s") # 13.1 s
# workaround: Mode(linker="py", optimizer="fast_run").excluding("inplace_elemwise") compiles in 0.4 s
inplace_elemwise alone takes 0.07, 0.38, 2.15 and 13.8 s at 50, 100, 200 and 400 outputs. In a real graph with a 364-output Elemwise feeding a 1114-input Scan, rewriting took 66 s. With the retry removed it took 30 s, and the compiled graph had the same 1369 nodes and 210 in-place nodes.
- Ngôn ngữ chính
- Python
- Star
- 655
- Fork
- 266
- Merge trung bình
- 3 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 pymc-devs/pytensor
-
BUG: cumsum and cumprod keep bool and small integer dtypes, so cumsum(x > 0) is wrongCó thể đã có người làm @rishabhsai đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs of mode still mentions C/CVM as the default with FAST_RUNCó thể đã có người làm @ADITYASINGH1206 đã nhận 13 ngày trước. Đang mởdocs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pymc-devs/pytensor#2641 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update conditions page in docsCó thể đã có người làm @caxaxa đã nhận 3 ngày trước. Đang mởdocs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG: geomspace returns wrong sign for the endpoints when start and stop are negativeCó thể đã có người làm @mayuriphad đã nhận 32 ngày trước. Đang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Reciprocal.impl computes np.float32(1.0) / x: float32 precision for float64 scalars under NEP 50 (Python linker)Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pymc-devs/pytensor#2430 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pymc-devs/pytensor
Issue tương tự
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
kornia/kornia-rs#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
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 76/100
PolicyEngine/ai-inequality#64 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timeCó thể đã có người làm @PabloRoque đã 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
pymc-devs/pymc-extras#839 ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày