-
Notifications
You must be signed in to change notification settings - Fork 7
feature: add prediction for TPOT #7
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
eef16f8 to
025208d
Compare
pkg/prediction/rls/rls.go
Outdated
| } | ||
|
|
||
| // NewGeneralRLS create RLS instance,dim is the number of varaiant (exclude const) | ||
| func NewGeneralRLS(dim int, forget float64) *RecursiveLeastSquares { |
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 do some benchmark, a normal RLS might not be a good performance way, check the ttft prediction way.
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.
fe06fd4 to
098012e
Compare
098012e to
57d1251
Compare
| P[i][i] = 1e6 | ||
| } | ||
| return &TpotRecursiveLeastSquares{ | ||
| dim: TPOT_COEFF_NUM, |
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.
useless? since TPOT_COEFF_NUM is a const
| phi[size-1] = 1.0 | ||
| y := 0.0 | ||
| for i := 0; i < size; i++ { | ||
| y += phi[i] * r.theta[i] |
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.
better to expand this for loop, like the TTFT calculation, for better performance.
| ) | ||
|
|
||
| // TpotPredictor | ||
| type TpotPredictor struct { |
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.
need a interface first, similar to ttft.
| } | ||
|
|
||
| // Predict | ||
| func (c *TpotPredictor) Predict(batchsize, totalTokenNum []uint64) []float64 { |
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.
predict for batch? nope, we just need a single API, similar to ttft prediction.
Predict(batchSize, totalTokenNum uint64) float64


No description provided.