Skip to content

[None][docs] Fix beamWidth default value and valid range in gpt-runtime.md#14493

Open
fuergaosi233 wants to merge 1 commit into
NVIDIA:mainfrom
fuergaosi233:fix/gpt-runtime-beamwidth-default-value
Open

[None][docs] Fix beamWidth default value and valid range in gpt-runtime.md#14493
fuergaosi233 wants to merge 1 commit into
NVIDIA:mainfrom
fuergaosi233:fix/gpt-runtime-beamwidth-default-value

Conversation

@fuergaosi233
Copy link
Copy Markdown

@fuergaosi233 fuergaosi233 commented May 23, 2026

Background

docs/source/legacy/advanced/gpt-runtime.md documents beamWidth with an incorrect default value and an invalid minimum range. The table states:

| `beamWidth` | ... | [0, 1024] | `0` (disable beam search) |

However, the C++ source code tells a different story.

Code Evidence

cpp/include/tensorrt_llm/runtime/samplingConfig.h:

// Line 107 — default is 1, not 0:
explicit SamplingConfig(SizeType32 beamWidth = 1)

// Line 245 — 0 is explicitly invalid:
valid &= (beamWidth > 0);

// Line 249 — error message confirms 0 is rejected:
"Requested beam width %d is incorrect. Must be > 0. To de-activate beam searching set beamWidth to 1."

The code:

  1. Defaults beamWidth to 1 (not 0)
  2. Validates that beamWidth > 0 — value 0 is INVALID and triggers an error
  3. Explicitly states that beam search is disabled by setting beamWidth = 1, not 0

Changes

-|        `beamWidth`        | width for beam-search algorithm |         Int         |       \[0, 1024\]        | `0` (disable beam search) |
+|        `beamWidth`        | width for beam-search algorithm |         Int         |       \[1, 1024\]        | `1` (greedy/sampling; beam search disabled) |
  • Correct the minimum range from [0, 1024] to [1, 1024]
  • Correct the default from 0 to 1
  • Align the description with the error message in samplingConfig.h

Summary by CodeRabbit

  • Documentation
    • Updated the beamWidth parameter documentation with revised default value, allowed range, and clarification on beam search behavior.

Review Change Stack

…me.md

Signed-off-by: holegots <fuergaosi@gmail.com>
@fuergaosi233 fuergaosi233 requested a review from a team as a code owner May 23, 2026 19:32
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 243a730a-1b88-48dd-b90b-38e8a5359a93

📥 Commits

Reviewing files that changed from the base of the PR and between c5b0372 and 90374fd.

📒 Files selected for processing (1)
  • docs/source/legacy/advanced/gpt-runtime.md

📝 Walkthrough

Walkthrough

This PR updates the documentation for the beamWidth sampling parameter in the GPT runtime configuration table, changing its default value from 0 to 1 and the valid range to start at 1 instead of 0, while adding clarification about when beam search is disabled versus enabled.

Changes

beamWidth Parameter Documentation

Layer / File(s) Summary
beamWidth parameter documentation
docs/source/legacy/advanced/gpt-runtime.md
Updated the beamWidth parameter row in the beam-search configuration table to change the default value from 0 to 1, update the valid range to start at 1, and clarify that beam search is disabled under the default greedy/sampling setting.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the beamWidth default value and valid range in the documentation file.
Description check ✅ Passed The description comprehensively explains the issue, provides code evidence, and clearly documents the changes, though some PR checklist items are not completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant