[https://nvbugs/5451296][bug] Cherry-pick #7017 from release/1.0 branch (#7043)

Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
Co-authored-by: Iman Tabrizian <10105175+Tabrizian@users.noreply.github.com>
This commit is contained in:
Yanchao Lu 2025-08-19 23:25:05 +08:00 committed by GitHub
parent e07fcc3a22
commit d26a5a93ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -428,23 +428,20 @@ class TestTorchLlmArgs:
@print_traceback_on_error
def test_runtime_sizes(self):
llm = TorchLLM(
llama_model_path,
max_beam_width=1,
max_num_tokens=256,
max_seq_len=128,
max_batch_size=8,
)
with TorchLLM(llama_model_path,
max_beam_width=1,
max_num_tokens=256,
max_seq_len=128,
max_batch_size=8) as llm:
assert llm.args.max_beam_width == 1
assert llm.args.max_num_tokens == 256
assert llm.args.max_seq_len == 128
assert llm.args.max_batch_size == 8
assert llm.args.max_beam_width == 1
assert llm.args.max_num_tokens == 256
assert llm.args.max_seq_len == 128
assert llm.args.max_batch_size == 8
assert llm._executor_config.max_beam_width == 1
assert llm._executor_config.max_num_tokens == 256
assert llm._executor_config.max_seq_len == 128
assert llm._executor_config.max_batch_size == 8
assert llm._executor_config.max_beam_width == 1
assert llm._executor_config.max_num_tokens == 256
assert llm._executor_config.max_seq_len == 128
assert llm._executor_config.max_batch_size == 8
def test_dynamic_setattr(self):
with pytest.raises(pydantic_core._pydantic_core.ValidationError):