Skip to content

Conversation

@Wangdai-0800
Copy link
Collaborator

No description provided.

@Wangdai-0800 Wangdai-0800 force-pushed the add_tpot branch 13 times, most recently from eef16f8 to 025208d Compare November 20, 2025 06:52
}

// NewGeneralRLS create RLS instance,dim is the number of varaiant (exclude const)
func NewGeneralRLS(dim int, forget float64) *RecursiveLeastSquares {
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. Expand the loop and decrease the time cost of Update() by 5 times;
Before:
6aeb006c6e28c8aff4046d4cb6c89cd5
After:
06aeb4c77f214d8c6d423723f8010cb7

@Wangdai-0800 Wangdai-0800 force-pushed the add_tpot branch 7 times, most recently from fe06fd4 to 098012e Compare November 20, 2025 11:20
P[i][i] = 1e6
}
return &TpotRecursiveLeastSquares{
dim: TPOT_COEFF_NUM,
Copy link
Contributor

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]
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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

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