Neuron Compiler CLI Reference Guide (neuronx-cc) — AWS Neuron Documentation (original) (raw)

Contents

This document is relevant for: Inf2, Trn1, Trn2

Neuron Compiler CLI Reference Guide (neuronx-cc)#

This document describes the command line interface of the Neuron Compiler.

This reference is not relevant for applications that run the Neuron Compiler from within a machine learning framework (PyTorch-Neuron for example) since these options are passed from the framework directly to the compiler. Using the compiler command line may be desirable for applications that do not use a framework or customize existing frameworks. It is also possible to specify compiler options within the framework which will forward these options to the compiler using NEURON_CC_FLAGS.

Usage#

Optional parameters are shown in square brackets.

Neuron Compiler Command-Line Interface

neuronx-cc [parameters]#

Available Commands:#

Common parameters for the Neuron CLI:

neuronx-cc compile [parameters]#

Compile a model for use on the AWS Machine Learning Accelerator.

neuronx-cc compile --framework --target [--model-type ] [--auto-cast ] [--auto-cast-type ] [--distribution-strategy ] [--logical-nc-config ], or [-lnc ] [--optlevel ], or [-O ] [--enable-mixed-precision-accumulation] [--enable-saturate-infinity] [--enable-fast-context-switch] [--enable-fast-loading-neuron-binaries] [--logfile ] [--output ] [--verbose ]

Compile Parameters:

Example:

Compiling an XLA HLO:

neuronx-cc compile bert-model.hlo —-framework XLA -—target trn1 —-model-type transformer —-output bert.neff

neuronx-cc list-operators [parameters]#

Returns a newline (‘\n’) separated list of operators supported by the Neuron Compiler.

neuronx-cc list-operators --framework

List-Operators Parameters:

Example:

neuronx-cc list-operators —framework XLA ...

Exit Statuses:

This document is relevant for: Inf2, Trn1, Trn2