Skip to content

Add end-to-end sampling controls to the LLM server worker protocol - #21561

Open
metascroy wants to merge 1 commit into
mainfrom
support-sampling-params
Open

Add end-to-end sampling controls to the LLM server worker protocol#21561
metascroy wants to merge 1 commit into
mainfrom
support-sampling-params

Conversation

@metascroy

Copy link
Copy Markdown
Contributor

Summary

Add end-to-end sampling controls to the LLM server worker protocol.

  • Plumb top_p, top_k, and seed from chat completion requests through the Python runtime and JSONL worker protocol.
  • Extend the C++ worker sampling configuration while preserving existing defaults and greedy behavior.
  • Validate sampling parameters at the API boundary and document their supported ranges and semantics.
  • Add coverage for request validation, worker serialization, session propagation, and C++ protocol handling.

Test Plan

  • Ran the focused Python LLM server test suite: 78 tests passed.
  • Built the C++ worker integration successfully.
  • Verified deterministic output for repeated seeded requests, different output for different or omitted seeds, and expected behavior for top_p and top_k.
  • Verified invalid sampling values return HTTP 400 responses.

@pytorch-bot

pytorch-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21561

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 17 Pending

As of commit d91c02e with merge base 4b4df96 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 3, 2026
@metascroy

Copy link
Copy Markdown
Contributor Author

@claude review this code

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant