Skip to content

Commit 3b2414b

Browse files
hexu33troy818
authored andcommitted
Use uv tool for isolate cicd env
1.AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem 2.AI-and-Analytics/Features-and Functionality/INC_QuantizationAwareTraining_TextClassification 3.AI-and-Analytics/Features-and-Functionality/Intel_Extension_For_SKLearn_Performance_SVC_Adult 4.AI-and-Analytics/Features-and-Functionality/IntelPython_daal4py_DistributedKMeans 5.AI-and-Analytics/Features-and-Functionality/IntelPython_daal4py_DistributedLinearRegression 6.AI-and-Analytics/Features-and-Functionality/IntelPython_GPU_dpnp_Genetic_Algorithm 7.AI-and-Analytics/Features-and-Functionality/IntelPython_Numpy_Numba_dpnp_kNN 8.AI-and-Analytics/Features-and-Functionality/IntelPython_XGBoost_Performance 9.AI-and-Analytics/Features-and-Functionality/IntelPyTorch_GPU_InferenceOptimization_with_AMP 10.AI-and-Analytics/Features-and-Functionality/IntelPyTorch_TrainingOptimizations_AMX_BF16 11.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Inference 12.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_AMX_BF16_Training 13.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_Enabling_Auto_Mixed_Precision_for_TransferLearning 14.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_for_LLMs 15.AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_TextGeneration_with_LSTM 16.AI-and-Analytics/Features-and-Functionality/IntelTransformers_Quantization 17.AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch 18.AI-and-Analytics/Getting-Started-Samples/INC-Sample-for-Tensorflow 19.AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_SKLearn_GettingStarted 20.AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted 21.AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted 22.AI-and-Analytics/Getting-Started-Samples/IntelPython_XGBoost_GettingStarted 23.AI-and-Analytics/Getting-Started-Samples/Modin_GettingStarted 24.AI-and-Analytics/Getting-Started-Samples/Modin_Vs_Pandas Signed-off-by: Xu, He <[email protected]>
1 parent 399c2a9 commit 3b2414b

File tree

29 files changed

+258
-116
lines changed

29 files changed

+258
-116
lines changed

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/JobRecommendationSystem.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@
904904
"metadata": {},
905905
"outputs": [],
906906
"source": [
907+
"import numpy as np\n",
907908
"import intel_extension_for_tensorflow as itex\n",
908909
"\n",
909910
"itex.experimental_ops_override()"

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/JobRecommendationSystem.py

+1
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ def lemmatize_text(text):
428428
# Now, let us import Intel Extension for TensorFlow*. We are using Python API `itex.experimental_ops_override()`. It automatically replace some TensorFlow operators by Custom Operators under `itex.ops` namespace, as well as to be compatible with existing trained parameters.
429429

430430
# %%
431+
import numpy as np
431432
import intel_extension_for_tensorflow as itex
432433

433434
itex.experimental_ops_override()

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/sample.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
"id": "JobRecommendationSystem_py",
1616
"steps": [
1717
"source /intel/oneapi/intelpython/bin/activate",
18-
"conda env remove -n user_tensorflow-gpu",
19-
"conda create --name user_tensorflow-gpu --clone tensorflow-gpu",
20-
"conda activate user_tensorflow-gpu",
21-
"pip install -r requirements.txt",
22-
"python -m ipykernel install --user --name=user_tensorflow-gpu",
23-
"python JobRecommendationSystem.py"
18+
"conda activate tensorflow-gpu",
19+
"pip install uv",
20+
"uv init",
21+
"uv python pin $(which python)",
22+
"uv venv --system-site-packages",
23+
"uv add -r requirements.txt",
24+
"uv add seaborn",
25+
"uv add numpy==1.26.4",
26+
"uv run python -m spacy download en_core_web_sm",
27+
"uv run python JobRecommendationSystem.py"
2428
]
2529
}
2630
]

AI-and-Analytics/Features-and-Functionality/INC_QuantizationAwareTraining_TextClassification/sample.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
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 torch==2.5.0 torchvision==0.20.0"
1823
],
1924
"id": "inc_text_classification_quantization_py",
2025
"steps": [
21-
"python INC_QuantizationAwareTraining_TextClassification.py"
26+
"uv run INC_QuantizationAwareTraining_TextClassification.py"
2227
]
2328
}
2429
]

