Skip to content

Commit a4dfe72

Browse files
bopeng1234troy818
authored andcommitted
Use uv tool for isolate cicd env of each sample from system conda environment, including samples:
1.Features-and-Functionality/IntelPython_daal4py_DistributedLinearRegression 2.Features-and-Functionality/IntelPython_Numpy_Numba_dpnp_kNN 3.Features-and-Functionality/IntelPyTorch_GPU_InferenceOptimization_with_AMP 4.Features-and-Functionality/IntelTensorFlow_TextGeneration_with_LSTM 5.Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted 6.Getting-Started-Samples/Modin_Vs_Pandas Signed-off-by: troy818 <[email protected]>
1 parent b817a0d commit a4dfe72

File tree

6 files changed

+71
-33
lines changed
  • AI-and-Analytics
    • Features-and-Functionality
    • Getting-Started-Samples

6 files changed

+71
-33
lines changed

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/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"

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_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/Getting-Started-Samples/Intel_Extension_For_TensorFlow_GettingStarted/sample.json

+22-9
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,36 @@
1414
"linux": [{
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
17+
"conda activate base",
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 run ipython kernel install --user --name=tensorflow",
25+
"uv run ipython kernel install --user --name=tensorflow-gpu",
26+
1727
"conda activate tensorflow",
18-
"pip install -r requirements.txt --no-deps",
19-
"pip install tensorflow==2.15.0.post1",
20-
"pip install jupyter ipykernel",
21-
"python -m ipykernel install --user --name=tensorflow",
28+
"pip install uv notebook",
2229
"conda deactivate",
2330
"conda activate tensorflow-gpu",
24-
"pip install -r requirements.txt --no-deps",
25-
"pip install tensorflow==2.15.0.post1",
26-
"pip install jupyter ipykernel",
27-
"python -m ipykernel install --user --name=tensorflow-gpu",
31+
"pip install uv notebook",
2832
"conda deactivate"
2933
],
3034
"id": "itex_sample_test",
3135
"steps": [
3236
"conda activate tensorflow",
33-
"jupyter nbconvert --to notebook --execute ResNet50_Inference.ipynb"
37+
"uv python pin $(which python)",
38+
"uv venv --system-site-packages",
39+
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook --execute ResNet50_Inference.ipynb --output ResNet50_Inference.nbcovert.cpu.ipynb",
40+
"conda deactivate",
41+
42+
"conda activate tensorflow-gpu",
43+
"uv python pin $(which python)",
44+
"uv venv --system-site-packages",
45+
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow-gpu --to notebook --execute ResNet50_Inference.ipynb --output ResNet50_Inference.nbcovert.gpu.ipynb",
46+
"conda deactivate"
3447
]
3548
}]
3649
},

AI-and-Analytics/Getting-Started-Samples/Modin_Vs_Pandas/sample.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@
1414
"id": "modin_pandas_performance",
1515
"steps": [
1616
"source /intel/oneapi/intelpython/bin/activate",
17-
"pip install numpy pandas modin[all]",
18-
"pip install jupyter ipykernel",
19-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --to notebook Modin_Vs_Pandas.ipynb"
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 numpy pandas modin[all]",
23+
"uv add --dev ipykernel",
24+
"uv run ipython kernel install --user --name modin_vs_pandas",
25+
"uv add notebook",
26+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --to notebook Modin_Vs_Pandas.ipynb"
2027
]
2128
}]
2229
},

0 commit comments

Comments
 (0)