UNPKG

aws-cdk-neuronx-patterns

Version:
31 lines (30 loc) 1.45 kB
import * as batch from "aws-cdk-lib/aws-batch"; import * as ec2 from "aws-cdk-lib/aws-ec2"; import { Construct } from "constructs"; import { NeuronxCompilerBase, NeuronxCompilerBaseProps, ComputeEnvironmentResult } from "./neuronx-compiler-base"; /** * Props of NeuronxCrossCompiler. */ export interface NeuronxCrossCompilerProps extends NeuronxCompilerBaseProps { /** * The EC2 instance type to use for cross-compilation. * This should be a non-Neuron instance type with sufficient memory and CPU * for model compilation. * * @default ec2.InstanceType.of(ec2.InstanceClass.C7I, ec2.InstanceSize.XLARGE4) */ readonly compileInstanceType?: ec2.InstanceType; } /** * Neuronx cross-compiler construct. * Compile the model on a non-Neuron instance and upload the artifacts to an S3 bucket. * This avoids the need for expensive Neuron instances during the compilation phase. * * The compilation uses `vllm serve` which performs model tracing and neuronx-cc compilation * entirely on CPU. The resulting artifacts are compatible with Neuron instances for inference. */ export declare class NeuronxCrossCompiler extends NeuronxCompilerBase { constructor(scope: Construct, id: string, props: NeuronxCrossCompilerProps); protected createComputeEnvironment(props: NeuronxCompilerBaseProps): ComputeEnvironmentResult; protected createJobDefinition(props: NeuronxCompilerBaseProps): batch.IJobDefinition; }