You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/intelligentapps/modelconversion.md
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,16 @@ MetaDescription: Model Conversion Quickstart in AI Toolkit.
5
5
---
6
6
7
7
# Convert a model with AI Toolkit for VS Code (Preview)
8
+
8
9
Model conversion is an integrated development environment designed to help developers and AI engineers to convert, quantize, optimize and evaluate the pre-built machine learning models on your local Windows platform. It offers a streamlined, end-to-end experience for models converted from sources like Hugging Face, optimizing them and enabling inference on local devices powered by NPUs, GPUs, and CPUs.
9
10
10
11
## Prerequisites
12
+
11
13
- VS Code must be installed. Follow these steps to [set up VS Code](https://code.visualstudio.com/docs/setup/setup-overview).
12
14
- AI Toolkit extension must be installed. For more information, see [install AI Toolkit](./overview.md#install-and-setup)
13
15
14
16
## Create project
17
+
15
18
Creating a project in model conversion is the first step toward converting, optimizing, quantizing and evaluating machine learning models.
16
19
17
20
1. Launch model conversion
@@ -21,7 +24,7 @@ Creating a project in model conversion is the first step toward converting, opti
21
24
2. Start a new project
22
25
23
26
Select **New Model Project**.
24
-

27
+

25
28
26
29
3. Choose a base model
27
30
-`Hugging Face Model`: choose the base model with predefined recipes from the supported model list.
@@ -32,20 +35,22 @@ Creating a project in model conversion is the first step toward converting, opti
32
35
Enter a unique **Project Location** and a **Project Name**. A new folder with the specified project name is created in the location you selected for storing the project files.
33
36
34
37
- Select or create a folder as model project folder.
35
-

38
+

36
39
37
-
- Enter model project name. Press `Enter`.
38
-

40
+
- Enter model project name. Press `kbstyle(Enter)`.
41
+

39
42
40
43
> Note:
41
44
> - The first time you create a model project, it might take a while to set up the environment.
42
45
> -**ReadMe Access**: A README file is included in each project. If you close it, you can reopen it via the workspace.
43
46
> 
44
47
45
48
### Supported models
49
+
46
50
Model Conversion currently supports a growing list of models, including top Hugging Face models in PyTorch format.
- If you already opened the model project, select **Models** -> **Conversion**. Select **Add Models** on right panel. Or you need to open the model project and then select **Add Models** on the right panel.
69
76
70
77

@@ -73,6 +80,7 @@ Model Conversion currently supports a growing list of models, including top Hugg
73
80
- A folder contains new model files will be created in current project folder.
74
81
75
82
### (Optional) Create a new model project
83
+
76
84
- If you already opened the model project, select **Models** -> **Conversion**. On right panel, Select **New Project**.
77
85
78
86

@@ -81,21 +89,21 @@ Model Conversion currently supports a growing list of models, including top Hugg
81
89
82
90
Select or create a folder as model project folder.
83
91
84
-
Enter model project name. Press `Enter`.
92
+
Enter model project name. Press `kbstyle(Enter)`.
85
93
86
-

87
-
88
-

94
+

89
95
96
+

90
97
91
98
## Run workflow
92
-
Running a workflow in model conversion is the core step that transform the pre-built ML model into an optimized and quantized onnx model.
99
+
100
+
Running a workflow in model conversion is the core step that transform the pre-built ML model into an optimized and quantized ONNX model.
93
101
94
102
1. Open model project
95
103
- Ensure that the model project is open. If it isn't, navigate to File -> Open Folder in VS Code to open the model project.
96
104
97
105
2. Review workflow configuration
98
-
- Navigate to primary sider bar**Models**-> **Conversion**
106
+
- Navigate to Primary Side Bar**Models**-> **Conversion**
99
107
- Select the workflow template to view the conversion recipe.
100
108
101
109

@@ -118,15 +126,15 @@ Running a workflow in model conversion is the core step that transform the pre-b
118
126
> Note:
119
127
>
120
128
> If your workflow uses a dataset that requires license agreement approval on Hugging Face (e.g., ImageNet-1k), you’ll be prompted to accept the terms on the dataset page before proceeding. This is required for legal compliance.
121
-
> 1.To get your Hugging Face Access Token, select button on poped out window.
129
+
> 1.Select the **HuggingFace Access Token**button to get your Hugging Face Access Token.
122
130
>
123
-
> 
131
+
> 
124
132
>
125
-
> 2. Select open.
133
+
> 2. Select **Open** to open the Hugging Face website.
126
134
>
127
-
> 
135
+
> 
128
136
>
129
-
> 3. Get token on Hugging Face portal. Paste on the top window. Press `Enter`.
137
+
> 3. Get your token on Hugging Face portal and paste it Quick Pick. Press `kbstyle(Enter)`.
130
138
>
131
139
> 
132
140
@@ -155,10 +163,10 @@ Running a workflow in model conversion is the core step that transform the pre-b
155
163
- If the workflow configuration meet your needs, select **Run** to begin the job.
156
164
- A default job name will be generated using the workflow name and timestamp (e.g., `bert_qdq_2025-05-06_20-45-00`) for easy tracking.
157
165
- During the job running, you can **Cancel** the job by selecting on the status indicator or the three-dot menu under **Action** in History board and select **Stop Running**.
158
-
-**Hugging Face compliance alerts**: During the quantization, we need the calibration datasets. You may be prompted to accept license terms before proceeding. If you missed the notification, the running process will be paused, waiting for your input. Please make sure notifications are enabled and that you accept the required licenses.
166
+
-**Hugging Face compliance alerts**: During the quantization, we need the calibration datasets. You may be prompted to accept license terms before proceeding. If you missed the notification, the running process will be paused, waiting for your input. Please make sure notifications are enabled and that you accept the required licenses.
159
167
160
168
> Note:
161
-
> -**Model conversion and quantization**: you can run workflow on any device expect for LLM models. The **Quantization** configuration is optimized for NPU only. It's recommaneded to uncheck this step if target system is not NPU.
169
+
> -**Model conversion and quantization**: you can run workflow on any device expect for LLM models. The **Quantization** configuration is optimized for NPU only. It's recommended to uncheck this step if the target system is not NPU.
162
170
> -**LLM model quantization**: If you want to quantize the [LLM models](#llm-models), a Nvidia GPU is required.
163
171
>
164
172
> If you want to quantize the model on another device with GPU, you can setup environment by yourselves, please refer [ManualConversionOnGPU](./reference/ManualConversionOnGPU.md). Please note that only "Quantization" step need the GPU. After quantization, you can evaluate the model on NPU or CPU.
@@ -180,15 +188,18 @@ Running a workflow in model conversion is the core step that transform the pre-b
180
188
> If your job is canceled or failed, you can select job name to adjust the workflow and run job again. To avoid accidental overwrites, each execution creates a new history folder with its own configuration and results.
181
189
182
190
## View results
191
+
183
192
The History Board in **Conversion** is your central dashboard for tracking, reviewing, and managing all workflow runs. Each time you run a model conversion and evaluation, a new entry is created in the History Board—ensuring full traceability and reproducibility.
184
193
185
194
- Find the workflow run that you want to review. Each run is listed with a status indicator (e.g. Succeeded, Cancelled)
186
195
- Select the run name to view the conversion configurations
187
-
- Select the **logs** under Status indicator to to view logs and detailed execution results
196
+
- Select the **logs** under Status indicator to view logs and detailed execution results
188
197
- Once the model converted successfully, you can view the evaluation results under Metrics. Metrics such as accuracy, latency and throughput are displayed alongside each run
198
+
189
199

190
200
191
201
## Use sample notebook for model inference
202
+
192
203
- Go to the History board. Select the three-dot menu under **Action**.
193
204
194
205
Select **Inference in Samples** from the dropdown.
@@ -202,15 +213,16 @@ The default runtime is: `C:\Users\{user_name}\.aitk\bin\model_lab_runtime\Python
202
213
- The sample will launch in a Jupyter Notebook. You can customize the input data or parameters to test different scenarios.
203
214
204
215
> [!TIP]
205
-
>
206
216
> **Model compatibility:** Ensure the converted model supports the specified EPs in the inference samples
207
217
>
208
218
> **Sample location:** Inference samples are stored alongside the run artifacts in the history folder.
209
219
210
220
## Export and share with others
211
-
Go to the History board. Select **Export** to share the model project with others. This only copy the model project without history folder. If you want to share models with others, please select the corresponding jobs, This will copy the selected history folder conaining the model and its configuration.
221
+
222
+
Go to the History board. Select **Export** to share the model project with others. This copies the model project without history folder. If you want to share models with others, select the corresponding jobs. This copies the selected history folder containing the model and its configuration.
212
223
213
224
## See also
225
+
214
226
-[How to manually setup GPU conversion](./reference/ManualConversionOnGPU.md)
215
227
-[How to manually setup environment](./reference/SetupWithoutAITK.md)
216
228
-[How to customize model template](./reference/TemplateProject.md)
0 commit comments