一句话:修改 uops.info 的端口映射推断算法,使其仅依赖稀疏性能计数器,并用 SMT 驱动的反例引导方法推断 AMD Zen 的端口映射。
乱序 x86-64 CPU 的性能模型需要指令到端口的映射,但 Intel 公开了相关映射,AMD 则缺少信息;标准精确推断方法又依赖 AMD 未提供的硬件性能计数器。本文修改 uops.info 的端口映射推断算法,使其不再依赖 Intel 计数器,而是基于形式化端口映射模型,采用 SMT 求解器驱动的反例引导算法,在稀疏性能计数器下推断映射。作者在 AMD Zen 架构上评估该方法,分析 AMD 处理器对该模型的符合程度,并指出哪些意外性能特征会阻碍准确端口映射。结果为 CPU 性能模型构建者和希望在近期 AMD CPU 上达到峰值性能的开发者提供了洞见。
Performance models are instrumental for optimizing performance-sensitive code. When modeling the use of functional units of out-of-order x86-64 CPUs, data availability varies by the manufacturer: Instruction-to-port mappings for Intel's processors are available, whereas information for AMD's designs are lacking. The reason for this disparity is that standard techniques to infer exact port mappings require hardware performance counters that AMD does not provide. In this work, we modify the port mapping inference algorithm of the widely used uops.info project to not rely on Intel's performance counters. The modifications are based on a formal port mapping model with a counter-example-guided algorithm powered by an SMT solver. We investigate in how far AMD's processors comply with this model and where unexpected performance characteristics prevent an accurate port mapping. Our results provide valuable insights for creators of CPU performance models as well as for software developers who want to achieve peak performance on recent AMD CPUs.