bench_func returning None for all but the first benchmark
Los mantenedores suelen responder en 1 día
@amritamishra01 ya está trabajando en esto.
Desde el 18/11/2025.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- performance
Línea de trabajo
Reproduce el ejemplo de benchmarks.py; después, lee bench_func en pyperf/_runner.py y la ruta de recopilación de benchmarks en pyperf/_bench.py y pyperf/_manager.py. Determina el contrato de retorno previsto entre los procesos manager y worker, y haz que el comportamiento o la documentación sean coherentes para que los resultados de benchmark informados puedan recopilarse en BenchmarkSuite.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'm trying to write a benchmark suite for several functions and use BenchmarkSuite to write the results to a json file. I have the following code (irrelevant parts removed):
import pyperf
import decimation_accel as dec
import decimation_accel_opt as opt
results_file = 'decimation.json'
runner = pyperf.Runner()
def main() -> None:
small = alloc_args(1024)
small10 = alloc_args(1024, rate=10)
small100 = alloc_args(1024, rate=100)
medium = alloc_args(1024 * 10)
benchmarks: List[pyperf.Benchmark] = []
benchmarks.append(runner.bench_func('dec.decimate_minmax(small) all', dec.minmax, *small))
benchmarks.append(runner.bench_func('opt.decimate_minmax(small) all', opt.minmax, *small))
benchmarks.append(runner.bench_func('dec.decimate_minmax(small10) all', dec.minmax, *small10))
benchmarks.append(runner.bench_func('opt.decimate_minmax(small10) all', opt.minmax, *small10))
benchmarks.append(runner.bench_func('dec.decimate_minmax(small100) all', dec.minmax, *small100))
benchmarks.append(runner.bench_func('opt.decimate_minmax(small100) all', opt.minmax, *small100))
benchmarks.append(runner.bench_func('dec.decimate_minmax(medium) all', dec.minmax, *medium))
benchmarks.append(runner.bench_func('opt.decimate_minmax(medium) all', opt.minmax, *medium))
print(benchmarks)
suite = pyperf.BenchmarkSuite(benchmarks) # filename='decimation.json')
suite.dump(results_file)
if __name__ == "__main__":
main()
However if I run this file, I get the following output:
[<Benchmark 'dec.decimate_minmax(small) all' with 1 runs>, None, None, None, None, None, None, None]
Traceback (most recent call last):
File "benchmarks.py", line 60, in <module>
main()
File "benchmarks.py", line 54, in main
suite = pyperf.BenchmarkSuite(benchmarks) # filename='decimation.json')
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_bench.py", line 639, in __init__
self.add_benchmark(benchmark)
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_bench.py", line 687, in add_benchmark
name = benchmark.get_name()
AttributeError: 'NoneType' object has no attribute 'get_name'
Traceback (most recent call last):
File "benchmarks.py", line 60, in <module>
main()
File "benchmarks.py", line 39, in main
benchmarks.append(runner.bench_func('dec.decimate_minmax(small) all', dec.minmax, *small))
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_runner.py", line 537, in bench_func
result = self._main(task)
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_runner.py", line 460, in _main
bench = self._manager()
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_runner.py", line 673, in _manager
bench = Manager(self).create_bench()
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_manager.py", line 232, in create_bench
worker_bench, run = self.create_worker_bench()
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_manager.py", line 131, in create_worker_bench
suite = self.create_suite()
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_manager.py", line 121, in create_suite
suite = self.spawn_worker(self.calibrate_loops, 0)
File "<REMOVED>/venv-local/lib/python3.8/site-packages/pyperf/_manager.py", line 107, in spawn_worker
raise RuntimeError("%s failed with exit code %s"
RuntimeError: <REMOVED>/venv-local/bin/python failed with exit code 1
If I don't put the results in the list, then they all appear to run fine, but then I have no way to collect the results.
- Lenguaje dominante
- Python
- Estrellas
- 967
- Forks
- 112
- Merge medio
- 5 d 8 h
- PR fusionados (30 d)
- 9
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 psf/pyperf
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
psf/pyperf#274 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Improve Type System for `pyperf`Posiblemente ocupada @DebanKsahu la tomó hace 69 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
psf/pyperf#255 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
psf/pyperf#243 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Extend hook's teardown metadata with warmup/calibration flagsPosiblemente ocupada @maurycy la tomó hace 170 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
psf/pyperf#239 · 12 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
psf/pyperf#216 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de psf/pyperf
Issues similares
-
add entry to blockAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Posiblemente ocupada @0z5a la tomó hoy. Abiertoneeds-triage
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
plot_graph crashes when a mesh node has no m2m edgePosiblemente ocupada @tygvi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mllam/neural-lam#883 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
future-agi/future-agi#4092 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
WingedGuardian/GENesis-AGI#4641 ·
Los mantenedores suelen responder en 1 día