Skip to content

Commit 767bc89

Browse files
authored
Uv conversion getting started (#3)
* uv for getting_started_with_intel_neural_compressor_for_quantization * install uv on getting_started_with_intel_neural_compressor_for_quantization * uv for intel_neural_compressor_accelerate_inference_with_intel_optimization_for_tensorflow * uv for intel_extension_for_scikit_learn_getting_started * Addin toml for intel_extension_for_tensorflow_getting_started * uv for intel_extension_for_tensorflow_getting_started
1 parent 5c2fab8 commit 767bc89

File tree

13 files changed

+10216
-55
lines changed

13 files changed

+10216
-55
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[project]
2+
name = "getting_started_with_intel_neural_compressor_for_quantization"
3+
version = "0.1.0"
4+
description = "This sample is a getting started guide for Intel® Neural Compressor to do INT8 quantization on a Huggingface BERT model. This allows us to achieve performance boosts on Intel hardware."
5+
authors = [
6+
{name = "Copyright © 2023 Intel Corporation"}
7+
]
8+
license = {text = "MIT"}
9+
readme = "README.MD"
10+
requires-python = ">=3.11.11"
11+
dependencies = [
12+
"datasets>=3.3.2",
13+
"intel-extension-for-pytorch==2.5.0",
14+
"neural-compressor==2.1",
15+
"torch==2.5.0",
16+
"transformers>=4.49.0",
17+
]
18+
19+
[tool.uv.sources]
20+
torch = { index = "pytorch" }
21+
22+
[dependency-groups]
23+
dev = [
24+
"ipykernel>=6.29.5",
25+
"jupyter>=1.1.1",
26+
]
27+
28+
[[tool.uv.index]]
29+
url = "https://software.repos.intel.com/python/pypi"
30+
31+
[[tool.uv.index]]
32+
name = "pytorch"
33+
# Required URL for the index.
34+
url = "https://download.pytorch.org/whl/cpu"
35+
explicit = true
36+

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
"linux": [
1212
{
1313
"env": ["apt-get update && apt-get install -y libgl1 libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6",
14-
"source /intel/oneapi/intelpython/bin/activate",
15-
"conda activate pytorch",
16-
"pip install -r requirements.txt",
17-
"pip install ipykernel jupyter",
18-
"python -m ipykernel install --user --name=pytorch"
14+
"pip install uv==0.6.3",
15+
"uv sync",
16+
"uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=pytorch-inc"
1917
],
2018
"id": "quantize with inc",
2119
"steps": [
22-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook quantize_with_inc.ipynb"
20+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch-inc --to notebook quantize_with_inc.ipynb"
2321
]
2422
}
2523
]

AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch/uv.lock

Lines changed: 2976 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[project]
2+
name = "intel_neural_compressor_accelerate_inference_with_intel_optimization_for_tensorflow"
3+
version = "0.1.0"
4+
description = "This sample illustrates how to run Intel® Neural Compressor to quantize the FP32 model trained by Keras on Tensorflow to INT8 model to speed up the inference."
5+
authors = [
6+
{name = "Copyright © 2023 Intel Corporation"}
7+
]
8+
license = {text = "MIT"}
9+
readme = "README.md"
10+
requires-python = ">=3.11"
11+
dependencies = [
12+
"intel-extension-for-tensorflow[cpu]==2.15",
13+
"matplotlib>=3.10.1",
14+
"neural-compressor==3.1.1",
15+
]
16+
17+
[dependency-groups]
18+
dev = [
19+
"ipykernel>=6.29.5",
20+
"jupyter>=1.1.1",
21+
]

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
"ciTests": {
1212
"linux": [
1313
{
14-
"env": ["source /intel/oneapi/intelpython/bin/activate",
15-
"conda activate tensorflow",
16-
"conda install -n tensorflow -c conda-forge python-flatbuffers -y",
17-
"conda install -n tensorflow -c https://software.repos.intel.com/python/conda/ -c conda-forge neural-compressor -y",
18-
"conda install -n tensorflow -y",
19-
"pip install jupyter ipykernel",
20-
"python -m ipykernel install --user --name=tensorflow"
14+
"env": [
15+
"pip install uv==0.6.3",
16+
"uv sync",
17+
"uv run ipython kernel install --user --env VIRTUAL_ENV $(pwd)/.venv --name=tensorflow-inc-quantize"
2118
],
2219
"id": "neural-compressor tensorflow",
2320
"steps": [
24-
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow --to notebook inc_sample_tensorflow.ipynb"
21+
"uv run jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=tensorflow-inc-quantize --to notebook inc_sample_tensorflow.ipynb"
2522
]
2623
}
2724
]

AI-and-Analytics/Getting-Started-Samples/INC-Sample-for-Tensorflow/uv.lock

Lines changed: 2513 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[project]
2+
name = "intel_extension_for_scikit_learn_getting_started"
3+
version = "0.1.0"
4+
description= "This sample illustrates how to do Image classification using SVM classifier from Python API package SKlearnex with the use of Intel® oneAPI Data Analytics Library (oneDAL)."
5+
authors = [
6+
{name = "Copyright © 2023 Intel Corporation"}
7+
]
8+
license = {text = "MIT"}
9+
readme = "README.md"
10+
requires-python = ">=3.11"
11+
dependencies = [
12+
"joblib>=1.4.2",
13+
"matplotlib>=3.10.1",
14+
"scikit-learn==1.5.2",
15+
"scikit-learn-intelex>=2025.2.0",
16+
]
17+
18+
[dependency-groups]
19+
dev = [
20+
"ipykernel>=6.29.5",
21+
"jupyter>=1.1.1",
22+
]

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
"ciTests": {
1414
"linux": [{
1515
"env": [
16-
"source /intel/oneapi/intelpython/bin/activate",
17-
"conda activate base",
18-
"pip install -r requirements.txt"
16+
"pip install uv==0.6.3",
17+
"uv sync"
1918
],
2019
"id": "idp_sklex_gs_py",
2120
"steps": [
22-
"python Intel_Extension_For_SKLearn_GettingStarted.py"
21+
"uv run Intel_Extension_For_SKLearn_GettingStarted.py"
2322
]
2423
}]
2524
},

0 commit comments

Comments
 (0)