Skip to content

Commit 7b6c5c0

Browse files
authored
Merge pull request #2466 from oneapi-src/release/2024.2_AITools
README updates for 2024.2 AI Tools release
2 parents 495ff2b + 0d8ec9a commit 7b6c5c0

File tree

2 files changed

+87
-16
lines changed
  • AI-and-Analytics/Getting-Started-Samples

2 files changed

+87
-16
lines changed

AI-and-Analytics/Getting-Started-Samples/Intel_oneCCL_Bindings_For_PyTorch_GettingStarted/README.md

+86-15
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
The oneAPI Collective Communications Library Bindings for PyTorch* (oneCCL Bindings for PyTorch*) holds PyTorch bindings maintained by Intel for the Intel® oneAPI Collective Communications Library (oneCCL).
44

5-
| Area | Description
5+
| Property | Description
66
|:--- |:---
7+
| Category | Getting Started
78
| What you will learn | How to get started with oneCCL Bindings for PyTorch*
89
| Time to complete | 60 minutes
910

@@ -34,39 +35,107 @@ The Jupyter Notebook also demonstrates how to change PyTorch* distributed worklo
3435
>- [Intel® oneCCL Bindings for PyTorch*](https://github.com/intel/torch-ccl)
3536
>- [Distributed Training with oneCCL in PyTorch*](https://github.com/intel/optimized-models/tree/master/pytorch/distributed)
3637
38+
## Environment Setup
39+
You will need to download and install the following toolkits, tools, and components to use the sample.
40+
<!-- Use numbered steps instead of subheadings -->
3741

38-
## Run the `oneCCL Bindings for PyTorch* Getting Started` Sample
42+
**1. Get AI Tools**
3943

40-
Go to the section which corresponds to the installation method chosen in [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to see relevant instructions:
41-
* [AI Tools Offline Installer (Validated)](#ai-tools-offline-installer-validated)
42-
* [Docker](#docker)
44+
Required AI Tools: Intel® Extension for PyTorch* - (CPU or GPU)
45+
46+
If you have not already, select and install these Tools via [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html). AI and Analytics samples are validated on AI Tools Offline Installer. It is recommended to select Offline Installer option in AI Tools Selector.
47+
48+
>**Note**: If Docker option is chosen in AI Tools Selector, refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
49+
50+
**2. (Offline Installer) Activate the AI Tools bundle base environment**
4351

44-
### AI Tools Offline Installer (Validated)
45-
1. If you have not already done so, activate the AI Tools bundle base environment. If you used the default location to install AI Tools, open a terminal and type the following
52+
If the default path is used during the installation of AI Tools:
4653
```
4754
source $HOME/intel/oneapi/intelpython/bin/activate
4855
```
49-
If you used a separate location, open a terminal and type the following
56+
If a non-default path is used:
5057
```
5158
source <custom_path>/bin/activate
5259
```
53-
2. Clone the GitHub repository and install required packages:
60+
61+
**3. (Offline Installer) Activate relevant Conda environment**
62+
63+
For CPU
64+
```
65+
conda activate pytorch
66+
```
67+
For GPU
68+
```
69+
conda activate pytorch-gpu
70+
```
71+
72+
**4. Clone the GitHub repository**
73+
5474
```
5575
git clone https://github.com/oneapi-src/oneAPI-samples.git
56-
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/Intel_oneCCL_Bindings_For_PyTorch_GettingStarted/
76+
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/Intel_oneCCL_Bindings_For_PyTorch_GettingStarted
77+
```
78+
79+
**5. Install dependencies**
80+
81+
>**Note**: Before running the following commands, make sure your Conda/Python environment with AI Tools installed is activated
82+
83+
```
5784
pip install -r requirements.txt
85+
pip install notebook
86+
```
87+
For Jupyter Notebook, refer to [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
88+
89+
## Run the Sample
90+
>**Note**: Before running the sample, make sure [Environment Setup](https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch#environment-setup) is completed.
91+
92+
Go to the section which corresponds to the installation method chosen in [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to see relevant instructions:
93+
* [AI Tools Offline Installer (Validated)](#ai-tools-offline-installer-validated)
94+
* [Docker](#docker)
95+
96+
### AI Tools Offline Installer (Validated)
97+
98+
**1. Register Conda kernel to Jupyter Notebook kernel**
99+
100+
**For CPU**
101+
102+
If the default path is used during the installation of AI Tools:
103+
58104
```
59-
3. Launch Jupyter Notebook.
105+
$HOME/intel/oneapi/intelpython/envs/pytorch/bin/python -m ipykernel install --user --name=pytorch
106+
```
107+
108+
If a non-default path is used:
109+
```
110+
<custom_path>/bin/python -m ipykernel install --user --name=pytorch
111+
```
112+
113+
**For GPU**
114+
115+
If the default path is used during the installation of AI Tools:
116+
117+
```
118+
$HOME/intel/oneapi/intelpython/envs/pytorch-gpu/bin/python -m ipykernel install --user --name=pytorch-gpu
119+
```
120+
121+
If a non-default path is used:
122+
```
123+
<custom_path>/bin/python -m ipykernel install --user --name=pytorch-gpu
124+
```
125+
**2. Launch Jupyter Notebook.**
60126
```
61127
jupyter notebook --ip=0.0.0.0 --port 8888 --allow-root
62128
```
63-
4. Follow the instructions to open the URL with the token in your browser.
64-
5. Locate and select the Notebook.
129+
**3. Follow the instructions to open the URL with the token in your browser.**
130+
131+
**4. Select the Notebook.**
65132
```
66133
oneCCL_Bindings_GettingStarted.ipynb
67134
```
68-
6. Change your Jupyter Notebook kernel to **PyTorch** or **PyTorch-GPU**.
69-
7. Run every cell in the Notebook in sequence.
135+
136+
**5. Change kernel to ``pytorch`` or ``pytorch-gpu``.**
137+
138+
**6. Run every cell in the Notebook in sequence.**
70139

71140
### Docker
72141
AI Tools Docker images already have Get Started samples pre-installed. Refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
@@ -77,3 +146,5 @@ Code samples are licensed under the MIT license. See
77146
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details.
78147

79148
Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt).
149+
150+
*Other names and brands may be claimed as the property of others. [Trademarks](https://www.intel.com/content/www/us/en/legal/trademarks.html)

AI-and-Analytics/Getting-Started-Samples/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Third party program Licenses can be found here: [third-party-programs.txt](https
2323
|Classical Machine Learning| Intel® Optimization for XGBoost* | [IntelPython_XGBoost_GettingStarted](IntelPython_XGBoost_GettingStarted) | Set up and trains an XGBoost* model on datasets for prediction.
2424
|Classical Machine Learning| daal4py | [IntelPython_daal4py_GettingStarted](IntelPython_daal4py_GettingStarted) | Batch linear regression using the Python API package daal4py from oneAPI Data Analytics Library (oneDAL).
2525
|Deep Learning <br/> Inference Optimization| Intel® Optimization for TensorFlow* | [IntelTensorFlow_GettingStarted](IntelTensorFlow_GettingStarted) | A simple training example for TensorFlow.
26-
|Deep Learning <br/> Inference Optimization|Intel® Extension of PyTorch | [IntelPyTorch_GettingStarted](Intel_Extension_For_PyTorch_GettingStarted) | A simple training example for Intel® Extension of PyTorch.
26+
|Deep Learning <br/> Inference Optimization|Intel® Extension of PyTorch | [IntelPyTorch_GettingStarted]([https://github.com/intel/intel-extension-for-pytorch/tree/main/examples/cpu/inference/python/jupyter-notebooks](https://github.com/intel/intel-extension-for-pytorch/blob/main/examples/cpu/inference/python/jupyter-notebooks/IPEX_Getting_Started.ipynb)| A simple training example for Intel® Extension of PyTorch.
2727
|Classical Machine Learning| Scikit-learn (OneDAL) | [Intel_Extension_For_SKLearn_GettingStarted](Intel_Extension_For_SKLearn_GettingStarted) | Speed up a scikit-learn application using Intel oneDAL.
2828
|Deep Learning <br/> Inference Optimization|Intel® Extension of TensorFlow | [Intel® Extension For TensorFlow GettingStarted](Intel_Extension_For_TensorFlow_GettingStarted) | Guides users how to run a TensorFlow inference workload on both GPU and CPU.
2929
|Deep Learning Inference Optimization|oneCCL Bindings for PyTorch | [Intel oneCCL Bindings For PyTorch GettingStarted](Intel_oneCCL_Bindings_For_PyTorch_GettingStarted) | Guides users through the process of running a simple PyTorch* distributed workload on both GPU and CPU. |

0 commit comments

Comments
 (0)