[diffusion] CI: apply diffusers backend in lora case (#22157)
Co-authored-by: daiweitao <dwti614707404@163.com>
This commit is contained in:
@@ -43,6 +43,14 @@ from sglang.multimodal_gen.test.test_utils import (
|
|||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def _is_lora_case(case: DiffusionTestCase) -> bool:
|
||||||
|
return bool(
|
||||||
|
case.server_args.lora_path
|
||||||
|
or case.server_args.dynamic_lora_path
|
||||||
|
or case.server_args.second_lora_path
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def diffusion_server(case: DiffusionTestCase) -> ServerContext:
|
def diffusion_server(case: DiffusionTestCase) -> ServerContext:
|
||||||
"""Start a diffusion server for a single case and tear it down afterwards."""
|
"""Start a diffusion server for a single case and tear it down afterwards."""
|
||||||
@@ -65,9 +73,9 @@ def diffusion_server(case: DiffusionTestCase) -> ServerContext:
|
|||||||
sampling_params = case.sampling_params
|
sampling_params = case.sampling_params
|
||||||
extra_args = os.environ.get("SGLANG_TEST_SERVE_ARGS", "")
|
extra_args = os.environ.get("SGLANG_TEST_SERVE_ARGS", "")
|
||||||
|
|
||||||
# In GT generation mode, force --backend diffusers
|
# Keep LoRA GT on the normal backend path so adapter state matches CI.
|
||||||
if os.environ.get("SGLANG_GEN_GT", "0") == "1":
|
if os.environ.get("SGLANG_GEN_GT", "0") == "1":
|
||||||
if "--backend" not in extra_args:
|
if not _is_lora_case(case) and "--backend" not in extra_args:
|
||||||
extra_args = "--backend diffusers " + extra_args.strip()
|
extra_args = "--backend diffusers " + extra_args.strip()
|
||||||
|
|
||||||
extra_args += f" --num-gpus {server_args.num_gpus}"
|
extra_args += f" --num-gpus {server_args.num_gpus}"
|
||||||
@@ -853,9 +861,8 @@ Consider updating perf_baselines.json with the snippets below:
|
|||||||
# Check if we're in GT generation mode
|
# Check if we're in GT generation mode
|
||||||
is_gt_gen_mode = os.environ.get("SGLANG_GEN_GT", "0") == "1"
|
is_gt_gen_mode = os.environ.get("SGLANG_GEN_GT", "0") == "1"
|
||||||
|
|
||||||
# Dynamic LoRA loading test - tests LayerwiseOffload + set_lora interaction
|
# GT generation also needs the dynamic set_lora step before generation.
|
||||||
# Server starts WITHOUT lora_path, then set_lora is called after startup
|
if case.run_lora_dynamic_load_check:
|
||||||
if case.run_lora_dynamic_load_check and not is_gt_gen_mode:
|
|
||||||
self._test_dynamic_lora_loading(diffusion_server, case)
|
self._test_dynamic_lora_loading(diffusion_server, case)
|
||||||
|
|
||||||
generate_fn = get_generate_fn(
|
generate_fn = get_generate_fn(
|
||||||
|
|||||||
Reference in New Issue
Block a user