AI-and-Analytics/Features-and-Functionality/IntelPyTorch_GPU_InferenceOptimization_with_AMP/sample.json

+10-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
"id": "intel pytorch gpu inference optimization with amp",
1515
"steps": [
1616
"source /intel/oneapi/intelpython/bin/activate",
17-
"source activate pytorch-gpu",
18-
"pip install -r requirements.txt",
19-
"pip install jupyter ipykernel",
20-
"python -m ipykernel install --user --name=pytorch-gpu",
21-
"python IntelPyTorch_GPU_InferenceOptimization_with_AMP.py"
17+
"conda activate pytorch-gpu",
18+
"pip install uv notebook",
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 --dev ipykernel",
25+
"uv run ipython kernel install --user --name=pytorch-gpu",
26+
"uv run IntelPyTorch_GPU_InferenceOptimization_with_AMP.py"
2227
]
2328
}
2429
]

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
]

AI-and-Analytics/Features-and-Functionality/IntelPython_GPU_dpnp_Genetic_Algorithm/sample.json

+12-8
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@
99
"os":["linux"],
1010
"targetDevice": ["GPU"],
1111
"ciTests": {
12-
"linux": [
12+
"linux": [
1313
{
14-
"env": [
14+
"env": [
1515
"source /intel/oneapi/intelpython/bin/activate",
1616
"conda activate base",
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"
1822
],
19-
"id": "idp_ga_dpnp_py",
20-
"steps": [
21-
"python IntelPython_GPU_dpnp_Genetic_Algorithm.py"
22-
]
23-
}
23+
"id": "idp_ga_dpnp_py",
24+
"steps": [
25+
"uv run python IntelPython_GPU_dpnp_Genetic_Algorithm.py"
26+
]
27+
}
2428
]
2529
},
2630
"expertise": "Code Optimization"

AI-and-Analytics/Features-and-Functionality/IntelPython_Numpy_Numba_dpnp_kNN/sample.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
"env": [
1515
"source /intel/oneapi/intelpython/bin/activate",
1616
"conda activate base",
17-
"pip install numba"
17+
"pip install uv",
18+
"uv init",
19+
"uv python pin $(which python)",
20+
"uv venv --system-site-packages",
21+
"uv add numba"
1822
],
19-
"id": "idp_numpy_numba_dpnp_gs_py",
20-
"steps": [
21-
"python IntelPython_Numpy_Numba_dpnp_kNN.py"
22-
]
23-
}
23+
"id": "idp_numpy_numba_dpnp_gs_py",
24+
"steps": [
25+
"uv run python IntelPython_Numpy_Numba_dpnp_kNN.py"
26+
]
27+
}
2428
]
2529
},
2630
"expertise": "Code Optimization"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
###### Requirements ######
22
notebook
33
matplot
4-
xgboost==0.81
4+
xgboost==0.82
55
scikit-learn
66
pandas

AI-and-Analytics/Features-and-Functionality/IntelPython_XGBoost_Performance/sample.json

+17-10
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@
99
"os":["linux"],
1010
"targetDevice": ["CPU"],
1111
"ciTests": {
12-
"linux": [
12+
"linux": [
1313
{
14-
"id": "idp_xgb_performance",
15-
"steps": [
16-
"source /intel/oneapi/intelpython/bin/activate",
17-
"python IntelPython_XGBoost_Performance.py",
18-
"conda remove xgboost --y",
19-
"pip install -r requirements.txt",
20-
"python IntelPython_XGBoost_Performance.py"
21-
]
22-
}
14+
"env": [
15+
"source /intel/oneapi/intelpython/bin/activate",
16+
"conda activate base"
17+
],
18+
"id": "idp_xgb_performance",
19+
"steps": [
20+
"python IntelPython_XGBoost_Performance.py",
21+
"pip install uv",
22+
"uv init",
23+
"uv python pin $(which python)",
24+
"uv venv --system-site-packages",
25+
"uv add -r requirements.txt",
26+
"uv add numpy==1.26.4",
27+
"uv run python IntelPython_XGBoost_Performance.py"
28+
]
29+
}
2330
]
2431
},
2532
"expertise": "Code Optimization"

AI-and-Analytics/Features-and-Functionality/IntelPython_daal4py_DistributedKMeans/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_KM_Dist",
2126
"steps": [
22-
"mpirun -n 4 python ./IntelPython_daal4py_Distributed_Kmeans.py"
27+
"uv run mpirun -n 4 python ./IntelPython_daal4py_Distributed_Kmeans.py"
2328
]
2429
}]
2530
},

