Neuron compiler CLI Reference Guide (neuron-cc) — AWS Neuron Documentation (original) (raw)

Contents

This document is relevant for: Inf1

Neuron compiler CLI Reference Guide (neuron-cc)#

This document describes the command line interface of the Neuron compiler. This reference is not relevant for applications that run neuron-cc from within a machine learning framework (TensorFlow-Neuron for example) since these options are passed from the framework directly to neuron-cc.

Using neuron-cc on the command line may be desirable for applications that do not use a framework, or customize existing frameworks. It is also possible to supply CLI commands to the framework as options to be passed through to the compiler.

Usage#

Optional parameters are shown in square brackets. See the individual framework guides for the correct syntax.

Neuron Compiler CLI

neuron-cc [options] [parameters]#

Common options for the Neuron CLI:

Use neuron-cc --help for information on a specific command.

Available Commands:#

neuron-cc compile [parameters]#

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

neuron-cc compile --framework --io-config [--neuroncore-pipeline-cores ] [--enable-saturate-infinity] [--enable-fast-loading-neuron-binaries] [--enable-fast-context-switch] [--fp32-cast cast-method] [--fast-math cast-method] [--output ]

Compile Parameters:

Log Levels:

Logs at levels “trace”, “debug”, and “info” will be written to STDOUT.

Logs at levels “warn”, “error”, and “fatal” will be written to STDERR.

Exit Status

0 - Compilation succeeded

>0 - An error occurred during compilation.

Examples

Compiling a saved TensorFlow model:

neuron-cc compile test_graph_tfmatmul.pb --framework TENSORFLOW --io-config test_graph_tfmatmul.config

Compiling a MXNet model:

neuron-cc compile lenet-symbol.json lenet-0001.params --framework MXNET --neuroncore-pipeline-cores 2 --output file.neff

Compiling an XLA HLO:

neuron-cc compile bert-model.hlo --framework XLA --output file.neff

neuron-cc list-operators [parameters]#

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

neuron-cc list-operators --framework

Exit Status

0 - Call succeeded

>0 - An error occurred

Example

$ neuron-cc list-operators --framework TENSORFLOW AddN AdjustContrastv2 CheckNumbers ...

This document is relevant for: Inf1