guests read CPUID leaf 8000_001d even without TopologyExtensions
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Rust
- 星标
- 326
- 派生
- 49
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 10
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oxidecomputer/propolis 的其他 Issue
-
development
难度 2/5 1-3 小时 新手友好度 68/100
oxidecomputer/propolis#1157 ·
维护者通常 1 天内回复
-
enhancement storage
难度 2/5 1-3 小时 新手友好度 66/100
oxidecomputer/propolis#1011 · 3 条评论 ·
维护者通常 1 天内回复
-
bug
难度 4/5 1-2 天 新手友好度 35/100
oxidecomputer/propolis#1265 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
oxidecomputer/propolis#1261 ·
维护者通常 1 天内回复
-
development
难度 3/5 1-2 天 新手友好度 55/100
oxidecomputer/propolis#1259 · 1 条评论 ·
维护者通常 1 天内回复
查看 oxidecomputer/propolis 的全部 Issue
相似的 Issue
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copied未关闭unconfirmed possible issue
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
jerney-nexus/epikrise#364 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
Yeachan-Heo/gajae-code#8058 ·
维护者通常 1 天内回复
-
bug daemon
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复