Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c13040e
add test_glm_image_expansion.py
chickeyton Mar 23, 2026
20f515b
enhancement
chickeyton Mar 23, 2026
8914d7c
add --stage-configs-path
chickeyton Mar 24, 2026
714b69d
add --stage-configs-path
chickeyton Mar 24, 2026
2c630c1
enhancement
chickeyton Mar 24, 2026
0cba929
bugfix
chickeyton Mar 25, 2026
b97cae5
bugfix
chickeyton Mar 25, 2026
bb829e8
bugfix
chickeyton Mar 25, 2026
67c3d94
fix code check issues
chickeyton Mar 25, 2026
0cae2da
fix code check issues
chickeyton Mar 25, 2026
de68a4d
fix code check issues
chickeyton Mar 25, 2026
398410d
fix code check issues
chickeyton Mar 25, 2026
8cf627e
fix code check issues
chickeyton Mar 25, 2026
027c091
update comments
chickeyton Mar 25, 2026
0c2b2f2
update comments
chickeyton Mar 26, 2026
062434e
fix codecheck comments
chickeyton Mar 27, 2026
f4f9f16
Merge branch 'main' into glm-image-tests
chickeyton Mar 27, 2026
1a15a18
fix codecheck issues
chickeyton Mar 27, 2026
a443e3c
Merge branch 'glm-image-tests' of https://github.com/chickeyton/vllm-…
chickeyton Mar 27, 2026
237ce7a
Merge branch 'main' into glm-image-tests
Gaohan123 Mar 27, 2026
1598a9a
Merge branch 'main' into glm-image-tests
wtomin Apr 8, 2026
64323e5
reslove conflicts
chickeyton Apr 29, 2026
a86a9a2
update import path
chickeyton Apr 29, 2026
2f2fbec
update import path
chickeyton Apr 29, 2026
3ded31e
update import path
chickeyton Apr 29, 2026
9c47afd
bug fix
chickeyton Apr 30, 2026
ade07be
enhancement
chickeyton Apr 30, 2026
f1f2eaf
Merge branch 'main' into glm-image-tests
chickeyton Apr 30, 2026
aa17f9b
Merge branch 'main' into glm-image-tests
Gaohan123 Apr 30, 2026
904a0c7
bugfix
chickeyton Apr 30, 2026
9134fb9
Merge branch 'glm-image-tests' of https://github.com/chickeyton/vllm-…
chickeyton Apr 30, 2026
b845ea5
bugfix
chickeyton Apr 30, 2026
607f930
bugfix
chickeyton Apr 30, 2026
32a13f8
bugfix
chickeyton Apr 30, 2026
dbaaa16
Merge branch 'main' into glm-image-tests
chickeyton Apr 30, 2026
493271a
change to full_model
chickeyton Apr 30, 2026
71f49da
print vllm ver in CI
chickeyton Apr 30, 2026
8329b4f
Merge branch 'main' into glm-image-tests
chickeyton Apr 30, 2026
81a53d0
save input output images
chickeyton May 4, 2026
492d979
Merge branch 'glm-image-tests' of https://github.com/chickeyton/vllm-…
chickeyton May 4, 2026
058b985
Merge branch 'main' into glm-image-tests
chickeyton May 5, 2026
2a5dc93
Merge branch 'main' into glm-image-tests
hsliuustc0106 May 28, 2026
6c59c9e
Merge branch 'main' into glm-image-tests
congw729 May 28, 2026
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
1 change: 1 addition & 0 deletions .buildkite/test-amd-ready.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ steps:
mirror_hardwares: [amdproduction]
grade: Blocking
commands:
- pip list|grep vllm
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
- |
timeout 15m bash -c '
Expand Down
77 changes: 77 additions & 0 deletions tests/e2e/online_serving/test_glm_image_expansion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"""
Comprehensive tests of diffusion features that are available in online serving mode
and are supported by the following models:
- GLM-Image: single image & text input
CFG-Parallel and Tensor-Parallel features are covered
"""

import random
import shutil

import pytest

from tests.helpers.mark import hardware_marks
from tests.helpers.media import generate_synthetic_image
from tests.helpers.runtime import (
OmniServer,
OmniServerParams,
OpenAIClientHandler,
dummy_messages_from_mix_data,
)

EDIT_PROMPT = "Transform this modern, geometrist image into a Vincent van Gogh style impressionist painting."
SINGLE_CARD_FEATURE_MARKS = hardware_marks(res={"cuda": "H100"})
PARALLEL_FEATURE_MARKS = hardware_marks(res={"cuda": "H100"}, num_cards=2)


# This test file targets two models, so I write a helper function.
# If a similar test only involves one model, one can just define a global list variable.
def _get_diffusion_feature_cases(model: str):
return [
pytest.param(
OmniServerParams(
model=model,
server_args=[],
),
id="basic_001",
marks=SINGLE_CARD_FEATURE_MARKS,
),
]


@pytest.mark.full_model
@pytest.mark.diffusion
@pytest.mark.parametrize(
"omni_server",
_get_diffusion_feature_cases("zai-org/GLM-Image"),
indirect=True,
)
def test_glm_image(omni_server: OmniServer, openai_client: OpenAIClientHandler):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Currently, this test is not selected by any step in test-nightly.yml. Considering adding this test at the step Diffusion X2I(&A&T) · Function Test with H100 · Single-GPU ?

"""Test all diffusion features with GLM-Image in regular end-user scenarios."""
image_size = 1024
synthetic_image = generate_synthetic_image(image_size, image_size)
image_data_url = f"data:image/jpeg;base64,{synthetic_image['base64']}"

messages = dummy_messages_from_mix_data(image_data_url=image_data_url, content_text=EDIT_PROMPT)

# CFG parallel is only activated when a negative prompt and true_cfg_scale > 1.0 are both present
request_config = {
"model": omni_server.model,
"messages": messages,
"extra_body": {
"height": image_size,
"width": image_size,
"num_inference_steps": 2,
"guidance_scale": 1.5,
"true_cfg_scale": 4.0,
"seed": 42,
},
}

responses = openai_client.send_diffusion_request(request_config)

pair_id = random.randint(10**8, 10**9 - 1)
shutil.copyfile(synthetic_image["file_path"], f"in_{pair_id}.jpg")
for response in responses:
for i, image in enumerate(response.images) or ():
image.convert("RGB").save(f"out_{pair_id}_{i}.jpg", format="JPEG")
13 changes: 13 additions & 0 deletions vllm_omni/model_executor/models/glm_image/glm_image_ar.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ def get_data_parser(self) -> GlmImageDataParser:
expected_hidden_size=self._get_expected_hidden_size(),
)

def parse_mm_data(
self,
mm_data: MultiModalDataDict,
*,
validate: bool = True,
) -> MultiModalDataItems:
# Remap "img2img" → "image" *in-place* so that every downstream
# consumer (hashes, kwargs, prompt-updates, _validate_mm_uuids)
# sees a single, consistent modality key.
if "img2img" in mm_data and "image" not in mm_data:
mm_data["image"] = mm_data.pop("img2img")
return super().parse_mm_data(mm_data, validate=validate)

def get_supported_mm_limits(self) -> Mapping[str, int | None]:
# GLM-Image is an image GENERATION model that supports:
# - Text-to-image (t2i): no multimodal input needed
Expand Down
Loading