NVIDIA / NVIDIA/TensorRT

BART Error: 'BARTTRTDecoder' object has no attribute 'trt_context_non_kv'

Open
#2,191 16 comments 0 reactions 1 assignee View on GitHub

@zerollzeng is already working on this.

Since Jul 30, 2022.

triaged
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

Description

Follow https://github.com/NVIDIA/TensorRT/blob/main/demo/HuggingFace/notebooks/t5.ipynb to build the tensorRT example for Bart model.
Get warning in bart_trt_decoder = BARTTRTDecoder(bart_trt_decoder_engine, metadata, tfm_config)
Cannot find binding of given name: past_key_values.0.decoder.key
and error in outputs = bart_trt_decoder(input_ids, encoder_last_hidden_state)
'BARTTRTDecoder' object has no attribute 'trt_context_non_kv'

Environment

TensorRT Version: '8.4.1.5'
NVIDIA GPU: A100-SXM4-40GB
NVIDIA Driver Version: 460.73.01
CUDA Version: 11.2
CUDNN Version: 8.0.5
Operating System: Debian GNU/Linux 10 (buster)
Python Version (if applicable): 3.7.12
Tensorflow Version (if applicable):
PyTorch Version (if applicable): '1.11.0'
Baremetal or Container (if so, version):

Relevant Files

'facebook/bart-base'

Steps To Reproduce

6 outputs = bart_trt_decoder(input_ids, encoder_last_hidden_state)

~/projects/bart/code/TensorRT/demo/HuggingFace/NNDF/tensorrt_utils.py in call(self, *args, **kwargs)
166 def call(self, *args, **kwargs):
167 self.trt_context.active_optimization_profile = self.profile_idx
--> 168 return self.forward(*args, **kwargs)
169
170 class PolygraphyOnnxRunner:

~/qinqing/projects/bart/code/TensorRT/demo/HuggingFace/BART/trt.py in forward(self, input_ids, encoder_hidden_states, *args, **kwargs)
401
402 # denote as variable to allow switch between non-kv and kv engines in kv cache mode
--> 403 trt_context = self.trt_context_non_kv if non_kv_flag else self.trt_context
404 bindings = self.bindings_non_kv if non_kv_flag else self.bindings
405 inputs = self.inputs_non_kv if non_kv_flag else self.inputs

AttributeError: 'BARTTRTDecoder' object has no attribute 'trt_context_non_kv'
-->

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.