TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

Support more sampling parameters with TRTLLM worker.

Open WeiHaocheng opened this issue 1 year ago • 4 comments

WeiHaocheng avatar Apr 07 '25 12:04 WeiHaocheng

I see this job (#3331) is similar to #3332.

I'd be happy to contribute and welcome any feedback~ thx

ccs96307 avatar Jun 23 '25 16:06 ccs96307

Hi @WeiHaocheng,

Just following up on issue #3331 – I'm still interested in contributing and would love to help expand parameter support in the TRTLLM worker.

Please let me know if there are any specific directions or details you'd like me to consider.

Looking forward to your feedback. Thanks!

ccs96307 avatar Jul 10 '25 09:07 ccs96307

Hi, I reproduced the current sampling-parameter gap and would like to contribute if this issue is still available.

On current main (573bd5f0b8414566bd6183f74b06f8c8a99e6a69), the exact TRTLLMWorker.convert_task_params method preserves these seven fields:

max_tokens, temperature, top_p, top_k,
return_context_logits, num_logprobs -> logprobs, ignore_eos

However, the following fields are declared by both GenerationTask and the current SamplingParams API and are silently dropped:

best_of, frequency_penalty, min_tokens, n,
presence_penalty, seed, stop

The source-derived CPU fixture passed identically in three repetitions. This affects more than surface compatibility: the same Scaffolding controller can change reproducibility, stopping behavior, output-token cost, sample count, and sampling distribution when switched between an OpenAI worker and the in-process TRTLLM worker.

I see that @ccs96307 previously expressed interest, but there is no assignment or active PR visible. I do not want to overlap their work. Could a maintainer confirm ownership and approve a narrow backend-parity scope before implementation?

If available, I propose:

  1. map only fields with direct, documented SamplingParams semantics;
  2. explicitly reject or document fields that cannot be preserved, rather than silently dropping them;
  3. add parameterized CPU tests for defaults, non-default values, stop string/list, deterministic seed, and invalid cross-field combinations;
  4. avoid changing unrelated Scaffolding task/result APIs.

HOYALIM avatar Jul 15 '26 22:07 HOYALIM

Can I take up this issue @WeiHaocheng ?

nikJ13 avatar Aug 04 '26 03:08 nikJ13