Skip to content

Commit c2a2566

Browse files
committed
Add uv support for sample ci validation
Signed-off-by: Xu, He <he.xu@intel.com>
1 parent 196ced4 commit c2a2566

File tree

8 files changed

+45
-23
lines changed

8 files changed

+45
-23
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"uv python pin $(which python)",
2121
"uv venv --system-site-packages",
2222
"uv add -r requirements.txt",
23-
"uv add --dev ipykernel",
23+
"uv add --dev ipykernel notebook",
2424
"uv run ipython kernel install --user --name pytorch",
2525
"python pytorch_training_avx512_bf16.py",
2626
"python pytorch_training_amx_bf16.py",
27-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
27+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
2828
]
2929
}
3030
]

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

Lines changed: 10 additions & 5 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 12 additions & 5 deletions
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
},
Lines changed: 6 additions & 6 deletions
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

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@
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",
24+
"uv run huggingface-cli download Intel/neural-chat-7b-v3-1"
1825
],
1926
"id": "itrex_quantize_transformer_models",
2027
"steps": [
21-
"python quantize_transformer_models_with_itrex.py --model_name \"Intel/neural-chat-7b-v3-1\" --quantize \"int4\" --max_new_tokens 50"
28+
"uv run python quantize_transformer_models_with_itrex.py --model_name \"Intel/neural-chat-7b-v3-1\" --quantize int4 --max_new_tokens 50"
2229
]
2330
}]
2431
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"conda activate pytorch",
1616
"pip install uv",
1717
"uv init",
18-
"uv add --dev ipykernel",
18+
"uv add --dev ipykernel notebook",
1919
"uv python pin $(which python)",
2020
"uv venv --system-site-packages",
2121
"uv add -r requirements.txt",
2222
"uv run ipython kernel install --user --name pytorch"
2323
],
2424
"id": "quantize with inc",
2525
"steps": [
26-
"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"
2727
]
2828
}
2929
]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"uv init",
2020
"uv python pin $(which python)",
2121
"uv venv --system-site-packages",
22-
"uv add -r requirements.txt"
22+
"uv add -r requirements.txt",
2323
"uv add numpy==1.26.4"
2424
],
2525
"id": "idp_d4p_GS_py",

0 commit comments

Comments
 (0)