Improve performance of String names
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- julia
- 領域
- performance
調査の方向性
issueでリンクされているStringの格納定義について、まずsrc/Utilities/model.jlから始め、次に名前の取得と設定によって内部表現がどのように露出するかを調べます。InlineStrings.jlとWeakRefStrings.jlを、Stringとの互換性を維持しながら長期間存続するGC追跡オブジェクトを避けるという要件に照らして比較します。大規模モデルにおける名前のパフォーマンスを、公開されている名前の動作を変更せずに改善し、その後、影響を受けるsolver wrapperを調査すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Julia
- スター
- 506
- フォーク
- 103
- 平均マージ
- 1日 10分
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jump-dev/MathOptInterface.jl のほかの issue
-
[Bridges] MultirowChange in set_map.jl drops zero coefficients対応中かも @odow が 5 日前に担当しました。 オープン
jump-dev/MathOptInterface.jl#3106 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Precision loss in Hessian computation対応中かも @blegat が 6 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
jump-dev/MathOptInterface.jl#3104 · コメント 11 件 ·
メンテナーはふだん 1 日以内に返信
-
Layer instantiatorオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
jump-dev/MathOptInterface.jl#2986 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jump-dev/MathOptInterface.jl#2969 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add Batched{S} setオープンType: Set Request
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
jump-dev/MathOptInterface.jl#2904 · コメント 15 件 · リアクション 7 件 ·
メンテナーはふだん 1 日以内に返信
jump-dev/MathOptInterface.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
EnzymeAD/Reactant.jl#3549 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliaGeometry/Meshes.jl#1469 ·
メンテナーはふだん 1 日以内に返信
-
distributed 🕸️
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
CliMA/Oceananigans.jl#6295 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信