Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lightllm/server/api_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ def normal_or_p_d_start(args):
else:
args.visual_nccl_ports = args.visual_nccl_ports[: args.visual_dp]

if args.visual_dp <= 0:
raise ValueError("visual_dp must be a positive integer.")

# 检查visual_infer_batch_size是否合理
if args.visual_infer_batch_size // args.visual_dp < 1 or args.visual_infer_batch_size % args.visual_dp != 0:
raise ValueError(
f"visual_infer_batch_size ({args.visual_infer_batch_size}) must be "
f"a positive integer multiple of visual_dp ({args.visual_dp})"
)
Comment on lines +165 to +169
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The error message could be improved to provide more context. Consider including the expected relationship between visual_infer_batch_size and visual_dp in the message to help users understand the requirement.

        raise ValueError(
            f"visual_infer_batch_size ({args.visual_infer_batch_size}) must be a positive integer multiple of visual_dp ({args.visual_dp})."
            f" Ensure that visual_infer_batch_size is divisible by visual_dp and that the result is at least 1."
        )


if args.disable_chunked_prefill:
args.chunked_prefill_size = args.max_req_total_len
# 普通模式下
Expand Down