guests read CPUID leaf 8000_001d even without TopologyExtensions
Los mantenedores suelen responder en 1 día
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
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
Línea de trabajo
Start by reading the CPUID leaf handling for AmdTurin and AmdTurinV2, especially the 0x80000008 and 0x8000001D cache topology fields referenced in the issue. Compare those leaves with the proposed AmdTurinV3 behavior, then check the CPU platform specialization path; done means the new model reports the intended cache layout and handles TopologyExtensions as described.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
we got a report from a customer that PyTorch <2.11 computes numerically incorrect results on amd_turin CPU platforms. PyTorch, as a refresher for people who haven't looked at any of this stuff in years (hi) uses https://github.com/uxlfoundation/oneDNN for hardware acceleration including (among other things) JITing SIMD'd kernels for the operations to be evaluated. oneDNN, then, uses https://github.com/herumi/xbyak both to learn information about the CPU that is being JIT'd to, and for actual code generation.
so, then, the problem at hand is older xbyak have an incomplete interpretation of CPUID leaves, where leaf 0x8000_001D is assumed to be meaningful even if TopologyExtensions is not set. somewhat funnily, that implementation cites ZenDNN extending its then-vendored-fork of xbyak which is where this ignoring TopologyExtensions stuff seems to have come up.
with a cleared TopologyExtensions and all-zero 8000_001D, the guest reads our zeroes as the cache topology instead of what we intended in https://github.com/oxidecomputer/propolis/issues/1152. then xbyak and forks conclude all the caches have size (0+1) * (0+1) * (0+1) * (0+1) times the number of cores sharing that cache which, you guessed it, is also 1 - well, numCores_[*] would be 0, then eax is 0, which where the "cores sharing cache" field is zero-based, so add 1 for the effective value. then with the knowledge that the L1 cache is "one byte", it seems like the jitted code in oneDNN ends up doing something wrong - I don't really understand the details here - and results in numerically incorrect results rather than an explicit failure. this seems like a bug in oneDNN which probably still exists, but probably is only reachable if you're doing "interesting" things around CPUID bits.
more recent xbyak has a reworked cache topology detection which is still interpreting the leaves we offer in AmdTurin/AmdTurinV2 incorrectly, but in a way that does not produce the same incorrect outputs. we offer an extended CPUID leaf limit of 0x80000021, which is above the 0x8000001D threshold in the source. taking this as truth, ignoring the non-presence of TopologyExtensions, xbyak tries to walk the 0x8000_001D subleaves, finds the first leaf reports a null cache, and returns with dataCacheLevels_ == 0 (and the array of sizes all zeroes). so when PyTorch 2.11 and later which produce correct results, it's because oneDNN per_core_cache_size() has a fallback for the case of "zero cache levels" which picks a normal cache size.
what we ought to do here is probably an AmdTurinV3 that repeats the cache layout in 8000_0008 into 8000_001D leaves, regardless of TopologyExtensions being set or not. then, when we're picking what CPUID leaves need specialization (propolis#1237 will get this configurable in the propolis-server API) we'll have to flip on the TopologyExtensions bit and fill in cores as appropriate.
the radius of affected software is kind of everything built on oneDNN/ZenDNN - there's PyTorch of course, TensorFlow, OpenVINO, and I'm sure a bunch of other related software (for example, software that links oneDNN as part of an end-user application, rather than in service of TensorFlow in a data pipeline or something). so this is pretty unfortunate.
- Lenguaje dominante
- Rust
- Estrellas
- 326
- Forks
- 49
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 10
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 oxidecomputer/propolis
-
development
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
oxidecomputer/propolis#1157 ·
Los mantenedores suelen responder en 1 día
-
enhancement storage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
oxidecomputer/propolis#1011 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 1-2 días Aptitud para principiantes 35/100
oxidecomputer/propolis#1265 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
oxidecomputer/propolis#1261 ·
Los mantenedores suelen responder en 1 día
-
development
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
oxidecomputer/propolis#1259 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de oxidecomputer/propolis
Issues similares
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copiedAbiertounconfirmed possible issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jerney-nexus/epikrise#364 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Yeachan-Heo/gajae-code#8058 ·
Los mantenedores suelen responder en 1 día
-
bug daemon
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día