Skip to content

Commit 210fa8a

Browse files
committed
Validate max-num-seqs
Signed-off-by: Qifan Deng <[email protected]>
1 parent 7550708 commit 210fa8a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/common/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ func (c *Configuration) validate() error {
373373
return errors.New("max model len cannot be less than 1")
374374
}
375375

376+
if c.MaxNumSeqs < 1 {
377+
return errors.New("max num seqs cannot be less than 1")
378+
}
379+
376380
for _, lora := range c.LoraModules {
377381
if lora.Name == "" {
378382
return errors.New("empty LoRA name")

pkg/common/config_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,16 @@ var _ = Describe("Simulator configuration", func() {
431431
args: []string{"cmd", "--data-parallel-size", "15",
432432
"--config", "../../manifests/config.yaml"},
433433
},
434+
{
435+
name: "invalid max-num-seqs",
436+
args: []string{"cmd", "--max-num-seqs", "0",
437+
"--config", "../../manifests/config.yaml"},
438+
},
439+
{
440+
name: "invalid max-num-seqs",
441+
args: []string{"cmd", "--max-num-seqs", "-1",
442+
"--config", "../../manifests/config.yaml"},
443+
},
434444
}
435445

436446
for _, test := range invalidTests {

0 commit comments

Comments
 (0)