Skip to content

Commit 85eded7

Browse files
committed
Merge branch 'main' into main-public
2 parents 2822c2a + c19ff26 commit 85eded7

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

notebooks/performance/hf_text_classification_performance.ipynb

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,22 @@
8787
"outputs": [],
8888
"source": [
8989
"# Get and display CPU/platform information\n",
90-
"cpu_info = CPUInfo()\n",
91-
"platform_util = PlatformUtil()\n",
92-
"print(\"{0} CPU Information {0}\".format(\"=\" * 20))\n",
93-
"print(\"CPU family:\", platform_util.cpu_family)\n",
94-
"print(\"CPU model:\", platform_util.cpu_model)\n",
95-
"print(\"CPU type:\", platform_util.cpu_type)\n",
96-
"print(\"Physical cores per socket:\", cpu_info.cores_per_socket)\n",
97-
"print(\"Total physical cores:\", cpu_info.cores)\n",
98-
"cpufreq = psutil.cpu_freq()\n",
99-
"print(\"Max Frequency:\", cpufreq.max)\n",
100-
"print(\"Min Frequency:\", cpufreq.min)\n",
101-
"cpu_socket_count = cpu_info.sockets\n",
102-
"print(\"Socket Number:\", cpu_socket_count)\n",
90+
"try:\n",
91+
" cpu_info = CPUInfo()\n",
92+
" platform_util = PlatformUtil()\n",
93+
" print(\"{0} CPU Information {0}\".format(\"=\" * 20))\n",
94+
" print(\"CPU family:\", platform_util.cpu_family)\n",
95+
" print(\"CPU model:\", platform_util.cpu_model)\n",
96+
" print(\"CPU type:\", platform_util.cpu_type)\n",
97+
" print(\"Physical cores per socket:\", cpu_info.cores_per_socket)\n",
98+
" print(\"Total physical cores:\", cpu_info.cores)\n",
99+
" cpufreq = psutil.cpu_freq()\n",
100+
" print(\"Max Frequency:\", cpufreq.max)\n",
101+
" print(\"Min Frequency:\", cpufreq.min)\n",
102+
" cpu_socket_count = cpu_info.sockets\n",
103+
" print(\"Socket Number:\", cpu_socket_count)\n",
104+
"except Exception as e:\n",
105+
" print(\"Warning, Unable to parse CPU information. It is recommended to use a Xeon machine. Without a Xeon machine, behavior is unknown\")\n",
103106
"\n",
104107
"print(\"\\n{0} Memory Information {0}\".format(\"=\" * 20))\n",
105108
"svmem = psutil.virtual_memory()\n",
@@ -112,7 +115,7 @@
112115
"\n",
113116
"# Display PyTorch version information\n",
114117
"print(\"\\n{0} PyTorch Information {0}\".format(\"=\" * 20))\n",
115-
"print(\"PyTorch version:\", torch.__version__)"
118+
"print(\"PyTorch version:\", torch.__version__)\n"
116119
]
117120
},
118121
{
@@ -810,7 +813,7 @@
810813
"name": "python",
811814
"nbconvert_exporter": "python",
812815
"pygments_lexer": "ipython3",
813-
"version": "3.10.6"
816+
"version": "3.9.17"
814817
}
815818
},
816819
"nbformat": 4,

notebooks/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ tensorflow-hub==0.15.0
3131
torch==1.13.1
3232
torchvision==0.14.1
3333
transformers==4.34.0
34-
urllib3==2.0.6
34+
urllib3==2.0.7
3535
evaluate==0.4.0
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[
22
[{
33
"cpu_id": 0,
4-
"node_id": 0,
5-
"socket_id": -1
4+
"node_id": -1,
5+
"socket_id": 0
66
}],
77
[{
88
"cpu_id": 1,
9-
"node_id": 1,
10-
"socket_id": -1
9+
"node_id": -1,
10+
"socket_id": 1
1111
}],
1212
[{
1313
"cpu_id": 2,
14-
"node_id": 2,
15-
"socket_id": -1
14+
"node_id": -1,
15+
"socket_id": 2
1616
}],
1717
[{
1818
"cpu_id": 3,
19-
"node_id": 3,
20-
"socket_id": -1
19+
"node_id": -1,
20+
"socket_id": 3
2121
}]
2222
]

tlt/utils/platform_util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ def _sort_membind_info(membind_bind_info):
103103
for entry in membind_bind_info:
104104
cpu_id = int(entry[0])
105105
core_id = int(entry[1])
106-
node_id = int(entry[2])
106+
socket_id = int(entry[2])
107107
# On a machine where there is no NUMA nodes, entry[3] could be empty, so set socket_id = -1
108108
if entry[3] != "":
109-
socket_id = int(entry[3])
109+
node_id = int(entry[3])
110110
else:
111-
socket_id = -1
111+
node_id = -1
112112

113113
# Skip nodes other than current node number
114-
if node_number != node_id:
114+
if node_number != socket_id:
115115
continue
116116

117117
# Add core info

0 commit comments

Comments
 (0)