| diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl |
| index 9e15c75c183..e5b14ed6622 100644 |
| --- a/tensorflow/workspace2.bzl |
| +++ b/tensorflow/workspace2.bzl |
| @@ -173,6 +173,7 @@ def _tf_repositories(): |
| tf_http_archive( |
| name = "cpuinfo", |
| strip_prefix = "cpuinfo-ef634603954d88d2643d5809011288b890ac126e", |
| + patch_file = ["//third_party:cpuinfo.patch"], |
| sha256 = "e07512a11e1c71687359a133f49d60583d7465b737fe5dbe11f461c9aaa72a2b", |
| urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/ef634603954d88d2643d5809011288b890ac126e.zip"), |
| ) |
| diff --git a/third_party/cpuinfo.patch b/third_party/cpuinfo.patch |
| new file mode 100644 |
| index 00000000000..290947ed64d |
| --- /dev/null |
| +++ b/third_party/cpuinfo.patch |
| @@ -0,0 +1,16 @@ |
| +diff --git a/src/x86/init.c b/src/x86/init.c |
| +index 244359c..653f1ee 100644 |
| +--- a/src/x86/init.c |
| ++++ b/src/x86/init.c |
| +@@ -38,8 +38,10 @@ void cpuinfo_x86_init_processor(struct cpuinfo_x86_processor* processor) { |
| + /* |
| + * Topology extensions support: |
| + * - AMD: ecx[bit 22] in extended info (reserved bit on Intel CPUs). |
| ++ * Relax the condition a bit for Excavator, see b/305999585#comment11 for more details. |
| + */ |
| +- const bool amd_topology_extensions = !!(leaf0x80000001.ecx & UINT32_C(0x00400000)); |
| ++ const bool amd_topology_extensions = |
| ++ !!(leaf0x80000001.ecx & UINT32_C(0x00400000)) || uarch == cpuinfo_uarch_excavator; |
| + |
| + cpuinfo_x86_detect_cache( |
| + max_base_index, max_extended_index, amd_topology_extensions, vendor, &model_info, |