Skip to content

Commit 8b606a6

Browse files
jkinskyjimmytweikrzeszewalexsin368ZhaoqiongZ
authored
Ai and analytics features and functionality intel python numpy numba dpex k nn (#1424)
* Fixes for 2023.1 AI Kit (#1409) * Intel Python Numpy Numba_dpes kNN sample (#1292) * *.py and *.ipynb files with implementation * README.md and sample.json files with documentation * License and thir party programs * Adding PyTorch Training Optimizations with AMX BF16 oneAPI sample (#1293) * add IntelPytorch Quantization code samples (#1301) * add IntelPytorch Quantization code samples * fix the spelling error in the README file * use john's README with grammar fix and title change * Rename third-party-grograms.txt to third-party-programs.txt Co-authored-by: Jimmy Wei <[email protected]> * AMX bfloat16 mixed precision learning TensorFlow Transformer sample (#1317) * [New Sample] Intel Extension for TensorFlow Getting Started (#1313) * first draft * Update README.md * remove redunant file * [New Sample] [oneDNN] Benchdnn tutorial (#1315) * New Sample: benchDNN tutorial * Update readme: new sample * Rename sample to benchdnn_tutorial * Name fix * Add files via upload (#1320) * [New Sample] oneCCL Bindings for PyTorch Getting Started (#1316) * Update README.md * [New Sample] oneCCL Bindings for PyTorch Getting Started * Update README.md * add torch-ccl version check * [New Sample] Intel Extension for PyTorch Getting Started (#1314) * add new ipex GSG notebook for dGPU * Update sample.json for expertise field * Update requirements.txt Update package versions to comply with Snyk tool * Updated title field in sample.json in TF Transformer AMX bfloat16 Mixed Precision sample to fit within character length range (#1327) * add arch checker class (#1332) * change gpu.patch to convert the code samples from cpu to gpu correctly (#1334) * Fixes for spelling in AMX bfloat16 transformer sample and printing error in python code in numpy vs numba sample (#1335) * 2023.1 ai kit itex get started example fix (#1338) * Fix the typo * Update ResNet50_Inference.ipynb * fix resnet inference demo link (#1339) * Fix printing issue in numpy vs numba AI sample (#1356) * Fix Invalid Kmeans parameters on oneAPI 2023 (#1345) * Update README to add new samples into the list (#1366) * PyTorch AMX BF16 Training sample: remove graphs and performance numbers (#1408) * Adding PyTorch Training Optimizations with AMX BF16 oneAPI sample * remove performance graphs, update README * remove graphs from README and folder * update top README in Features and Functionality --------- Co-authored-by: krzeszew <[email protected]> Co-authored-by: alexsin368 <[email protected]> Co-authored-by: ZhaoqiongZ <[email protected]> Co-authored-by: Louie Tsai <[email protected]> Co-authored-by: Orel Yehuda <[email protected]> Co-authored-by: yuning <[email protected]> Co-authored-by: Wang, Kai Lawrence <[email protected]> Co-authored-by: xiguiw <[email protected]> * IntelPython_Numpy_Numba_dpex_kNN readme update Updated some formatting. Added section on running the python script in local environment and on DevCloud. Extended the DevCloud information with corrected notebook name. Corrected some branding. --------- Co-authored-by: Jimmy Wei <[email protected]> Co-authored-by: krzeszew <[email protected]> Co-authored-by: alexsin368 <[email protected]> Co-authored-by: ZhaoqiongZ <[email protected]> Co-authored-by: Louie Tsai <[email protected]> Co-authored-by: Orel Yehuda <[email protected]> Co-authored-by: yuning <[email protected]> Co-authored-by: Wang, Kai Lawrence <[email protected]> Co-authored-by: xiguiw <[email protected]>
1 parent d094492 commit 8b606a6

File tree

1 file changed

+37
-19
lines changed
  • AI-and-Analytics/Features-and-Functionality/IntelPython_Numpy_Numba_dpex_kNN

1 file changed

+37
-19
lines changed

AI-and-Analytics/Features-and-Functionality/IntelPython_Numpy_Numba_dpex_kNN/README.md

+37-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# `Intel® Python NumPy vs Numba_dpex` Sample
1+
# `Intel® Python NumPy vs numba-dpex` Sample
22

3-
The `Intel® Python NumPy vs Numba_dpex` sample shows how to achieve the same accuracy of the k-NN model classification while using numpy, numba, and numba_dpex.
3+
The `Intel® Python NumPy vs numba-dpex` sample shows how to achieve the same accuracy of the k-NN model classification while using NumPy, Numba, and Data-parallel Extension for Numba* (numba-dpex).
44

55
| Area | Description
66
| :--- | :---
7-
| What you will learn | How to program using numba_dpex
7+
| What you will learn | How to program using the Data-parallel Extension for Numba* (numba-dpex)
88
| Time to complete | 5 minutes
9-
| Category | Component
9+
| Category | Code Optimization
1010

1111
>**Note**: The libraries used in this sample are available in Intel® Distribution for Python* as part of the [Intel® AI Analytics Toolkit (AI Kit)](https://software.intel.com/en-us/oneapi/ai-kit).
1212
1313
## Purpose
1414

15-
In this sample, you will run a k-nearest neighbors algorithm using 3 different Intel® Distribution for Python* libraries: numpy, numba, and numba_dpex. You will learn how to use k-NN model and how to optimize it by numba_dpex operations without sacrificing accuracy.
15+
In this sample, you will run a k-nearest neighbors algorithm using 3 different Intel® Distribution for Python* libraries: NumPy, Numba, and numba-dpex. You will learn how to use k-NN model and how to optimize it by numba-dpex operations without sacrificing accuracy.
1616

1717
## Prerequisites
1818

1919
| Optimized for | Description
2020
|:--- |:---
2121
| OS | Ubuntu* 20.04
2222
| Hardware | CPU
23-
| Software | Intel® AI Analytics Toolkit
23+
| Software | Intel® AI Analytics Toolkit (AI Kit)
2424

2525
### For Local Development Environments
2626

@@ -40,11 +40,11 @@ The necessary tools and components are already installed in the environment. You
4040

4141
## Key Implementation Details
4242

43-
This sample code is implemented for the CPU using Python. The sample assumes you have numba_dpex installed inside a Conda environment, similar to what is installed with the Intel® Distribution for Python*.
43+
This sample code is implemented for the CPU using Python. The sample assumes you have numba-dpex installed inside a Conda environment, similar to what is installed with the Intel® Distribution for Python*.
4444

4545
>**Note**: Read *[Get Started with the Intel® AI Analytics Toolkit for Linux*](https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-ai-linux/top.html)* to find out how you can achieve performance gains for popular deep-learning and machine-learning frameworks through Intel optimizations.
4646
47-
## Run the `Intel® Python NumPy vs Numba_dpex` Sample
47+
## Run the `Intel® Python NumPy vs numba-dpex` Sample
4848

4949
### On Linux*
5050

@@ -73,7 +73,15 @@ This sample code is implemented for the CPU using Python. The sample assumes you
7373
conda activate usr_base
7474
```
7575

76-
#### Run the Jupyter Notebook
76+
#### Run the Python Script
77+
78+
1. Change to the sample directory.
79+
2. Run the script.
80+
```
81+
python IntelPython_Numpy_Numba_dpex_kNN.py
82+
```
83+
84+
#### Run the Jupyter Notebook (Optional)
7785

7886
1. Launch Jupyter Notebook.
7987
```
@@ -90,21 +98,31 @@ This sample code is implemented for the CPU using Python. The sample assumes you
9098

9199
If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the [Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/diagnostic-utility-user-guide/top.html) for more information on using the utility.
92100

93-
### Run the Sample on Intel® DevCloud
101+
### Build and Run the Sample on Intel® DevCloud (Optional)
102+
103+
>**Note**: For more information on using Intel® DevCloud, see the Intel® oneAPI [Get Started](https://devcloud.intel.com/oneapi/get_started/) page.
94104
95-
1. If you do not already have an account, request an Intel® DevCloud account at [*Create an Intel® DevCloud Account*](https://intelsoftwaresites.secure.force.com/DevCloud/oneapi).
96-
2. On a Linux* system, open a terminal.
97-
3. SSH into Intel® DevCloud.
105+
1. Open a terminal on a Linux* system.
106+
2. Log in to the Intel® DevCloud.
98107
```
99-
ssh DevCloud
108+
ssh devcloud
100109
```
101-
> **Note**: You can find information about configuring your Linux system and connecting to Intel DevCloud at Intel® DevCloud for oneAPI [Get Started](https://devcloud.intel.com/oneapi/get_started).
102-
103-
4. Locate and select the Notebook.
110+
3. If the sample is not already available, download the samples from GitHub.
111+
```
112+
git clone https://github.com/oneapi-src/oneAPI-samples.git
104113
```
105-
numba_numpy.ipynb
114+
4. Change to the sample directory.
115+
5. Launch Jupyter Notebook.
116+
6. Locate and select the Notebook.
117+
```
118+
IntelPython_Numpy_Numba_dpex_kNN.ipynb
106119
```
107-
5. Run every cell in the Notebook in sequence.
120+
7. Run every cell in the Notebook in sequence.
121+
8. Review the output.
122+
9. Disconnect from Intel® DevCloud.
123+
```
124+
exit
125+
```
108126

109127
## Example Output
110128

0 commit comments

Comments
 (0)