NVIDIA / NVIDIA/TensorRT

host_runtime_perf_knobs usage issue: [TRT] [E] IExecutionContext::enqueueV3: Error Code 3: API Usage Error

Open
#4,186 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm trying to write a unit test for flash attention using version 0.14.0.dev2024100100.

I noticed that host_runtime_perf_knobs is a new feature in recent versions. Here are how I use it and the reported error code:

`
with tensorrt_llm.net_guard(net):

            input_dim_range = OrderedDict([
                ('num_tokens', [batch_size*1, batch_size*max_seq_len]),
                ('hidden_size', [hidden_size, hidden_size]),
            ])
            trt_hidden_states = Tensor(
                name='hidden_states',
                shape=[-1, hidden_size],
                dtype=tensorrt_llm.str_dtype_to_trt(dtype),
                dim_range=input_dim_range)
             runtime_perf_knobs = Tensor(name='host_runtime_perf_knobs',
                                        shape=[max_seq_len],
                                        dtype=tensorrt_llm.str_dtype_to_trt('int64'),
                                        dim_range=OrderedDict([('perf_knob_size', [max_seq_len, max_seq_len])])
                                        )

`

attention_params=AttentionParams( sequence_length=sequence_length_tensor, context_lengths=context_lengths_tensor, host_request_types=host_request_types_tensor, max_context_length=context_length, host_context_lengths=host_context_lengths_tensor, host_runtime_perf_knobs=runtime_perf_knobs)

The error is:
[10/09/2024-06:22:33] [TRT] [E] IExecutionContext::enqueueV3: Error Code 3: API Usage Error (Parameter check failed, condition: mContext.profileObliviousBindings.at(profileObliviousIndex) != nullptr. Address is not set for input tensor host_runtime_perf_knobs. Call setInputTensorAddress or setTensorAddress before enqueue/execute.)

Any ideas why?

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.

Research direction

Start by reproducing the flash-attention unit-test setup around AttentionParams and the host_runtime_perf_knobs Tensor, then inspect the enqueueV3 call and the reported setInputTensorAddress requirement. Done means identifying the missing binding or API usage and confirming the corrected behavior with the relevant test; no file or test path is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.