-
Notifications
You must be signed in to change notification settings - Fork 54
Unit Tests for On Device Sampling #463
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: quic-sanising <[email protected]>
@quic-sanising can you add a small feature description under /docs/source/quick_start.md supported feature section? also provide the example script link in the description |
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Done |
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
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.
Please fix lint error.
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
@quic-amitraj The lint failures were happening because the linter is installing To fix the errors, we need to either install |
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: Dhiraj Kumar Sah <[email protected]>
Signed-off-by: Dhiraj Kumar Sah <[email protected]>
Signed-off-by: sanising <[email protected]>
Signed-off-by: Rishin Raj <[email protected]>
@@ -1,7 +1,7 @@ | |||
repos: | |||
- repo: https://github.com/astral-sh/ruff-pre-commit | |||
# Ruff version. | |||
rev: v0.5.2 | |||
rev: v0.12.7 |
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.
why?
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.
Refer to my comment above: #463 (comment)
@@ -231,7 +231,6 @@ def main( | |||
tokenizer, | |||
prompts=prompt, | |||
device_id=device_group, | |||
prompt=prompt, |
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.
why?
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.
Some of the inference tests in the later stages of CI were failing. From the logs, prompt
was being passed twice to the same function. Not sure how this is not causing problems in the main
branch.
prompts = 'My name is', device_id = None, runtime_ai100 = True
kwargs = {'prompt': 'My name is', 'prompts_txt_file_path': 'examples/prompts.txt'}
> return QEfficient.cloud_ai_100_exec_kv(
tokenizer,
self.qpc_path,
prompt=prompts,
device_id=device_id,
generation_len=generation_len,
is_tlm=self.is_tlm,
**kwargs,
)
E TypeError: QEfficient.generation.text_generation_inference.cloud_ai_100_exec_kv() got multiple values for keyword argument 'prompt'
@quic-rishinr please feel free to comment.
examples/on_device_sampling.py
Outdated
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.
are the print statements intentional here?
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.
Yes, they are intentional. But let me know if you want any of them removed.
Signed-off-by: sanising <[email protected]>
Anything pending for this PR? @ochougul @quic-sanising |
Nothing from my end. Please go ahead with the merge if the CI has passed. |
This PR adds the following Unit Tests for On Device Sampling:
test_sampler_transform
: Test ifSamplerTransform
adds nodes at the output of aQEffForCausalLM model
to enable the sampling of next tokens at the device (instead of the host) and returns the next tokens and/or probability distributions.test_greedy_sampling
: Test greedy sampling with QPC compiled with and without On Device Sampling.test_random_sampling
: Test random sampling with QPC compiled with and without On Device Sampling.