Problem types: NumPy, Numba and JAX on CPU and GPU, to guide the choice of stack
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 32/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- numpy, python
調査の方向性
Read the existing precision/ harness and results from #1, then review meta#264 and the lecture runs in #3 for the intended crossover questions. Start with P1, P4, P3 and P7, implementing and comparing NumPy, Numba and JAX variants across the stated sizes, precision settings and devices. Done means validated timings, results under results/, a dashboard by problem type and a short guide with recommendations.
索引モデルが issue の本文から書いたものです。
説明
A suite of the problem types QuantEcon's lectures and research use, each written idiomatically in NumPy, Numba and JAX, and timed as used on CPUs and GPUs across problem sizes. The aim is data-driven guidance on which stack to use for which kind of problem, at what size, and on what hardware. This is the experiment for meta#264.
Why
- meta#264 asks for exactly this: crossover points between backends and devices, by problem type and size, to replace rules of thumb.
- #1 measures JAX only, by kernel type. Its precision matrix (results under
results/) shows how differently kernel types behave on a GPU. On a TITAN RTX, float64 costs 1.3× on a latency-bound recursion, about 4× on a memory-bound step and 20× to 27× on compute or transcendental work. It doesn't say whether Numba on a CPU would beat JAX for the same problem. - The lecture runs (#3) found that how a problem is written matters as much as the hardware. A vectorised Bellman step and a looped one, or a stored reward array and a recomputed one, land in different regimes.
Problem types
Each type gets a NumPy version as the baseline, a Numba version (CPU, parallel=True where it fits) and a JAX version (CPU and GPU), each written the way a careful author in that stack would write it.
| Problem type | QuantEcon pattern | Shape | |
|---|---|---|---|
| P1 | Value function iteration on a dense grid | Savings and discrete-choice models | Vectorised max over a choice grid; loops in Numba |
| P2 | Policy iteration | Howard improvement with a linear solve | Dense or iterative solves |
| P3 | Endogenous grid method | Income fluctuation problems | Interpolation |
| P4 | Monte Carlo simulation | Many paths of an AR(1) or Markov process | Parallel across paths, sequential in time |
| P5 | Markov chains | Stationary distributions, simulation | Sparse and dense linear algebra |
| P6 | Root finding and optimisation per state | Newton or bisection over a grid | Many small independent solves |
| P7 | Sequential recursions | Kalman filter, lax.scan |
Latency-bound |
| P8 | Gradient-based estimation | Maximum likelihood with autodiff | Where JAX's autodiff should matter |
Dimensions
- Problem size, swept to find the crossovers.
- Precision: float64 throughout, plus float32 where the problem tolerates it.
- Device: CPU and GPU, for JAX. Numba runs on CPU only;
numba.cudais out of scope unless a problem type calls for it. - Dask (in meta#264) is left out, unless a problem type needs data larger than memory or distributed scheduling.
Method
#1's house standard:
- one fresh process per measurement, with compile time counted, and cold and warm times kept apart;
- the result dtype asserted;
- every implementation's answer checked against the NumPy baseline.
The harness extends precision/, with one module per problem type and one function per stack.
Platforms
As in #1: qe-mini1's M6 and qe-wharton1-gpu's Threadripper and TITAN RTX first. Then qe-wharton2's M5 Pro once it is onboarded, and the RunsOn T4 once RunsOn is configured for this repository.
Phases
- P1, P4, P3 and P7 first. They span the regimes #1 found, and they shake out the harness across three stacks.
- Then P2, P5, P6 and P8.
Output
- results under
results/, as for #1; - a dashboard view by problem type, showing the fastest stack and device at each size;
- for the lecture series, a short guide of the form "for problem type X at size N, use stack S on device D", with the numbers beside it.
🤖 Generated with Claude Code
- 主要言語
- Python
- スター
- 0
- フォーク
- 1
- 平均マージ
- 3時間 29分
- マージ済み PR(30日)
- 64
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantEcon/benchmarks のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
QuantEcon/benchmarks#78 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
QuantEcon/benchmarks#72 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
P5: Markov chains, starting with the stationary distribution of a savings policy (aiyagari_jax)オープン
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
QuantEcon/benchmarks#47 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
QuantEcon/benchmarks#27 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Float32 fidelity: which float64 lectures need float64, and can the heaviest step drop to float32?オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
QuantEcon/benchmarks#11 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
QuantEcon/benchmarks の issue をすべて見る
似ている issue
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
flashinfer-ai/flashinfer#9803 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
oscarbol09/thesisforge#61 ·
-
api bug performance
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
oscarbol09/audiobard#159 ·
-
area:web p2 product:business triage:active type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
cuadrao-ai/argus#2328 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nikhilb2/simple_invoicing#907 ·