Skip to content

Commit d708398

Browse files
committed
Rename prefill-overhead-complexity to prefill-complexity
Signed-off-by: Qifan Deng <[email protected]>
1 parent a79c33d commit d708398

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

pkg/common/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ type Configuration struct {
6767
TimeToFirstTokenStdDev int `yaml:"time-to-first-token-std-dev" json:"time-to-first-token-std-dev"`
6868

6969
// PrefillOverhead time taken to prefill the context, in milliseconds
70-
PrefillOverhead int `yaml:"prefill-overhead" json:"prefill-overhead"`
71-
PrefillOverheadComplexity string `yaml:"prefill-overhead-complexity" json:"prefill-overhead-complexity"`
70+
PrefillOverhead int `yaml:"prefill-overhead" json:"prefill-overhead"`
71+
PrefillComplexity string `yaml:"prefill-complexity" json:"prefill-complexity"`
7272

7373
// InterTokenLatency time between generated tokens, in milliseconds
7474
InterTokenLatency int `yaml:"inter-token-latency" json:"inter-token-latency"`
@@ -303,11 +303,11 @@ func (c *Configuration) validate() error {
303303
if c.PrefillOverhead < 0 {
304304
return errors.New("prefill overhead cannot be negative")
305305
} else if c.PrefillOverhead == 0 {
306-
if c.PrefillOverheadComplexity != "" {
306+
if c.PrefillComplexity != "" {
307307
return errors.New("prefill overhead complexity is set, but prefill overhead is 0")
308308
}
309309
}
310-
if c.PrefillOverheadComplexity != "" && c.PrefillOverheadComplexity != "n^2" && c.PrefillOverheadComplexity != "nlog(n)" {
310+
if c.PrefillComplexity != "" && c.PrefillComplexity != "n^2" && c.PrefillComplexity != "nlog(n)" {
311311
return errors.New("prefill overhead complexity should be either \"n^2\" or \"nlog(n)\"")
312312
}
313313
if c.KVCacheTransferLatency < 0 {
@@ -416,7 +416,7 @@ func ParseCommandParamsAndLoadConfig() (*Configuration, error) {
416416
f.IntVar(&config.InterTokenLatency, "inter-token-latency", config.InterTokenLatency, "Time to generate one token (in milliseconds)")
417417
f.IntVar(&config.TimeToFirstToken, "time-to-first-token", config.TimeToFirstToken, "Time to first token (in milliseconds)")
418418
f.IntVar(&config.PrefillOverhead, "prefill-overhead", config.PrefillOverhead, "Time to prefill in milliseconds. This argument is ignored if <time-to-first-token> is not 0.")
419-
f.StringVar(&config.PrefillOverheadComplexity, "prefill-overhead-complexity", config.PrefillOverheadComplexity, "Complexity of prefill based on token length. Options are \"n^2\" and \"nlog(n)\". Default is \"n^2\".")
419+
f.StringVar(&config.PrefillComplexity, "prefill-complexity", config.PrefillComplexity, "Complexity of prefill based on token length. Options are \"n^2\" and \"nlog(n)\". Default is \"n^2\".")
420420
f.IntVar(&config.KVCacheTransferLatency, "kv-cache-transfer-latency", config.KVCacheTransferLatency, "Time for KV-cache transfer from a remote vLLM (in milliseconds)")
421421
f.IntVar(&config.InterTokenLatencyStdDev, "inter-token-latency-std-dev", config.InterTokenLatencyStdDev, "Standard deviation for time between generated tokens (in milliseconds)")
422422
f.IntVar(&config.TimeToFirstTokenStdDev, "time-to-first-token-std-dev", config.TimeToFirstTokenStdDev, "Standard deviation for time before the first token will be returned (in milliseconds)")

pkg/common/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ var _ = Describe("Simulator configuration", func() {
389389
args: []string{"cmd", "--config", "../../manifests/invalid-config.yaml"},
390390
},
391391
{
392-
name: "<prefill-overhead> must be set when <prefill-overhead-complexity> is set",
393-
args: []string{"cmd", "--prefill-overhead-complexity", "n^2", "--config", "../../manifests/config.yaml"},
392+
name: "<prefill-overhead> must be set when <prefill-complexity> is set",
393+
args: []string{"cmd", "--prefill-complexity", "n^2", "--config", "../../manifests/config.yaml"},
394394
},
395395
}
396396

pkg/llm-d-inference-sim/simulator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ func (s *VllmSimulator) getTotalInterTokenLatency(numOfTokens int) int {
690690
// calc the prefill overhead against number of tokens
691691
func (s *VllmSimulator) calcPrefillOverhead(nPromptTokens int) int {
692692
pfOverhead := s.config.PrefillOverhead
693-
complexity := s.config.PrefillOverheadComplexity
693+
complexity := s.config.PrefillComplexity
694694
// policies of different complexities of prefill implementation
695695
switch complexity {
696696
case "n^2", "":

pkg/llm-d-inference-sim/simulator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ var _ = Describe("Simulator", func() {
859859

860860
DescribeTable("time to first token is log-linear of prefill against number of prompt tokens",
861861
func(prefillOverhead int, tolerance float64, minNTokens int, maxNTokens int) {
862-
simulator.config.PrefillOverheadComplexity = "nlog(n)"
862+
simulator.config.PrefillComplexity = "nlog(n)"
863863

864864
for nTokens := minNTokens; nTokens <= maxNTokens; nTokens++ {
865865
nlogn := int(float64(prefillOverhead) * float64(nTokens) * math.Log2(float64(nTokens)))

0 commit comments

Comments
 (0)