1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
| /opt/conda/envs/neuron/lib/python3.8/site-packages/torch/__init__.py:853: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert condition, message INFO:Neuron:There are 105 ops of 2 different types in the TorchScript that are not compiled by neuron-cc: aten::embedding, aten::index_put_, (For more information see https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/compiler/neuron-cc/neuron-cc-ops/neuron-cc-ops-pytorch.html) INFO:Neuron:Number of arithmetic operators (pre-compilation) before = 8878, fused = 8295, percent fused = 93.43% WARNING:tensorflow:From /opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/ops/aten.py:2387: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where WARNING:tensorflow:From /opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/ops/aten.py:3866: The name tf.matrix_band_part is deprecated. Please use tf.linalg.band_part instead.
INFO:Neuron:PyTorch to TF conversion failed to resolve function on aten::view with inputs [<tf.Tensor 'Decoder_132/DecoderLayer_3/MultiheadAttention_14/aten_chunk/split:0' shape=(2, 1, 384) dtype=float32>, [1, 12, 32]] INFO:Neuron:Exception = Cannot reshape a tensor with 768 elements to shape [1,12,32] (384 elements) for 'Decoder_132/DecoderLayer_3/MultiheadAttention_14/aten_view_1/Reshape' (op: 'Reshape') with input shapes: [2,1,384], [3] and with input tensors computed as partial shapes: input[1] = [1,12,32]. WARNING:Neuron:torch.neuron.trace failed on _NeuronGraph$4187; falling back to native python function call ERROR:Neuron:Cannot reshape a tensor with 768 elements to shape [1,12,32] (384 elements) for 'Decoder_132/DecoderLayer_3/MultiheadAttention_14/aten_view_1/Reshape' (op: 'Reshape') with input shapes: [2,1,384], [3] and with input tensors computed as partial shapes: input[1] = [1,12,32]. Traceback (most recent call last): File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/ops.py", line 1607, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot reshape a tensor with 768 elements to shape [1,12,32] (384 elements) for 'Decoder_132/DecoderLayer_3/MultiheadAttention_14/aten_view_1/Reshape' (op: 'Reshape') with input shapes: [2,1,384], [3] and with input tensors computed as partial shapes: input[1] = [1,12,32].
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/convert.py", line 413, in op_converter neuron_function = self.subgraph_compiler( File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/decorators.py", line 81, in trace transform_torch_graph_to_tensorflow(jit_trace, example_inputs, separate_weights=separate_weights, neuron_graph=func, **kwargs) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/decorators.py", line 634, in transform_torch_graph_to_tensorflow raise e File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/decorators.py", line 628, in transform_torch_graph_to_tensorflow tensor_outputs = local_func(op, *tensor_inputs) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/ops/aten.py", line 2540, in view return reshape(op, tensor, shape) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/ops/aten.py", line 2548, in reshape out = tf.reshape(tensor, shape) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/ops/array_ops.py", line 131, in reshape result = gen_array_ops.reshape(tensor, shape, name) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/ops/gen_array_ops.py", line 8114, in reshape _, _, _op = _op_def_lib._apply_op_helper( File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/op_def_library.py", line 792, in _apply_op_helper op = g.create_op(op_type_name, inputs, dtypes=None, name=scope, File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/ops.py", line 3356, in create_op return self._create_op_internal(op_type, inputs, dtypes, input_types, name, File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/ops.py", line 3418, in _create_op_internal ret = Operation( File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/ops.py", line 1769, in __init__ self._c_op = _create_c_op(self._graph, node_def, grouped_inputs, File "/opt/conda/envs/neuron/lib/python3.8/site-packages/tensorflow_core/python/framework/ops.py", line 1610, in _create_c_op raise ValueError(str(e)) ValueError: Cannot reshape a tensor with 768 elements to shape [1,12,32] (384 elements) for 'Decoder_132/DecoderLayer_3/MultiheadAttention_14/aten_view_1/Reshape' (op: 'Reshape') with input shapes: [2,1,384], [3] and with input tensors computed as partial shapes: input[1] = [1,12,32]. INFO:Neuron:Number of arithmetic operators (post-compilation) before = 8878, compiled = 0, percent compiled = 0.0% INFO:Neuron:The neuron partitioner created 1 sub-graphs INFO:Neuron:Neuron successfully compiled 0 sub-graphs, Total fused subgraphs = 1, Percent of model sub-graphs successfully compiled = 0.0% INFO:Neuron:Compiled these operators (and operator counts) to Neuron: INFO:Neuron:Not compiled operators (and operator counts) to Neuron: INFO:Neuron: => aten::Int: 1992 [supported] INFO:Neuron: => aten::_convolution: 1 [supported] INFO:Neuron: => aten::add: 233 [supported] INFO:Neuron: => aten::argmax: 51 [supported] INFO:Neuron: => aten::baddbmm: 52 [supported] INFO:Neuron: => aten::bmm: 156 [supported] INFO:Neuron: => aten::cat: 54 [supported] INFO:Neuron: => aten::chunk: 104 [supported] INFO:Neuron: => aten::contiguous: 416 [supported] INFO:Neuron: => aten::cumsum: 1 [supported] INFO:Neuron: => aten::div: 208 [supported] INFO:Neuron: => aten::dropout: 361 [supported] INFO:Neuron: => aten::embedding: 104 [not supported] INFO:Neuron: => aten::eq: 1 [supported] INFO:Neuron: => aten::expand: 2 [supported] INFO:Neuron: => aten::fill_: 51 [supported] INFO:Neuron: => aten::flatten: 1 [supported] INFO:Neuron: => aten::full: 3 [supported] INFO:Neuron: => aten::gelu: 64 [supported] INFO:Neuron: => aten::gt: 1 [supported] INFO:Neuron: => aten::index_put_: 1 [not supported] INFO:Neuron: => aten::layer_norm: 285 [supported] INFO:Neuron: => aten::linear: 516 [supported] INFO:Neuron: => aten::masked_fill: 1 [supported] INFO:Neuron: => aten::matmul: 24 [supported] INFO:Neuron: => aten::mul: 741 [supported] INFO:Neuron: => aten::ones: 1 [supported] INFO:Neuron: => aten::permute: 12 [supported] INFO:Neuron: => aten::reshape: 25 [supported] INFO:Neuron: => aten::select: 51 [supported] INFO:Neuron: => aten::size: 819 [supported] INFO:Neuron: => aten::slice: 675 [supported] INFO:Neuron: => aten::softmax: 116 [supported] INFO:Neuron: => aten::split_with_sizes: 208 [supported] INFO:Neuron: => aten::squeeze: 50 [supported] INFO:Neuron: => aten::sub: 52 [supported] INFO:Neuron: => aten::to: 1 [supported] INFO:Neuron: => aten::transpose: 857 [supported] INFO:Neuron: => aten::triu: 2 [supported] INFO:Neuron: => aten::unbind: 12 [supported] INFO:Neuron: => aten::unsqueeze: 52 [supported] INFO:Neuron: => aten::view: 521 [supported] Traceback (most recent call last): File "torch2neuron.py", line 46, in <module> model_neuron = torch.neuron.trace(model, [input_tensor]) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/convert.py", line 217, in trace cu.stats_post_compiler(neuron_graph) File "/opt/conda/envs/neuron/lib/python3.8/site-packages/torch_neuron/convert.py", line 530, in stats_post_compiler raise RuntimeError( RuntimeError: No operations were successfully partitioned and compiled to neuron for this model - aborting trace!
|