Inline linear SCC solves share one `LinearCache` per matrix size, so every call refactorizes
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- performance
Línea de trabajo
Start by tracing numeric_ldiv! and solve_into! to see how task-local LinearCache instances are selected and refactorized. The issue suggests adding a solve-site key to emitted safe_ldiv(A, b) calls; compare that approach with keying by A's buffer and consider cache lifetime. Done when unchanged matrices at distinct inline linear SCC solve sites reuse their own factorization without retaining a cache for every problem built.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
numeric_ldiv! keeps one task-local LinearCache per array type and size, shared by every inline linear SCC solve of that shape. So solve_into! copies A in and refactorizes on every call, even when A hasn't changed, since another site of the same size may have used the cache in between.
With one cache per solve site (still task-local), a site whose A depends only on parameters could keep its factorization. On the model below, skipping the refactorization while A is unchanged makes f about 2.5x faster at N = 12 and 1.5x at N = 6 (Julia 1.12).
The emitted safe_ldiv(A, b) would need a site key to key the cache by, e.g. a third argument. Keying by A's buffer instead would leave the emitted code alone, but keep a cache alive for every problem ever built.
@DhairyaLGandhi does this direction sound right? Related: #173.
Model
using ModelingToolkit, LinearAlgebra
using ModelingToolkit: t_nounits as t, D_nounits as D
import ModelingToolkitTearing as MTKTearing
N = 12
@variables x(t)[1:N] y(t)[1:N]
@parameters K[1:N, 1:N]
eqs = [[D(x[i]) ~ -x[i] + y[i] for i in 1:N]; [sum(K[i, j] * y[j] for j in 1:N) ~ x[i] for i in 1:N]]
sys = mtkcompile(System(eqs, t; name = :m);
reassemble_alg = MTKTearing.DefaultReassembleAlgorithm(; inline_linear_sccs = true))
prob = ODEProblem(sys, [x => (1:N) ./ N, K => fill(0.5, N, N) + N * I], (0.0, 1.0))
- Lenguaje dominante
- Julia
- Estrellas
- 8
- Forks
- 14
- Merge medio
- 8 d 8 h
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaComputing/StateSelection.jl
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
-
Inlined linear SCC of three unknowns: the run-time solve dominates the cost of the right-hand sideAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
JuliaComputing/StateSelection.jl#173 · 3 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
JuliaComputing/StateSelection.jl#172 · 1 comentario ·
-
State-machine query operators in ModelingToolkitTearing throw UndefVarError for wrapPosiblemente ocupada @baggepinnen la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
`maybe_zeros` check does not look inside a division, so tearing divides by a parameter expression that is zero (NaN in initialization)Posiblemente ocupada @mwhincup la tomó hace 19 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
JuliaComputing/StateSelection.jl#166 · 1 comentario ·
Todos los issues de JuliaComputing/StateSelection.jl
Issues similares
-
release preparation spack
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
30-minutes algorithm any-language codewars dart easy elixir hackerrank hacktoberfest haskell help wanted interview-prep julia leetcode lua open-source r scala students zig
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Huerte/algo-solutions-python#163 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
QuantumSavory/QuantumClifford.jl#853 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
JuliaPackaging/Yggdrasil#15441 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
JuliaSmoothOptimizers/Penelopt.jl#260 ·
Los mantenedores suelen responder en 1 día