Files
xc-llm-ascend/examples
NJX 9b30d4e774 [Doc][Misc] Add metrics usage documentation and example (#6962)
## What this PR does / why we need it?

This PR addresses issue #5027 where users find that `output.metrics`
returns `None` when using the vLLM offline inference API.

**Root Cause**: vLLM disables log stats by default
(`disable_log_stats=True`), which causes `output.metrics` to be `None`.

**Changes**:
1. Added a NOTE comment in `examples/offline_inference_npu.py`
explaining how to enable metrics
2. Created a new example `examples/offline_inference_metrics.py`
demonstrating how to access request-level metrics (`first_token_time`,
`finished_time`, etc.) by setting `disable_log_stats=False`

## Does this PR introduce _any_ user-facing change?

Yes - adds documentation and example code to help users understand how
to access output metrics.

## How was this patch tested?

- Documentation/example change only
- Verified example code follows the same patterns as existing examples

Closes #5027
- vLLM version: v0.16.0
- vLLM main:
15d76f74e2

Signed-off-by: NJX-njx <3771829673@qq.com>
2026-03-10 10:09:50 +08:00
..
2025-12-10 09:20:40 +08:00