[Docs][CI] doc update & L4 example test for text-to-image page#1910
Conversation
There was a problem hiding this comment.
Pull request overview
Adds L4 “examples” tests for the text-to-image documentation (online serving + offline inference), and introduces shared helpers/fixtures to extract and execute README code blocks.
Changes:
- Add online serving text-to-image example tests and offline inference tests driven by README snippet extraction.
- Introduce
tests/examples/conftest.pywith shared output-dir fixture, README snippet extraction, and subprocess helpers. - Refactor existing online serving Qwen Omni example tests to reuse shared helpers; update docs/snippets accordingly.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/examples/online_serving/test_text_to_image.py | New online-serving text-to-image example tests (curl + Python client + LoRA). |
| tests/examples/offline_inference/test_text_to_image.py | New offline text-to-image example tests that execute extracted README snippets and validate outputs. |
| tests/examples/conftest.py | New shared infra: output dir fixture, README snippet parsing, runner, subprocess + parsing helpers. |
| tests/examples/online_serving/test_qwen3_omni.py | Remove local helper duplication; import shared helpers; align module markers/docstring. |
| tests/examples/online_serving/test_qwen2_5_omni.py | Same refactor as qwen3_omni. |
| pyproject.toml | Add mistune dependency for README AST parsing in example tests. |
| examples/offline_inference/text_to_image/README.md | Fix example code (don’t assign .save() result) and replace non-ASCII comma characters. |
| docs/contributing/ci/tests_style.md | Document examples→tests mapping in the test style guide. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc23c952e7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
How to trigger this L4 text-to-image example test temporally on the CI machine? I think H100 machine can accomodate the VRAM requirements of majority of models. |
I just edited the pipeline yamls to temporarily do so. Could you help add a ready tag to trigger CI? |
|
When it is ready to merge (which I suppose should be after 3/17), please let me know. @fhfuih |
| Use one of the following patterns depending on page type: | ||
|
|
||
| - **Dynamic code-block extraction (preferred for offline docs)** | ||
| - Extract Python/Bash code blocks from markdown AST analyzer, then execute them directly in tests. See [https://github.com/vllm-project/vllm-omni/blob/main/tests/examples/offline_inference/test_text_to_image.py](https://github.com/vllm-project/vllm-omni/blob/main/tests/examples/offline_inference/test_text_to_image.py) for reference implementation. |
There was a problem hiding this comment.
Perhaps we can also briefly explain here how to write such test cases and what parameters ExampleRunner support.
There was a problem hiding this comment.
Done. Please check again
|
conflicts |
There was a problem hiding this comment.
This file is to explicitly exclude the newly add .inc.md file.
Previously without this file, all *.md files in this folder are implicitly added to doc. Now that L4 tests receive additional guides, I put them in separate subfiles to avoid cluttering CI_5levels.md. This is the same design pattern as docs/getting_started/installation/...
There was a problem hiding this comment.
Apart from adding doc test guides to L4 test documentation, I also change the previous <details><summary>... fold block to MkDocs-native ???+ example ... fold block syntax. Everything in the former block is expected to be HTML, not markdown, so all formatting is lost. The original content in this block is only indented
|
Please see the updated comment below
@hsliuustc0106 @wtomin @yenuo26 @congw729 PTAL. I also added some self-comment (annotations) to some of my file changes above, for the sake of clarification. |
hsliuustc0106
left a comment
There was a problem hiding this comment.
Review Summary
This PR establishes a solid foundation for L4 documentation example testing with a well-designed approach:
- Dynamic extraction from markdown for offline tests keeps docs and tests synchronized
- Copied scripts for online tests handles server/client complexity appropriately
- Comprehensive documentation for future contributors in
doc_example_tests.inc.md
✅ Validated
- Gate checks passing (DCO, pre-commit, mergeable, build, CI)
- Test infrastructure design follows good patterns
- Documentation updates are appropriate and complete
- PR description includes clear test plan and naming conventions
- Skip conditions for known issues (FLUX.2-dev, Web UI Demo) are reasonable
📝 Minor (non-blocking)
- PR description checklist has docs unchecked but docs are updated - minor inconsistency
write_zimage_loraduplication noted as TODO in code
Good work on establishing this testing pattern for the project!
Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
|
With recent rebase, the HF token issue is fixed, and now FLUX model can run as well. All tests pass in this CI: https://buildkite.com/vllm/vllm-omni/builds/4472/steps/canvas?sid=019d056d-120a-4acb-9924-3457e40176e5 The temporary modifications to CI pipelines have been reverted |
Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
|
Fixed conflict in doc. Not affecting previous test results |
…project#1910) Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com> Signed-off-by: hongyi.zhang <hongyi.zhang@bytedance.com>
…project#1910) Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
…project#1910) Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
Purpose
As per #1244 , there is the need to update example documentation.
Also to follow the recent establishment of multi-level testing system, this PR adds L4 test for all the example code snippets appeared on "Online Serving/Text to Image" and "Offline Inference/Text to Image" doc pages. It can also serve as an example for future contribution of other example tests.
Test Plan
Methods
Per offline discussion with @yenuo26 and @wtomin , the offline version tries to dynamically extract all python and bash code blocks in the markdown file and directly run them.
Meanwhile, this approach is currently not used in the online version, because we have to additionally tell server-launching scripts from client-request-sending scripts; the code can become way messier. Hence, the online version copies the codes from the code blocks. (More flexible for complex setup, but requires future doc changes to sync with test script)
Runtime config
Currently, we decide to try not lowering down
num_inference_stepsin examples. Thus, a test script may run 50 inference steps. This is to fully recreate real-world scenarios of running these examples.Test naming rule
NOTE, open to discussion: Due to the different approaches in online and offline tests (elaborated above), their test cases have different naming conventions
omni_serverdependency injection]Exclusion Rule
Output folder structure
Three-layer folder structure:
OUTPUT_DIRenv variable, otherwise pytest auto-creates one under/tmptest_XXX.pyfile, can include opinionated abbreviations. Example:example_offline_t2ibasic_usage_001. This is automatically done when dynamically extracting code from markdown. But for the case of manually copying code content, still need to pay attention to this.output.png. (The dynamically extracted python scripts are also saved here)Example file output:
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. Please runmkdocs serveto sync the documentation editions to./docs.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)