MLX mode never reaches the mx.addmm dispatches because BlasOpt is excluded
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- machine-learning, performance
Línea de trabajo
Start by reading MLXLinker and the BlasOpt rewrite rules, then inspect the Gemv and Ger dispatches in link/mlx/dispatch/blas.py. Reproduce the two examples in the issue and inspect the MLX graph to confirm which rewrites run. Done when both expressions reach the intended mx.addmm dispatches and the outer product is handled in MLX mode.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
MLXLinker lists BlasOpt among its incompatible rewrites, so Gemv and Ger never appear in an MLX graph, and their mx.addmm dispatches in link/mlx/dispatch/blas.py are unreachable. A @ v + b runs as a Matmul plus a separate Add, and an outer product col @ row runs as a Matmul. local_dot_to_mul leaves core outer products alone so GER can handle them, but MLX mode never produces a GER. #2514 adds local_outer_dot_to_mul for Numba, which has no GER either, and tagging it mlx would cover the outer product. #2406 turns Gemv and Ger into plain Ops, but MLX still excludes BlasOpt there.
import re
import mlx.core as mx
import numpy as np
import pytensor
import pytensor.tensor as pt
A = pt.matrix("A", dtype="float32")
v = pt.vector("v", dtype="float32")
b = pt.vector("b", dtype="float32")
col = pt.matrix("col", shape=(None, 1), dtype="float32")
row = pt.matrix("row", shape=(1, None), dtype="float32")
rng = np.random.default_rng(0)
cases = {
"A @ v + b": ([A, v, b], A @ v + b, [rng.normal(size=(5, 3)), rng.normal(size=3), rng.normal(size=5)]),
"col @ row": ([col, row], col @ row, [rng.normal(size=(5, 1)), rng.normal(size=(1, 3))]),
}
for name, (inputs, output, values) in cases.items():
fn = pytensor.function(inputs, output, mode="MLX")
mx.export_to_dot("graph.dot", fn.vm.jit_fn(*[mx.array(value.astype("float32")) for value in values]))
print(name, [type(node.op).__name__ for node in fn.maker.fgraph.toposort()], re.findall(r'label ="([^"]+)"', open("graph.dot").read()))
# A @ v + b ['DimShuffle', 'Dot', 'DimShuffle', 'Elemwise'] ['Transpose', 'Reshape', 'Matmul', 'Transpose', 'Reshape', 'Add']
# col @ row ['Dot'] ['Matmul']
- Lenguaje dominante
- Python
- Estrellas
- 654
- Forks
- 258
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 39
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 pymc-devs/pytensor
-
Docs of mode still mentions C/CVM as the default with FAST_RUNPosiblemente ocupada @ADITYASINGH1206 la tomó hace 8 días. Abiertodocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pymc-devs/pytensor#2641 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Update conditions page in docsAbiertodocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
BUG: geomspace returns wrong sign for the endpoints when start and stop are negativePosiblemente ocupada @mayuriphad la tomó hace 27 días. Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Reciprocal.impl computes np.float32(1.0) / x: float32 precision for float64 scalars under NEP 50 (Python linker)Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pymc-devs/pytensor#2430 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pymc-devs/pytensor#2428 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de pymc-devs/pytensor
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dgunning/edgartools#2019 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
topoteretes/cognee#6818 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
source_verification_agent: no outcome when the publisher confirms a work but its DOI resolves to a different recordPosiblemente ocupada @pinjun99 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Imbad0202/academic-research-skills#1159 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finitePosiblemente ocupada @leninworld la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
DoubleML/doubleml-for-py#471 ·
Los mantenedores suelen responder en 1 día