Add extrapolation to fork module#68
Open
Suad0 wants to merge 1 commit into
Open
Conversation
elftausend
requested changes
Nov 16, 2024
| // Extrapolate if input is outside known range | ||
| if input_lengths_sum < anals.first().unwrap().input_lengths.iter().sum::<usize>() { | ||
| let lhs = &anals[0]; | ||
| let rhs = &anals[1]; |
Owner
There was a problem hiding this comment.
At this stage, there could be only a single analyzation in the vector. Therefore, this can panic
| let rhs = &anals[1]; | ||
| return self.extrapolate_and_execute(lhs, rhs, input_lengths_sum, cpu_op, gpu_op); | ||
| } else if input_lengths_sum > anals.last().unwrap().input_lengths.iter().sum::<usize>() { | ||
| let lhs = &anals[anals.len() - 2]; |
| let input_lengths_sum = input_lengths.iter().sum::<usize>(); | ||
|
|
||
| // Extrapolate if input is outside known range | ||
| if input_lengths_sum < anals.first().unwrap().input_lengths.iter().sum::<usize>() { |
Owner
There was a problem hiding this comment.
There is no chance to add new data points as the interpolation step takes any two analyzations (lhs, rhs) where the new analyzation (x) input size sum is lhs_input_sum <= x_input_sum <= rhs_input_sum.
Hence the max analyzations amount would be 2 ig
| let new_cpu_dur = lhs.cpu_dur.as_secs_f32() | ||
| + 0.5 * (rhs.cpu_dur.as_secs_f32() - lhs.cpu_dur.as_secs_f32()); | ||
| + (input_lengths_sum - input_lengths_lhs) as f32 | ||
| / (input_lengths_rhs - input_lengths_lhs) as f32 |
Owner
There was a problem hiding this comment.
could leave this factor at 0.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.