Skip to content

Commit 5b8d629

Browse files
committed
Add: Enter training time for BF16 using AVX512
Update IntelPyTorch training notebook to include environment variable settings for AVX512 and BF16 optimizations Signed-off-by: Francisco R Castro G <[email protected]> Signed-off-by: jafraustro <[email protected]>
1 parent 9f19833 commit 5b8d629

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

AI-and-Analytics/Features-and-Functionality/IntelPyTorch_TrainingOptimizations_AMX_BF16/IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -254,29 +254,20 @@
254254
"outputs": [],
255255
"source": [
256256
"print(\"Training model with FP32\")\n",
257+
"os.environ[\"ONEDNN_MAX_CPU_ISA\"] = \"AVX512_CORE_AMX\"\n",
257258
"fp32_training_time = trainModel(train_loader, modelName=\"fp32\", dataType=\"fp32\")"
258259
]
259260
},
260-
{
261-
"cell_type": "code",
262-
"execution_count": null,
263-
"id": "75aafe25-4f7d-42ad-92ed-3438bd78c00b",
264-
"metadata": {},
265-
"outputs": [],
266-
"source": [
267-
"print(\"Training model with BF16 with AVX512\")\n",
268-
"!python pytorch_training_avx512_bf16.py"
269-
]
270-
},
271261
{
272262
"cell_type": "code",
273263
"execution_count": null,
274264
"id": "a9bd6dec",
275265
"metadata": {},
276266
"outputs": [],
277267
"source": [
278-
"# Record the training time for BF16 using AVX512\n",
279-
"bf16_avx512_training_time = None #TODO: enter in training time"
268+
"print(\"Training model with BF16 with AVX512\")\n",
269+
"os.environ[\"ONEDNN_MAX_CPU_ISA\"] = \"AVX512_CORE_BF16\"\n",
270+
"bf16_avx512_training_time = trainModel(train_loader, modelName=\"bf16_noAmx\", dataType=\"bf16\")"
280271
]
281272
},
282273
{
@@ -287,6 +278,7 @@
287278
"outputs": [],
288279
"source": [
289280
"print(\"Training model with BF16 with Intel® AMX\")\n",
281+
"os.environ[\"ONEDNN_MAX_CPU_ISA\"] = \"AVX512_CORE_AMX\"\n",
290282
"bf16_amx_training_time = trainModel(train_loader, modelName=\"bf16_withAmx\", dataType=\"bf16\")"
291283
]
292284
},
@@ -391,9 +383,9 @@
391383
],
392384
"metadata": {
393385
"kernelspec": {
394-
"display_name": "Python 3.8.10 64-bit (microsoft store)",
386+
"display_name": "pytorch",
395387
"language": "python",
396-
"name": "python3"
388+
"name": "pytorch"
397389
},
398390
"language_info": {
399391
"codemirror_mode": {
@@ -405,7 +397,7 @@
405397
"name": "python",
406398
"nbconvert_exporter": "python",
407399
"pygments_lexer": "ipython3",
408-
"version": "3.8.10"
400+
"version": "3.11.0"
409401
},
410402
"vscode": {
411403
"interpreter": {

0 commit comments

Comments
 (0)