meta_kernel::compile is very slow, even for cached source
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- performance
Línea de trabajo
Empieza perfilando meta_kernel::compile y sus llamadas registradas a clCreateKernel, sha1 y program::build_with_source; el issue no menciona archivos fuente ni tests. Determina por qué los programas almacenados en caché siguen incurriendo en la creación repetida de kernels y en el hashing, y luego ejecuta un benchmark de esa ruta con caché para confirmar una sobrecarga sustancialmente menor sin perder el almacenamiento en caché de compilación existente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi,
I am currently benchmarking the overhead of boost::compute. My test-program is computing nothing big and the equivalent cpu program finishes in no measurable runtime. The OpenCL version takes several seconds, so i decided to check with valgrind-callgrind where this time is lost. My program utilizes 11 different kernels and the runtime is the Intel OpenCL cpu implementation. I am using callgrind with O1 optimizations.
71% of total run-time is spent in 8149 calls to meta_kernel::compile.
Inside, we have over all 8149 calls:
total-runtime% function
43.21% clCreateKernel
14.5% compute::detail::sha1::sha1
8.7% program::build_with_source
As a sanity check:
1.6% meta_kernel::source
1.2% clEnqueueNDRangeKernel
so, roughly 58% of total running time is spent on figuring out whether the program is already build and creating the kernel afterwards. Compiling and caching works fine, we have exactly 11 calls to build_with_source.
The problem is that compute assumes that kernels are throw-away objects. This is unfortunately not the case. e.g. on NVIDIA, clCreateKernel is reported to have an overhead of roughly 1ms. My runtime seems to be in the same order. The programs built with meta_kernel have only one kernel function, so one easy workaround would be to cache the kernel together with the program.
Also, sha1 is terribly slow. The hash function should not take an order of magnitude longer than creating the source in the first place.
- Lenguaje dominante
- C++
- Estrellas
- 1.7k
- Forks
- 340
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 boostorg/compute
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
-
constant_iterator and counting_iterator dereference attempts to bind a const object to a referenceAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
Todos los issues de boostorg/compute
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
uxlfoundation/oneDNN#6604 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[Bug]: RoundToNearest truncates in plugins compiled with spcomp 1.13Posiblemente ocupada @fmu1337 la tomó hoy. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
alliedmodders/sourcemod#2627 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lballabio/QuantLib#3134 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
new issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
llvm/llvm-project#245835 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
EchoTools/nevr-runtime#2823 ·
Los mantenedores suelen responder en 1 día