-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
test: Add OpenAI frontend testing for LLM API backend #8040
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
python/openai/tests/conftest.py
Outdated
if LLMAPI_SETUP: | ||
model = "tensorrt_llm" | ||
else: | ||
model = "tensorrt_llm_bls" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to set backend = "llmapi"
and use the backend
fixture to check if llmapi in the tests, following similar patterns for vllm/trtllm in the existing tests?
ex:
server/python/openai/tests/test_chat_completions.py
Lines 313 to 316 in 205f13c
if backend != "tensorrtllm": | |
pytest.skip( | |
reason="Only used to test TRT-LLM-specific temperature behavior" | |
) |
Not sure what the config.pbtxt backend
field will be for LLM API though - so let me know what you're thinking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config.pbtxt backend
field will be python
for LLM API backend.
I thought that the LLM API backend is one of the tensorrtllm backends, so hence didn't have another "llmapi backend" fixture.
I think avoiding having an ENV makes more sense, however, right now the logic to determine which backend to use is to import tensorrtllm or vllm module and see if there's an import error, then set the backend and model name accordingly.
server/python/openai/tests/conftest.py
Lines 47 to 54 in 205f13c
try: | |
import tensorrt_llm as _ | |
backend = "tensorrtllm" | |
model = "tensorrt_llm_bls" | |
return backend, model | |
except ImportError: | |
print("No tensorrt_llm installation found.") |
Both general tensorrtllm and llmapi backend cases will import the tensorrtllm module successfully. I think some sort of flags would still be required to know if this is a general trtllm model or a llmapi one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config.pbtxt backend field will be python for LLM API backend.
Do we plan to add a python-based backend like vllm is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean making it backend: llmapi
in the config.pbtxt? I don't think there's a plan to do so right now. I could see it be less confusing having this after the pivot is more finalized, right now it's more like adding another python model just like the original one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right because they're not using the runtime
config.pbtxt feature currently, they just swapped the backend
to python instead, gotcha - makes sense.
Will the llmapi model.py
replace the existing model.py
in trtllm backend? Hopefully we're not planning to support 3 implementations for now 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree - confirming w/ TRT-LLM team on this.
python/openai/tests/conftest.py
Outdated
### TEST ENVIRONMENT SETUP ### | ||
LLMAPI_SETUP = os.environ.get("LLMAPI_SETUP", 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to clean up some of the if/else
everywhere for llmapi vs trtllm stuff, but hopefully we can consolidate the supported backend implementations once its a bit more mature.
I'll be able to merge this PR only after the LLM API backend MR is merged. Also pending on CI - having some issues with the build which are not related to the openai changes. I'll ask for final review once we're ready to merge. Thanks! |
Marking as draft for clarity - feel free to unmark it when ready |
What does the PR do?
Add OpenAI frontend testing for LLM API backend. Some of the test cases are skipped for now due to issues with the random seeds sampling parameter. Will follow up with the TRT-LLM team.
Checklist
<commit_type>: <Title>
Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs: LLM API backend MR.
Where should the reviewer start?
Test plan:
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)