AI-and-Analytics/Features-and-Functionality/IntelPython_daal4py_DistributedLinearRegression/sample.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
"ciTests": {
1414
"linux": [{
1515
"env": [
16-
"source /intel/oneapi/intelpython/bin/activate",
17-
"pip install -r requirements.txt"
16+
"source /intel/oneapi/intelpython/bin/activate",
17+
"conda activate base",
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"
1824
],
1925
"id": "idp_d4p_Linear_Regression_Dist",
2026
"steps": [
21-
"python download_data.py",
22-
"mpirun -n 4 python ./IntelPython_daal4py_Distributed_LinearRegression.py"
27+
"uv run python download_data.py",
28+
"uv run mpirun -n 4 python ./IntelPython_daal4py_Distributed_LinearRegression.py"
2329
]
2430
}]
2531
},

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
]

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
]

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
},

AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_Enabling_Auto_Mixed_Precision_for_TransferLearning/sample.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
"apt-get update && apt-get install tensorflow-model-server",
1818
"source /intel/oneapi/intelpython/bin/activate",
1919
"conda activate tensorflow",
20-
"pip install -r requirements.txt --no-deps",
21-
"pip install tensorflow==2.15.0.post1",
22-
"pip install jupyter ipykernel",
23-
"python -m ipykernel install --user --name=tensorflow"
20+
"pip install uv",
21+
"uv init",
22+
"uv python pin $(which python)",
23+
"uv venv --system-site-packages",
24+
"uv add -r requirements.txt",
25+
"uv add numpy==1.26.4",
26+
"uv add --dev ipykernel",
27+
"uv run ipython kernel install --user --name tensorflow",
28+
"pip install notebook"
2429
],
2530
"id": "tensorflow_AMP_transfer_learning",
2631
"steps": [

AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_TextGeneration_with_LSTM/sample.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@
1414
{
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
17-
"conda env remove -n user_tensorflow-gpu",
18-
"conda create --name user_tensorflow-gpu --clone tensorflow-gpu",
19-
"conda activate user_tensorflow-gpu",
20-
"pip install -r requirements.txt",
21-
"python -m ipykernel install --user --name=user_tensorflow-gpu"
17+
"conda activate tensorflow-gpu",
18+
"pip install uv notebook",
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",
24+
"uv run ipython kernel install --user --name=tensorflow-gpu"
2225
],
2326
"id": "inc_text_generation_lstm_py",
2427
"steps": [
2528
"export ITEX_ENABLE_NEXTPLUGGABLE_DEVICE=0",
26-
"ITEX_NUM_EPOCHS=5 KERAS_NUM_EPOCHS=5 python TextGenerationModelTraining.py"
29+
"ITEX_NUM_EPOCHS=5 KERAS_NUM_EPOCHS=5 uv run TextGenerationModelTraining.py"
2730
]
2831
}
2932
]

AI-and-Analytics/Features-and-Functionality/IntelTensorFlow_for_LLMs/sample.json

+15-6
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@
1010
"cpuInstructionSets": ["AVX512", "AMX"],
1111
"ciTests": {
1212
"linux": [{
13+
"env": [
14+
"source /intel/oneapi/intelpython/bin/activate",
15+
"conda activate tensorflow",
16+
"pip install uv",
17+
"uv init",
18+
"uv python pin $(which python)",
19+
"uv venv --system-site-packages",
20+
"uv add -r requirements.txt",
21+
"uv add py-cpuinfo nbformat nbconvert",
22+
"uv add --dev ipykernel",
23+
"uv run ipython kernel install --user --name tensorflow",
24+
"uv add notebook nbconvert"
25+
],
1326
"id": "intel llm bf16 infrence and fine-tuning",
1427
"steps": [
15-
"source activate tensorflow",
16-
"pip install -r requirements.txt",
17-
"python -m pip install py-cpuinfo",
18-
"python GPTJ_finetuning.py",
19-
"/opt/intel/oneapi/intelpython/latest/envs/tensorflow/bin/python -m ipykernel install --user --name=tensorflow",
20-
"python ci_test.py"
28+
"uv run python GPTJ_finetuning.py",
29+
"uv run python ci_test.py"
2130
]
2231
}]
2332
},
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

0 commit comments

Comments
 (0)