aws-cdk-neuronx-patterns 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/devcontainer.json +39 -0
- package/.jsii +4755 -0
- package/API.md +824 -0
- package/LICENSE +202 -0
- package/README.md +103 -0
- package/docs/neuronx-compile-architecture.png +0 -0
- package/lib/.types-compat/ts3.9/index.d.ts +2 -0
- package/lib/.types-compat/ts3.9/neuronx-compile.d.ts +166 -0
- package/lib/.types-compat/ts3.9/neuronx-instance-type.d.ts +44 -0
- package/lib/.types-compat/ts3.9/private/await-compile-job/index.d.ts +4 -0
- package/lib/.types-compat/ts3.9/private/neuron-optimized-machine-image.d.ts +8 -0
- package/lib/.types-compat/ts3.9/private/neuronx-ami/index.d.ts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/lib/neuronx-compile.d.ts +166 -0
- package/lib/neuronx-compile.js +285 -0
- package/lib/neuronx-instance-type.d.ts +44 -0
- package/lib/neuronx-instance-type.js +52 -0
- package/lib/private/await-compile-job/index.d.ts +4 -0
- package/lib/private/await-compile-job/index.js +62 -0
- package/lib/private/neuron-optimized-machine-image.d.ts +8 -0
- package/lib/private/neuron-optimized-machine-image.js +42 -0
- package/lib/private/neuronx-ami/index.d.ts +2 -0
- package/lib/private/neuronx-ami/index.js +13 -0
- package/package.json +147 -0
package/API.md
ADDED
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
2
|
+
|
|
3
|
+
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
4
|
+
|
|
5
|
+
### NeuronxCompile <a name="NeuronxCompile" id="aws-cdk-neuronx-patterns.NeuronxCompile"></a>
|
|
6
|
+
|
|
7
|
+
Neuronx compile construct.
|
|
8
|
+
|
|
9
|
+
Compile the model to work with Inferentia2 and Trainium1 and upload it to an S3 bucket.
|
|
10
|
+
|
|
11
|
+
#### Initializers <a name="Initializers" id="aws-cdk-neuronx-patterns.NeuronxCompile.Initializer"></a>
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { NeuronxCompile } from 'aws-cdk-neuronx-patterns'
|
|
15
|
+
|
|
16
|
+
new NeuronxCompile(scope: Construct, id: string, props: NeuronxCompileProps)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| **Name** | **Type** | **Description** |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
22
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
23
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.props">props</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps">NeuronxCompileProps</a></code> | *No description.* |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.scope"></a>
|
|
28
|
+
|
|
29
|
+
- *Type:* constructs.Construct
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
##### `id`<sup>Required</sup> <a name="id" id="aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.id"></a>
|
|
34
|
+
|
|
35
|
+
- *Type:* string
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
##### `props`<sup>Required</sup> <a name="props" id="aws-cdk-neuronx-patterns.NeuronxCompile.Initializer.parameter.props"></a>
|
|
40
|
+
|
|
41
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps">NeuronxCompileProps</a>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
46
|
+
|
|
47
|
+
| **Name** | **Description** |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
##### `toString` <a name="toString" id="aws-cdk-neuronx-patterns.NeuronxCompile.toString"></a>
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
public toString(): string
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Returns a string representation of this construct.
|
|
60
|
+
|
|
61
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
62
|
+
|
|
63
|
+
| **Name** | **Description** |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="aws-cdk-neuronx-patterns.NeuronxCompile.isConstruct"></a>
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { NeuronxCompile } from 'aws-cdk-neuronx-patterns'
|
|
73
|
+
|
|
74
|
+
NeuronxCompile.isConstruct(x: any)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Checks if `x` is a construct.
|
|
78
|
+
|
|
79
|
+
###### `x`<sup>Required</sup> <a name="x" id="aws-cdk-neuronx-patterns.NeuronxCompile.isConstruct.parameter.x"></a>
|
|
80
|
+
|
|
81
|
+
- *Type:* any
|
|
82
|
+
|
|
83
|
+
Any object.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
88
|
+
|
|
89
|
+
| **Name** | **Type** | **Description** |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
92
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompile.property.compiledArtifactS3Url">compiledArtifactS3Url</a></code> | <code>string</code> | S3 URL that compiled artifact uploaded. |
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
##### `node`<sup>Required</sup> <a name="node" id="aws-cdk-neuronx-patterns.NeuronxCompile.property.node"></a>
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
public readonly node: Node;
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- *Type:* constructs.Node
|
|
103
|
+
|
|
104
|
+
The tree node.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
##### `compiledArtifactS3Url`<sup>Required</sup> <a name="compiledArtifactS3Url" id="aws-cdk-neuronx-patterns.NeuronxCompile.property.compiledArtifactS3Url"></a>
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
public readonly compiledArtifactS3Url: string;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- *Type:* string
|
|
115
|
+
|
|
116
|
+
S3 URL that compiled artifact uploaded.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Structs <a name="Structs" id="Structs"></a>
|
|
122
|
+
|
|
123
|
+
### CompileOptions <a name="CompileOptions" id="aws-cdk-neuronx-patterns.CompileOptions"></a>
|
|
124
|
+
|
|
125
|
+
Compile options.
|
|
126
|
+
|
|
127
|
+
#### Initializer <a name="Initializer" id="aws-cdk-neuronx-patterns.CompileOptions.Initializer"></a>
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { CompileOptions } from 'aws-cdk-neuronx-patterns'
|
|
131
|
+
|
|
132
|
+
const compileOptions: CompileOptions = { ... }
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
136
|
+
|
|
137
|
+
| **Name** | **Type** | **Description** |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileOptions.property.nPositions">nPositions</a></code> | <code>number</code> | *No description.* |
|
|
140
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileOptions.property.optLevel">optLevel</a></code> | <code><a href="#aws-cdk-neuronx-patterns.OptLevel">OptLevel</a></code> | *No description.* |
|
|
141
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileOptions.property.quantDtype">quantDtype</a></code> | <code><a href="#aws-cdk-neuronx-patterns.QuantDtype">QuantDtype</a></code> | *No description.* |
|
|
142
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileOptions.property.tpDegree">tpDegree</a></code> | <code>number</code> | *No description.* |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
##### `nPositions`<sup>Optional</sup> <a name="nPositions" id="aws-cdk-neuronx-patterns.CompileOptions.property.nPositions"></a>
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
public readonly nPositions: number;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
- *Type:* number
|
|
153
|
+
- *Default:* 4092
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
##### `optLevel`<sup>Optional</sup> <a name="optLevel" id="aws-cdk-neuronx-patterns.CompileOptions.property.optLevel"></a>
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
public readonly optLevel: OptLevel;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.OptLevel">OptLevel</a>
|
|
164
|
+
- *Default:* OptLevel.BEST_BALANCE
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
##### `quantDtype`<sup>Optional</sup> <a name="quantDtype" id="aws-cdk-neuronx-patterns.CompileOptions.property.quantDtype"></a>
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
public readonly quantDtype: QuantDtype;
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.QuantDtype">QuantDtype</a>
|
|
175
|
+
- *Default:* No quant
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
##### `tpDegree`<sup>Optional</sup> <a name="tpDegree" id="aws-cdk-neuronx-patterns.CompileOptions.property.tpDegree"></a>
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
public readonly tpDegree: number;
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- *Type:* number
|
|
186
|
+
- *Default:* calc from parameters and quantDtype
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### CompileRuntime <a name="CompileRuntime" id="aws-cdk-neuronx-patterns.CompileRuntime"></a>
|
|
191
|
+
|
|
192
|
+
Compile runtime.
|
|
193
|
+
|
|
194
|
+
#### Initializer <a name="Initializer" id="aws-cdk-neuronx-patterns.CompileRuntime.Initializer"></a>
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { CompileRuntime } from 'aws-cdk-neuronx-patterns'
|
|
198
|
+
|
|
199
|
+
const compileRuntime: CompileRuntime = { ... }
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
203
|
+
|
|
204
|
+
| **Name** | **Type** | **Description** |
|
|
205
|
+
| --- | --- | --- |
|
|
206
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileRuntime.property.image">image</a></code> | <code>aws-cdk-lib.aws_ecs.ContainerImage</code> | An image of the container where the compile job is executed. |
|
|
207
|
+
| <code><a href="#aws-cdk-neuronx-patterns.CompileRuntime.property.neuronxVersion">neuronxVersion</a></code> | <code>string</code> | Neuronx version included in container image. |
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
##### `image`<sup>Required</sup> <a name="image" id="aws-cdk-neuronx-patterns.CompileRuntime.property.image"></a>
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
public readonly image: ContainerImage;
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
- *Type:* aws-cdk-lib.aws_ecs.ContainerImage
|
|
218
|
+
|
|
219
|
+
An image of the container where the compile job is executed.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
##### `neuronxVersion`<sup>Required</sup> <a name="neuronxVersion" id="aws-cdk-neuronx-patterns.CompileRuntime.property.neuronxVersion"></a>
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
public readonly neuronxVersion: string;
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- *Type:* string
|
|
230
|
+
|
|
231
|
+
Neuronx version included in container image.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### ModelOptions <a name="ModelOptions" id="aws-cdk-neuronx-patterns.ModelOptions"></a>
|
|
236
|
+
|
|
237
|
+
Compile target model basic infromation.
|
|
238
|
+
|
|
239
|
+
#### Initializer <a name="Initializer" id="aws-cdk-neuronx-patterns.ModelOptions.Initializer"></a>
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
import { ModelOptions } from 'aws-cdk-neuronx-patterns'
|
|
243
|
+
|
|
244
|
+
const modelOptions: ModelOptions = { ... }
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
248
|
+
|
|
249
|
+
| **Name** | **Type** | **Description** |
|
|
250
|
+
| --- | --- | --- |
|
|
251
|
+
| <code><a href="#aws-cdk-neuronx-patterns.ModelOptions.property.parameters">parameters</a></code> | <code><a href="#aws-cdk-neuronx-patterns.Parameters">Parameters</a></code> | *No description.* |
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
##### `parameters`<sup>Required</sup> <a name="parameters" id="aws-cdk-neuronx-patterns.ModelOptions.property.parameters"></a>
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
public readonly parameters: Parameters;
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.Parameters">Parameters</a>
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### NeuronxCompileProps <a name="NeuronxCompileProps" id="aws-cdk-neuronx-patterns.NeuronxCompileProps"></a>
|
|
266
|
+
|
|
267
|
+
Props of NeuronxCompile.
|
|
268
|
+
|
|
269
|
+
#### Initializer <a name="Initializer" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.Initializer"></a>
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
import { NeuronxCompileProps } from 'aws-cdk-neuronx-patterns'
|
|
273
|
+
|
|
274
|
+
const neuronxCompileProps: NeuronxCompileProps = { ... }
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
278
|
+
|
|
279
|
+
| **Name** | **Type** | **Description** |
|
|
280
|
+
| --- | --- | --- |
|
|
281
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.bucket">bucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | The bucket to upload compiled artifacts. |
|
|
282
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.model">model</a></code> | <code><a href="#aws-cdk-neuronx-patterns.Model">Model</a></code> | The model to be compiled. |
|
|
283
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC in which this will launch compile worker instance. |
|
|
284
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.compileOptions">compileOptions</a></code> | <code><a href="#aws-cdk-neuronx-patterns.CompileOptions">CompileOptions</a></code> | Neuronx compile options. |
|
|
285
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.instanceType">instanceType</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a></code> | The instance type of compile worker instance. |
|
|
286
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.runtime">runtime</a></code> | <code><a href="#aws-cdk-neuronx-patterns.CompileRuntime">CompileRuntime</a></code> | Compile runtime. |
|
|
287
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.spot">spot</a></code> | <code>boolean</code> | Whether or not to use spot instances. |
|
|
288
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.volumeSize">volumeSize</a></code> | <code>aws-cdk-lib.Size</code> | The root volume of worker instance. |
|
|
289
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxCompileProps.property.vpcSubnets">vpcSubnets</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | The VPC Subnets this Compute Environment will launch instances in. |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
##### `bucket`<sup>Required</sup> <a name="bucket" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.bucket"></a>
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
public readonly bucket: IBucket;
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
- *Type:* aws-cdk-lib.aws_s3.IBucket
|
|
300
|
+
|
|
301
|
+
The bucket to upload compiled artifacts.
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
##### `model`<sup>Required</sup> <a name="model" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.model"></a>
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
public readonly model: Model;
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.Model">Model</a>
|
|
312
|
+
|
|
313
|
+
The model to be compiled.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
##### `vpc`<sup>Required</sup> <a name="vpc" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.vpc"></a>
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
public readonly vpc: IVpc;
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
324
|
+
|
|
325
|
+
VPC in which this will launch compile worker instance.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
##### `compileOptions`<sup>Optional</sup> <a name="compileOptions" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.compileOptions"></a>
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
public readonly compileOptions: CompileOptions;
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.CompileOptions">CompileOptions</a>
|
|
336
|
+
- *Default:* Each properties are set default.
|
|
337
|
+
|
|
338
|
+
Neuronx compile options.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
##### `instanceType`<sup>Optional</sup> <a name="instanceType" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.instanceType"></a>
|
|
343
|
+
|
|
344
|
+
```typescript
|
|
345
|
+
public readonly instanceType: NeuronxInstanceType;
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a>
|
|
349
|
+
|
|
350
|
+
The instance type of compile worker instance.
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
##### `runtime`<sup>Optional</sup> <a name="runtime" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.runtime"></a>
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
public readonly runtime: CompileRuntime;
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.CompileRuntime">CompileRuntime</a>
|
|
361
|
+
- *Default:* { neuronxSdkVersion: "2.19.0", image: ContainerImage.fromRegistry("public.ecr.aws/neuron/pytorch-training-neuronx:2.1.2-neuronx-py310-sdk2.19.0-ubuntu20.04")}
|
|
362
|
+
|
|
363
|
+
Compile runtime.
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
##### `spot`<sup>Optional</sup> <a name="spot" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.spot"></a>
|
|
368
|
+
|
|
369
|
+
```typescript
|
|
370
|
+
public readonly spot: boolean;
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
- *Type:* boolean
|
|
374
|
+
- *Default:* false
|
|
375
|
+
|
|
376
|
+
Whether or not to use spot instances.
|
|
377
|
+
|
|
378
|
+
Spot instances are less expensive EC2 instances that can be reclaimed by EC2 at any time; your job will be given two minutes of notice before reclamation.
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
##### `volumeSize`<sup>Optional</sup> <a name="volumeSize" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.volumeSize"></a>
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
public readonly volumeSize: Size;
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
- *Type:* aws-cdk-lib.Size
|
|
389
|
+
- *Default:* N bilion parameters * 5GiB EBS
|
|
390
|
+
|
|
391
|
+
The root volume of worker instance.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
##### `vpcSubnets`<sup>Optional</sup> <a name="vpcSubnets" id="aws-cdk-neuronx-patterns.NeuronxCompileProps.property.vpcSubnets"></a>
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
public readonly vpcSubnets: SubnetSelection;
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
|
|
402
|
+
- *Default:* new subnets will be created
|
|
403
|
+
|
|
404
|
+
The VPC Subnets this Compute Environment will launch instances in.
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Classes <a name="Classes" id="Classes"></a>
|
|
409
|
+
|
|
410
|
+
### Inferentia2Chips <a name="Inferentia2Chips" id="aws-cdk-neuronx-patterns.Inferentia2Chips"></a>
|
|
411
|
+
|
|
412
|
+
- *Implements:* <a href="#aws-cdk-neuronx-patterns.IAcceleratorChips">IAcceleratorChips</a>
|
|
413
|
+
|
|
414
|
+
#### Initializers <a name="Initializers" id="aws-cdk-neuronx-patterns.Inferentia2Chips.Initializer"></a>
|
|
415
|
+
|
|
416
|
+
```typescript
|
|
417
|
+
import { Inferentia2Chips } from 'aws-cdk-neuronx-patterns'
|
|
418
|
+
|
|
419
|
+
new Inferentia2Chips(chips: number)
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
| **Name** | **Type** | **Description** |
|
|
423
|
+
| --- | --- | --- |
|
|
424
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Inferentia2Chips.Initializer.parameter.chips">chips</a></code> | <code>number</code> | *No description.* |
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
##### `chips`<sup>Required</sup> <a name="chips" id="aws-cdk-neuronx-patterns.Inferentia2Chips.Initializer.parameter.chips"></a>
|
|
429
|
+
|
|
430
|
+
- *Type:* number
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
437
|
+
|
|
438
|
+
| **Name** | **Type** | **Description** |
|
|
439
|
+
| --- | --- | --- |
|
|
440
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Inferentia2Chips.property.acceleratorMemory">acceleratorMemory</a></code> | <code>aws-cdk-lib.Size</code> | *No description.* |
|
|
441
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Inferentia2Chips.property.chips">chips</a></code> | <code>number</code> | *No description.* |
|
|
442
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Inferentia2Chips.property.neuronxCores">neuronxCores</a></code> | <code>number</code> | *No description.* |
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
##### `acceleratorMemory`<sup>Required</sup> <a name="acceleratorMemory" id="aws-cdk-neuronx-patterns.Inferentia2Chips.property.acceleratorMemory"></a>
|
|
447
|
+
|
|
448
|
+
```typescript
|
|
449
|
+
public readonly acceleratorMemory: Size;
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
- *Type:* aws-cdk-lib.Size
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
##### `chips`<sup>Required</sup> <a name="chips" id="aws-cdk-neuronx-patterns.Inferentia2Chips.property.chips"></a>
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
public readonly chips: number;
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
- *Type:* number
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
##### `neuronxCores`<sup>Required</sup> <a name="neuronxCores" id="aws-cdk-neuronx-patterns.Inferentia2Chips.property.neuronxCores"></a>
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
public readonly neuronxCores: number;
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
- *Type:* number
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
### Model <a name="Model" id="aws-cdk-neuronx-patterns.Model"></a>
|
|
478
|
+
|
|
479
|
+
Compile target model.
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
483
|
+
|
|
484
|
+
| **Name** | **Description** |
|
|
485
|
+
| --- | --- |
|
|
486
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Model.fromHuggingFace">fromHuggingFace</a></code> | model informations at HuggingFace. |
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
##### `fromHuggingFace` <a name="fromHuggingFace" id="aws-cdk-neuronx-patterns.Model.fromHuggingFace"></a>
|
|
491
|
+
|
|
492
|
+
```typescript
|
|
493
|
+
import { Model } from 'aws-cdk-neuronx-patterns'
|
|
494
|
+
|
|
495
|
+
Model.fromHuggingFace(modelId: string, options: ModelOptions)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
model informations at HuggingFace.
|
|
499
|
+
|
|
500
|
+
###### `modelId`<sup>Required</sup> <a name="modelId" id="aws-cdk-neuronx-patterns.Model.fromHuggingFace.parameter.modelId"></a>
|
|
501
|
+
|
|
502
|
+
- *Type:* string
|
|
503
|
+
|
|
504
|
+
model id on the HuggingFace.
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
###### `options`<sup>Required</sup> <a name="options" id="aws-cdk-neuronx-patterns.Model.fromHuggingFace.parameter.options"></a>
|
|
509
|
+
|
|
510
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.ModelOptions">ModelOptions</a>
|
|
511
|
+
|
|
512
|
+
model basic infromation.
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
517
|
+
|
|
518
|
+
| **Name** | **Type** | **Description** |
|
|
519
|
+
| --- | --- | --- |
|
|
520
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Model.property.modelId">modelId</a></code> | <code>string</code> | *No description.* |
|
|
521
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Model.property.options">options</a></code> | <code><a href="#aws-cdk-neuronx-patterns.ModelOptions">ModelOptions</a></code> | *No description.* |
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
##### `modelId`<sup>Required</sup> <a name="modelId" id="aws-cdk-neuronx-patterns.Model.property.modelId"></a>
|
|
526
|
+
|
|
527
|
+
```typescript
|
|
528
|
+
public readonly modelId: string;
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
- *Type:* string
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
##### `options`<sup>Required</sup> <a name="options" id="aws-cdk-neuronx-patterns.Model.property.options"></a>
|
|
536
|
+
|
|
537
|
+
```typescript
|
|
538
|
+
public readonly options: ModelOptions;
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.ModelOptions">ModelOptions</a>
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
### NeuronxInstanceType <a name="NeuronxInstanceType" id="aws-cdk-neuronx-patterns.NeuronxInstanceType"></a>
|
|
547
|
+
|
|
548
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
549
|
+
|
|
550
|
+
| **Name** | **Description** |
|
|
551
|
+
| --- | --- |
|
|
552
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.toString">toString</a></code> | Return the instance type as a string. |
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
##### `toString` <a name="toString" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.toString"></a>
|
|
557
|
+
|
|
558
|
+
```typescript
|
|
559
|
+
public toString(): string
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
Return the instance type as a string.
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
566
|
+
|
|
567
|
+
| **Name** | **Type** | **Description** |
|
|
568
|
+
| --- | --- | --- |
|
|
569
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.acceleratorChips">acceleratorChips</a></code> | <code><a href="#aws-cdk-neuronx-patterns.IAcceleratorChips">IAcceleratorChips</a></code> | *No description.* |
|
|
570
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.instanceType">instanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | *No description.* |
|
|
571
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.memory">memory</a></code> | <code>aws-cdk-lib.Size</code> | *No description.* |
|
|
572
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.vCpu">vCpu</a></code> | <code>number</code> | *No description.* |
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
##### `acceleratorChips`<sup>Required</sup> <a name="acceleratorChips" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.acceleratorChips"></a>
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
public readonly acceleratorChips: IAcceleratorChips;
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.IAcceleratorChips">IAcceleratorChips</a>
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
##### `instanceType`<sup>Required</sup> <a name="instanceType" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.instanceType"></a>
|
|
587
|
+
|
|
588
|
+
```typescript
|
|
589
|
+
public readonly instanceType: InstanceType;
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
- *Type:* aws-cdk-lib.aws_ec2.InstanceType
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
##### `memory`<sup>Required</sup> <a name="memory" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.memory"></a>
|
|
597
|
+
|
|
598
|
+
```typescript
|
|
599
|
+
public readonly memory: Size;
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
- *Type:* aws-cdk-lib.Size
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
##### `vCpu`<sup>Required</sup> <a name="vCpu" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.vCpu"></a>
|
|
607
|
+
|
|
608
|
+
```typescript
|
|
609
|
+
public readonly vCpu: number;
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
- *Type:* number
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
617
|
+
|
|
618
|
+
| **Name** | **Type** | **Description** |
|
|
619
|
+
| --- | --- | --- |
|
|
620
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_24XLARGE">INF2_24XLARGE</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a></code> | ml.inf2.24xlarge. |
|
|
621
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_48XLARGE">INF2_48XLARGE</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a></code> | ml.inf2.48xlarge. |
|
|
622
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_8XLARGE">INF2_8XLARGE</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a></code> | ml.inf2.8xlarge. |
|
|
623
|
+
| <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_XLARGE">INF2_XLARGE</a></code> | <code><a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a></code> | ml.inf2.xlarge. |
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
##### `INF2_24XLARGE`<sup>Required</sup> <a name="INF2_24XLARGE" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_24XLARGE"></a>
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
public readonly INF2_24XLARGE: NeuronxInstanceType;
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a>
|
|
634
|
+
|
|
635
|
+
ml.inf2.24xlarge.
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
##### `INF2_48XLARGE`<sup>Required</sup> <a name="INF2_48XLARGE" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_48XLARGE"></a>
|
|
640
|
+
|
|
641
|
+
```typescript
|
|
642
|
+
public readonly INF2_48XLARGE: NeuronxInstanceType;
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a>
|
|
646
|
+
|
|
647
|
+
ml.inf2.48xlarge.
|
|
648
|
+
|
|
649
|
+
---
|
|
650
|
+
|
|
651
|
+
##### `INF2_8XLARGE`<sup>Required</sup> <a name="INF2_8XLARGE" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_8XLARGE"></a>
|
|
652
|
+
|
|
653
|
+
```typescript
|
|
654
|
+
public readonly INF2_8XLARGE: NeuronxInstanceType;
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a>
|
|
658
|
+
|
|
659
|
+
ml.inf2.8xlarge.
|
|
660
|
+
|
|
661
|
+
---
|
|
662
|
+
|
|
663
|
+
##### `INF2_XLARGE`<sup>Required</sup> <a name="INF2_XLARGE" id="aws-cdk-neuronx-patterns.NeuronxInstanceType.property.INF2_XLARGE"></a>
|
|
664
|
+
|
|
665
|
+
```typescript
|
|
666
|
+
public readonly INF2_XLARGE: NeuronxInstanceType;
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
- *Type:* <a href="#aws-cdk-neuronx-patterns.NeuronxInstanceType">NeuronxInstanceType</a>
|
|
670
|
+
|
|
671
|
+
ml.inf2.xlarge.
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
### Parameters <a name="Parameters" id="aws-cdk-neuronx-patterns.Parameters"></a>
|
|
676
|
+
|
|
677
|
+
Represents the amount of parameters.
|
|
678
|
+
|
|
679
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
680
|
+
|
|
681
|
+
| **Name** | **Description** |
|
|
682
|
+
| --- | --- |
|
|
683
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Parameters.toBilion">toBilion</a></code> | Return this number of parameters as bilion. |
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
##### `toBilion` <a name="toBilion" id="aws-cdk-neuronx-patterns.Parameters.toBilion"></a>
|
|
688
|
+
|
|
689
|
+
```typescript
|
|
690
|
+
public toBilion(): number
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
Return this number of parameters as bilion.
|
|
694
|
+
|
|
695
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
696
|
+
|
|
697
|
+
| **Name** | **Description** |
|
|
698
|
+
| --- | --- |
|
|
699
|
+
| <code><a href="#aws-cdk-neuronx-patterns.Parameters.billion">billion</a></code> | Create a Parameters representing an amount bilion. |
|
|
700
|
+
|
|
701
|
+
---
|
|
702
|
+
|
|
703
|
+
##### `billion` <a name="billion" id="aws-cdk-neuronx-patterns.Parameters.billion"></a>
|
|
704
|
+
|
|
705
|
+
```typescript
|
|
706
|
+
import { Parameters } from 'aws-cdk-neuronx-patterns'
|
|
707
|
+
|
|
708
|
+
Parameters.billion(parameters: number)
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
Create a Parameters representing an amount bilion.
|
|
712
|
+
|
|
713
|
+
###### `parameters`<sup>Required</sup> <a name="parameters" id="aws-cdk-neuronx-patterns.Parameters.billion.parameter.parameters"></a>
|
|
714
|
+
|
|
715
|
+
- *Type:* number
|
|
716
|
+
|
|
717
|
+
number of parameters bilionX.
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
## Protocols <a name="Protocols" id="Protocols"></a>
|
|
724
|
+
|
|
725
|
+
### IAcceleratorChips <a name="IAcceleratorChips" id="aws-cdk-neuronx-patterns.IAcceleratorChips"></a>
|
|
726
|
+
|
|
727
|
+
- *Implemented By:* <a href="#aws-cdk-neuronx-patterns.Inferentia2Chips">Inferentia2Chips</a>, <a href="#aws-cdk-neuronx-patterns.IAcceleratorChips">IAcceleratorChips</a>
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
731
|
+
|
|
732
|
+
| **Name** | **Type** | **Description** |
|
|
733
|
+
| --- | --- | --- |
|
|
734
|
+
| <code><a href="#aws-cdk-neuronx-patterns.IAcceleratorChips.property.acceleratorMemory">acceleratorMemory</a></code> | <code>aws-cdk-lib.Size</code> | *No description.* |
|
|
735
|
+
| <code><a href="#aws-cdk-neuronx-patterns.IAcceleratorChips.property.chips">chips</a></code> | <code>number</code> | *No description.* |
|
|
736
|
+
| <code><a href="#aws-cdk-neuronx-patterns.IAcceleratorChips.property.neuronxCores">neuronxCores</a></code> | <code>number</code> | *No description.* |
|
|
737
|
+
|
|
738
|
+
---
|
|
739
|
+
|
|
740
|
+
##### `acceleratorMemory`<sup>Required</sup> <a name="acceleratorMemory" id="aws-cdk-neuronx-patterns.IAcceleratorChips.property.acceleratorMemory"></a>
|
|
741
|
+
|
|
742
|
+
```typescript
|
|
743
|
+
public readonly acceleratorMemory: Size;
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
- *Type:* aws-cdk-lib.Size
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
##### `chips`<sup>Required</sup> <a name="chips" id="aws-cdk-neuronx-patterns.IAcceleratorChips.property.chips"></a>
|
|
751
|
+
|
|
752
|
+
```typescript
|
|
753
|
+
public readonly chips: number;
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
- *Type:* number
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
##### `neuronxCores`<sup>Required</sup> <a name="neuronxCores" id="aws-cdk-neuronx-patterns.IAcceleratorChips.property.neuronxCores"></a>
|
|
761
|
+
|
|
762
|
+
```typescript
|
|
763
|
+
public readonly neuronxCores: number;
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
- *Type:* number
|
|
767
|
+
|
|
768
|
+
---
|
|
769
|
+
|
|
770
|
+
## Enums <a name="Enums" id="Enums"></a>
|
|
771
|
+
|
|
772
|
+
### OptLevel <a name="OptLevel" id="aws-cdk-neuronx-patterns.OptLevel"></a>
|
|
773
|
+
|
|
774
|
+
Optimization level.
|
|
775
|
+
|
|
776
|
+
#### Members <a name="Members" id="Members"></a>
|
|
777
|
+
|
|
778
|
+
| **Name** | **Description** |
|
|
779
|
+
| --- | --- |
|
|
780
|
+
| <code><a href="#aws-cdk-neuronx-patterns.OptLevel.MINIMIZING_COMPILE_TIME">MINIMIZING_COMPILE_TIME</a></code> | enables the core performance optimizations in the compiler, while also minimizing compile time. |
|
|
781
|
+
| <code><a href="#aws-cdk-neuronx-patterns.OptLevel.BEST_BALANCE">BEST_BALANCE</a></code> | provides the best balance between model performance and compile time. |
|
|
782
|
+
| <code><a href="#aws-cdk-neuronx-patterns.OptLevel.MODEL_EXECUTION_PERFORMANCE">MODEL_EXECUTION_PERFORMANCE</a></code> | may provide additional model execution performance but may incur longer compile times and higher host memory usage during model compilation. |
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
##### `MINIMIZING_COMPILE_TIME` <a name="MINIMIZING_COMPILE_TIME" id="aws-cdk-neuronx-patterns.OptLevel.MINIMIZING_COMPILE_TIME"></a>
|
|
787
|
+
|
|
788
|
+
enables the core performance optimizations in the compiler, while also minimizing compile time.
|
|
789
|
+
|
|
790
|
+
---
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
##### `BEST_BALANCE` <a name="BEST_BALANCE" id="aws-cdk-neuronx-patterns.OptLevel.BEST_BALANCE"></a>
|
|
794
|
+
|
|
795
|
+
provides the best balance between model performance and compile time.
|
|
796
|
+
|
|
797
|
+
---
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
##### `MODEL_EXECUTION_PERFORMANCE` <a name="MODEL_EXECUTION_PERFORMANCE" id="aws-cdk-neuronx-patterns.OptLevel.MODEL_EXECUTION_PERFORMANCE"></a>
|
|
801
|
+
|
|
802
|
+
may provide additional model execution performance but may incur longer compile times and higher host memory usage during model compilation.
|
|
803
|
+
|
|
804
|
+
---
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
### QuantDtype <a name="QuantDtype" id="aws-cdk-neuronx-patterns.QuantDtype"></a>
|
|
808
|
+
|
|
809
|
+
Quant data type.
|
|
810
|
+
|
|
811
|
+
#### Members <a name="Members" id="Members"></a>
|
|
812
|
+
|
|
813
|
+
| **Name** | **Description** |
|
|
814
|
+
| --- | --- |
|
|
815
|
+
| <code><a href="#aws-cdk-neuronx-patterns.QuantDtype.S8">S8</a></code> | int8 weight storage. |
|
|
816
|
+
|
|
817
|
+
---
|
|
818
|
+
|
|
819
|
+
##### `S8` <a name="S8" id="aws-cdk-neuronx-patterns.QuantDtype.S8"></a>
|
|
820
|
+
|
|
821
|
+
int8 weight storage.
|
|
822
|
+
|
|
823
|
+
---
|
|
824
|
+
|