Improve performance of String names
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ó
- 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
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- julia
- Lĩnh vực
- performance
Hướng nghiên cứu
Bắt đầu với src/Utilities/model.jl, tại các định nghĩa lưu trữ String được liên kết trong issue, sau đó xem xét cách việc lấy và thiết lập tên làm lộ biểu diễn nội bộ. So sánh InlineStrings.jl và WeakRefStrings.jl với yêu cầu tránh các đối tượng được GC theo dõi có vòng đời dài, đồng thời vẫn duy trì khả năng tương thích với String. Công việc được xem là hoàn tất khi hiệu năng tên trong các mô hình lớn được cải thiện mà không thay đổi hành vi tên công khai, sau đó điều tra các solver wrapper bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A common source of performance problems in JuMP and MathOptInterface are dealing with the String names of variables and constraints.
As a recent example, see https://github.com/jump-dev/MathOptInterface.jl/pull/2426 and related issues/PRs.
The main place that Strings are stored is:
When building models with large (>10^5) numbers of variables and constraints, these dictionaries contain a large number of strings. Each String is a GC-tracked object, and it is long-lived, because we maintain these dictionaries throughout the lifetime of a Model. If CachingOptimizer is involved, there can also be multiple copies of the strings, for example, if we have a setup like Cache(Model, Bridge(Cache(Model, Solver))).
Lots of long-lived GC-tracked objects are bad for Julia's garbage collector.
Workaround
The main workaround at present is JuMP.set_string_names_on_creation(model, false), which does not pass string names from JuMP to the solver.
The downside of this workaround is that solvers and file writers cannot print or display useful names to the user.
Potential approaches
We should try replacing the String storage with an alternative string type. Candidates are:
To ensure backwards compatibility, we should make sure that getting and setting these strings uses the original String type, so that the internal storage is hidden from the user.
It is okay to convert between string types, and to generate extra allocations if these new strings are short-lived objects. The real performance problem is long-lived GC-tracked objects.
Solvers
Many solver packages also store String names. If the changes to MOI are an improvement, we should investigate was to simplify name handling in the different solver wrappers.
- Ngôn ngữ chính
- Julia
- Star
- 506
- Fork
- 103
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 9
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 jump-dev/MathOptInterface.jl
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jump-dev/MathOptInterface.jl#3113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bridges] MultirowChange in set_map.jl drops zero coefficientsCó thể đã có người làm @odow đã nhận 6 ngày trước. Đang mở
jump-dev/MathOptInterface.jl#3106 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Precision loss in Hessian computationCó thể đã có người làm @blegat đã nhận 7 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
jump-dev/MathOptInterface.jl#3104 · 11 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Layer instantiatorĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
jump-dev/MathOptInterface.jl#2986 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Differentiable Optimization APIĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
jump-dev/MathOptInterface.jl#2969 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của jump-dev/MathOptInterface.jl
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
JuliaMath/Polynomials.jl#647 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
OpenSourceAWE/SymbolicAWEModels.jl#431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make PDAQP an optional extraĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
JuliaArrays/StaticArrays.jl#1365 ·
-
`@fastmath` reductions are 2–5× slower: no `neutral_element` for `Base.FastMath.max_fast` and co.Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
JuliaGPU/GPUArrays.jl#833 ·
Maintainer thường phản hồi trong vòng 1 ngày