Skip to content

Commit 1ab518d

Browse files
committed
Use uv tool for isolate cicd env of each sample from system conda environment, including samples:
1.AI-and-Analytics/Features-and-Functionality/INC_QuantizationAwareTraining_TextClassification 2.AI-and-Analytics/Features-and-Functionality/IntelPyTorch_TrainingOptimizations_AMX_BF16 3.AI-and-Analytics/Features-and-Functionality/IntelPython_daal4py_DistributedLinearRegression 4.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Inference 5.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Training 6.AI-and-Analytics/Features-and-Functionality/IntelTransformers_Quantization 7.AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch 8.AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted Signed-off-by: Xu, He <[email protected]>
1 parent b817a0d commit 1ab518d

File tree

8 files changed

+64
-29
lines changed

8 files changed

+64
-29
lines changed

Diff for: AI-and-Analytics/Features-and-Functionality/IntelPyTorch_TrainingOptimizations_AMX_BF16/sample.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
"steps": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate pytorch",
18-
"python -m pip install -r requirements.txt",
19-
"python -m ipykernel install --user --name=pytorch",
20-
"python pytorch_training_avx512_bf16.py",
21-
"python pytorch_training_amx_bf16.py",
22-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
18+
"pip install uv",
19+
"uv init",
20+
"uv python pin $(which python)",
21+
"uv venv --system-site-packages",
22+
"uv add -r requirements.txt",
23+
"uv add --dev ipykernel notebook",
24+
"uv run ipython kernel install --user --name pytorch",
25+
"uv run python pytorch_training_avx512_bf16.py",
26+
"uv run python pytorch_training_amx_bf16.py",
27+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
2328
]
2429
}
2530
]

Diff for: AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Inference/sample.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
"steps": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate tensorflow",
18-
"pip install -r requirements.txt --no-deps",
19-
"pip install ipykernel jupyter",
20-
"python Intel_TensorFlow_AMX_BF16_Inference.py",
21-
"python -m ipykernel install --user --name=tensorflow",
22-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook IntelTensorFlow_AMX_BF16_Inference.ipynb"
18+
"pip install uv",
19+
"uv init",
20+
"uv python pin $(which python)",
21+
"uv venv --system-site-packages",
22+
"uv add -r requirements.txt",
23+
"uv add numpy==1.26.4",
24+
"uv add ipykernel jupyter notebook",
25+
"uv run python Intel_TensorFlow_AMX_BF16_Inference.py",
26+
"uv run python -m ipykernel install --user --name=tensorflow",
27+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow2 --to notebook IntelTensorFlow_AMX_BF16_Inference.ipynb"
2328
]
2429
}
2530
]

Diff for: AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Training/IntelTensorFlow_AMX_BF16_Training.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959
"is_tune_model = True # or False\n",
6060
"log_dir = \"logs\"\n",
6161
"profiling_needed = False\n",
62+
"execution_mode_param = os.getenv('execution_mode')\n",
6263
"execution_mode = \"graph\"\n",
64+
"if execution_mode_param == \"eager\":\n",
65+
" execution_mode = \"eager\"\n",
6366
"load_weights_dir = \"weights\"\n",
6467
"save_weights_dir = \"weights\""
6568
]

Diff for: AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Training/sample.json

+12-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@
1414
"steps": [
1515
"source /intel/oneapi/intelpython/bin/activate",
1616
"conda activate tensorflow",
17-
"pip install -r requirements.txt",
18-
"pip install jupyter ipykernel",
19-
"python Intel_TensorFlow_AMX_BF16_Training.py",
20-
"python -m ipykernel install --user --name=tensorflow",
21-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook IntelTensorFlow_AMX_BF16_Training.ipynb"
17+
"pip install uv",
18+
"uv init",
19+
"uv python pin $(which python)",
20+
"uv venv --system-site-packages",
21+
"uv add -r requirements.txt",
22+
"uv add --dev ipykernel notebook",
23+
"uv add numpy==1.26.4",
24+
"uv add keras==2.15.0",
25+
"export execution_mode=eager",
26+
"uv run python Intel_TensorFlow_AMX_BF16_Training.py -m eager",
27+
"uv run ipython kernel install --user --name tensorflow",
28+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook IntelTensorFlow_AMX_BF16_Training.ipynb"
2229
]
2330
}]
2431
},
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
accelerate==0.29.3
2-
datasets==2.09.0
3-
intel-extension-for-transformers==1.4.1
4-
neural_speed==1.0
5-
peft==0.10.0
1+
accelerate
2+
datasets
3+
intel-extension-for-transformers
4+
neural_speed
5+
peft
66
sentencepiece
7-
transformers==4.38.0
7+
transformers

Diff for: AI-and-Analytics/Features-and-Functionality/IntelTransformers_Quantization/sample.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414
"env": [
1515
"source /intel/oneapi/intelpython/bin/activate",
1616
"conda activate pytorch",
17-
"pip install -r requirements.txt"
17+
"pip install uv",
18+
"uv init",
19+
"uv python pin $(which python)",
20+
"uv venv --system-site-packages",
21+
"uv add -r requirements.txt",
22+
"uv add neural-compressor==2.6",
23+
"uv add torch==2.5.0 torchvision==0.20.0"
1824
],
1925
"id": "itrex_quantize_transformer_models",
2026
"steps": [
21-
"python quantize_transformer_models_with_itrex.py --model_name \"Intel/neural-chat-7b-v3-1\" --quantize \"int4\" --max_new_tokens 50"
27+
"uv run python quantize_transformer_models_with_itrex.py --model_name Intel/neural-chat-7b-v3-1 --quantize int4 --max_new_tokens 50"
2228
]
2329
}]
2430
},

Diff for: AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch/sample.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313
"env": ["apt-get update && apt-get install -y libgl1 libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6",
1414
"source /intel/oneapi/intelpython/bin/activate",
1515
"conda activate pytorch",
16-
"pip install -r requirements.txt",
17-
"pip install ipykernel jupyter",
18-
"python -m ipykernel install --user --name=pytorch"
16+
"pip install uv",
17+
"uv init",
18+
"uv add --dev ipykernel notebook",
19+
"uv python pin $(which python)",
20+
"uv venv --system-site-packages",
21+
"uv add -r requirements.txt",
22+
"uv run ipython kernel install --user --name pytorch"
1923
],
2024
"id": "quantize with inc",
2125
"steps": [
22-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook quantize_with_inc.ipynb"
26+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook quantize_with_inc.ipynb"
2327
]
2428
}
2529
]

Diff for: AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted/sample.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate base",
18-
"pip install -r requirements.txt"
18+
"pip install uv",
19+
"uv init",
20+
"uv python pin $(which python)",
21+
"uv venv --system-site-packages",
22+
"uv add -r requirements.txt",
23+
"uv add numpy==1.26.4"
1924
],
2025
"id": "idp_d4p_GS_py",
2126
"steps": [
22-
"python IntelPython_daal4py_GettingStarted.py"
27+
"uv run python IntelPython_daal4py_GettingStarted.py"
2328
]
2429
}]
2530
},

0 commit comments

Comments
 (0)