aws-neuron / aws-neuron-sdk

Powering AWS purpose-built machine learning chips. Blazing fast and cost effective, natively integrated into PyTorch and TensorFlow and integrated with your favorite AWS services
https://aws.amazon.com/machine-learning/neuron/
Other
421 stars 136 forks source link

[inf1][torch-neuron] WARNING:Neuron:No operator is placed on Neuron runtime; returning a CPU trace #827

Closed PigletOS closed 5 months ago

PigletOS commented 5 months ago

Environment device : inf1.xlarge torch 1.3.1 torch-neuron 1.13.1.2.9.17.0

Problem I traced a single convolution layer and got this warning :

WARNING:Neuron:No operator is placed on Neuron runtime; returning a CPU trace

Log

INFO:Neuron:The following operations are currently supported in torch-neuron for this model:
INFO:Neuron:prim::Constant
INFO:Neuron:prim::ListConstruct
INFO:Neuron:aten::_convolution
INFO:Neuron:100.00% of all operations (including primitives) (21 of 21) are supported
INFO:Neuron:100.00% of arithmetic operations (1 of 1) are supported
INFO:Neuron:All operators are compiled by neuron-cc (this does not guarantee that neuron-cc will successfully compile)
INFO:Neuron:Number of arithmetic operators (pre-compilation) before = 1, fused = 0, percent fused = 0.0%
WARNING:Neuron:No operator is placed on Neuron runtime; returning a CPU trace

Python Code test_conv_warning_cpu_trace.zip

mrnikwaws commented 5 months ago

Please refer to https://awsdocs-neuron.readthedocs-hosted.com/en/latest/frameworks/torch/torch-neuron/api-compilation-python-api.html - the minimum segment size to send to hardware during tracing is 2 by default. This prevents larger models getting badly fragmented.

If you want to trace a single operator please set this to 1: minimum_segment_size=1

mrnikwaws commented 5 months ago

Closing since this is expects + documented behavior.