Skip to content

Commit 7f51a3e

Browse files
committed
fix: resolve documentation and YAML sync issues for Chameleon-7B
- Fix markdown formatting: wrap URLs in angle brackets, add blank lines after headers - Add YAML test case structure for configuration validation - Add YAML sync metadata blocks for documentation verification - Link environment variables and server command to test configuration - Ensure compliance with pre-commit hooks and sphinx documentation requirements Signed-off-by: yangzhe-2026 <yangzhe@isrc.iscas.ac.cn>
1 parent ba34650 commit 7f51a3e

2 files changed

Lines changed: 58 additions & 7 deletions

File tree

‎docs/source/tutorials/models/chameleon.md‎

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
## Prerequisites
1515

1616
### Hardware Requirements
17+
1718
- **Recommended**: Huawei Ascend 910B/C (for optimal performance)
1819
- **Minimum**: Ascend 910A or Atlas A2 Series
1920
- **Memory**: ≥ 32GB HBM for fp32, ≥ 16GB for bfloat16
2021

2122
### Software Requirements
23+
2224
- vLLM Ascend runtime installed
2325
- Python 3.9+
2426
- vLLM >= 0.6.0
@@ -37,6 +39,32 @@ pip install vllm-ascend
3739
python -c "import vllm; print(vllm.__version__)"
3840
```
3941

42+
### Environment Variables for Ascend NPU
43+
44+
```{test} bash
45+
:sync-yaml: tests/e2e/models/configs/chameleon-7b.yaml
46+
:sync-target: test_cases[0].envs
47+
:sync-class: env
48+
49+
export VLLM_ATTENTION_BACKEND=ascend
50+
export ENFORCE_EAGER=1
51+
```
52+
53+
### vLLM Serve Command
54+
55+
```{test} bash
56+
:sync-yaml: tests/e2e/models/configs/chameleon-7b.yaml
57+
:sync-target: test_cases[0].model test_cases[0].server_cmd
58+
:sync-class: cmd
59+
60+
vllm serve "facebook/chameleon-7b" \
61+
--dtype bfloat16 \
62+
--max-model-len 2048 \
63+
--gpu-memory-utilization 0.75 \
64+
--enforce-eager \
65+
--trust-remote-code
66+
```
67+
4068
## Quick Start: Text-Only Generation
4169

4270
### 1. Basic Text Generation
@@ -280,18 +308,21 @@ outputs = llm.generate(["Prompt"], sampling_params)
280308
## Important Notes for Ascend Deployment
281309

282310
### Memory Considerations
311+
283312
- **Image Expansion**: Each image can expand to 500-2000 tokens depending on resolution
284313
- **Batch Processing**: Monitor total tokens (text + image tokens) not exceeding `max_model_len`
285314
- **Mixed Precision**: Use bfloat16 to balance performance and memory usage
286315

287316
### Known Limitations
317+
288318
1. **enforce_eager=True required**: Graph compilation is not fully supported for Chameleon on Ascend
289319
2. **Single-card inference**: Currently optimized for single-card; tensor parallelism experimental
290320
3. **Image formats**: Supports JPEG, PNG, WebP (32KB-10MB recommended)
291321

292322
### Troubleshooting
293323

294324
**Issue: "CUDA out of memory"**
325+
295326
```python
296327
# Solution: Reduce max_model_len or batch_size
297328
llm = LLM(
@@ -302,6 +333,7 @@ llm = LLM(
302333
```
303334

304335
**Issue: Image token limit exceeded**
336+
305337
```python
306338
# Resize images before inference
307339
from PIL import Image
@@ -315,6 +347,7 @@ def resize_image(image_path: str, max_size: int = 1024) -> str:
315347
```
316348

317349
**Issue: Slow generation speed**
350+
318351
```python
319352
# Check Ascend utilization and adjust batch size
320353
import os
@@ -406,15 +439,16 @@ if __name__ == "__main__":
406439

407440
## Additional Resources
408441

409-
- **HuggingFace Model Card**: https://huggingface.co/facebook/chameleon-7b
410-
- **vLLM Documentation**: https://docs.vllm.ai/
411-
- **vLLM Ascend Guide**: https://docs.vllm.ai/projects/ascend/
412-
- **Ascend CANN Toolkit**: https://www.hiascend.com/
413-
- **Chameleon Paper**: https://arxiv.org/abs/2405.09818
442+
- **HuggingFace Model Card**: <https://huggingface.co/facebook/chameleon-7b>
443+
- **vLLM Documentation**: <https://docs.vllm.ai/>
444+
- **vLLM Ascend Guide**: <https://docs.vllm.ai/projects/ascend/>
445+
- **Ascend CANN Toolkit**: <https://www.hiascend.com/>
446+
- **Chameleon Paper**: <https://arxiv.org/abs/2405.09818>
414447

415448
## Support & Feedback
416449

417450
For issues or questions:
418-
- **GitHub Issues**: https://github.com/vllm-project/vllm-ascend/issues
419-
- **vLLM Community**: https://github.com/vllm-project/vllm/discussions
451+
452+
- **GitHub Issues**: <https://github.com/vllm-project/vllm-ascend/issues>
453+
- **vLLM Community**: <https://github.com/vllm-project/vllm/discussions>
420454

‎tests/e2e/models/configs/chameleon-7b.yaml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ model_name: "facebook/chameleon-7b"
1212
model_type: "vllm-vlm"
1313
hardware: "Atlas A2 Series"
1414

15+
# Test case configuration for Chameleon-7B multimodal model
16+
test_cases:
17+
- name: "Chameleon-7B-Multimodal-Case"
18+
model: "facebook/chameleon-7b"
19+
envs:
20+
VLLM_ATTENTION_BACKEND: "ascend"
21+
ENFORCE_EAGER: "1"
22+
server_cmd:
23+
- "--dtype"
24+
- "bfloat16"
25+
- "--max-model-len"
26+
- "2048"
27+
- "--gpu-memory-utilization"
28+
- "0.75"
29+
- "--enforce-eager"
30+
- "--trust-remote-code"
31+
1532
# Serving configuration with Ascend NPU optimizations
1633
serve:
1734
# Tensor parallelism: 1 for single-card inference

0 commit comments

Comments
 (0)