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

Update IPEX_LLM_PERFORMANCE_MODE with input length threshold #11908

Conversation

Oscilloscope98
Copy link
Contributor

Description

Update IPEX_LLM_PERFORMANCE_MODE with input length threshold.

@Oscilloscope98 Oscilloscope98 changed the title Update IPEX_LLM_PERFORMANCE_MODE with input length threshold Update IPEX_LLM_PERFORMANCE_MODE with input length threshold Aug 23, 2024
@Oscilloscope98 Oscilloscope98 requested a review from cyita August 23, 2024 10:10
if inputs_embeds.shape[1] >= PERFORMANCE_MODE_LOOKUP_INPUT_THRESHOLD:
lookahead = 2 # default to 2 now
else:
lookahead = 0
Copy link
Contributor Author

@Oscilloscope98 Oscilloscope98 Aug 23, 2024

Choose a reason for hiding this comment

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

We set lookahead=0 when meeting threshold but not directly use original generate function for performance mode benchmarking purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May have some further verification whether this way will bring too much overhead.

@Oscilloscope98 Oscilloscope98 marked this pull request as draft August 23, 2024 10:55
Comment on lines 67 to 69
else:
lookahead = 0
use_update_candidate_strategy = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Just set lookahead to None for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have updated :) But then the all-in-one benchmark may not work for now with input_len < 100 for performance mode

@Oscilloscope98 Oscilloscope98 marked this pull request as ready for review August 23, 2024 11:48
Copy link
Contributor

@jason-dai jason-dai left a comment

Choose a reason for hiding this comment

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

LGTM

@Oscilloscope98
Copy link
Contributor Author

Merge for now :) Will try to update the all-in-one benchmark tool in another PR accordingly next Monday.

@Oscilloscope98 Oscilloscope98 merged commit 24c279e into intel-analytics:main Aug 23, 2024
1 check passed
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.

2 participants