Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Sampling Parameters related improvements #80

Merged
merged 9 commits into from
Jan 9, 2025

Conversation

oandreeva-nv
Copy link
Contributor

What does the PR do?

This PR removes dependencies on vllm.SamplingParams names, present in _get_sampling_params_dict in favor of dynamically checking sampling parameters passed with the request with vllm.SamplingParams.__annotations__

Previously, we needed to keep track about SamplingParams members and their types: e.g. float keys as defined here.
I suggest to infer the type from vllm.SamplingParams.__annotations__ and for simple ones (int, float, bool, str, Optional[int]) perform a conversion from string to the expected type. Suggested logic is implemented here.

Also added proper handling of "guided_generation" parameter for constrained decoding test. Limited test added in accuracy_tests

Misc:

Fixed some inconsistencies with error response for LoRA-based inference via generate endpoint with parameters passed through "parameters" vs through client script with "sampling_parameters" input. Enhanced tests.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs:

Where should the reviewer start?

vllm_backend_utils.py -> main.py

Test plan:

  • CI Pipeline ID:

22089744

Caveats:

Background

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

@oandreeva-nv oandreeva-nv requested review from kthui and pskiran1 January 4, 2025 00:53
@pskiran1
Copy link
Member

pskiran1 commented Jan 8, 2025

LGTM!

kthui
kthui previously approved these changes Jan 9, 2025
Copy link
Contributor

@kthui kthui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Only minor comments, otherwise LGTM!

@@ -197,6 +317,22 @@ else
RET=1
fi
fi

# Test generate endpoint + LoRA enabled (boolean flag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Test generate endpoint + LoRA enabled (boolean flag)

LoRA enabled -> disabled ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@@ -243,6 +379,22 @@ else
RET=1
fi
fi

# Test generate endpoint + LoRA enabled (str flag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Test generate endpoint + LoRA enabled (str flag)

LoRA enabled -> disabled ?

@oandreeva-nv oandreeva-nv merged commit 80dd037 into main Jan 9, 2025
3 checks passed
@oandreeva-nv oandreeva-nv deleted the oandreeva_sampling_parameters branch January 9, 2025 20:14
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.

3 participants