Replaces cherry-picked upstream_ref with complete source trees. xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files) Complete: kernels → layers → models → runtime → scheduler → api Excluded: .git, binary images, third_party submodule checkouts ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files) Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops Excluded: tests, benchmarks, docs, examples (not needed for reference) Critical call chains now fully traceable: MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp Attention: ixformer.h → xllm_paged_attention → attention.cpp
30 lines
880 B
Markdown
30 lines
880 B
Markdown
# NPU Timeline Generation Guide
|
|
## Prerequisites
|
|
- Python environment
|
|
- Chrome browser (for visualization)
|
|
## Implementation Steps
|
|
### 1. Code Modification
|
|
#### Register the subscriber
|
|
Add the following at the beginning of your program:
|
|
```cpp
|
|
MsptiMetrics::register_subscriber();
|
|
```
|
|
#### Add tracing to ACLNN functions (work for msprof as well)
|
|
Insert the following macro in your ACLNN functions where you want to measure performance:
|
|
```cpp
|
|
LLM_MSTX_RANGE();
|
|
```
|
|
#### Release the subscriber
|
|
Add this at the end of your program:
|
|
```cpp
|
|
MsptiMetrics::release_subscriber();
|
|
```
|
|
### 2. Log Processing
|
|
After running your program, process the generated log file using the timeline script:
|
|
```bash
|
|
python npu_timeline.py -i custom_log.log -o custom_output.json
|
|
```
|
|
### 3. Visualization
|
|
Open Chrome browser
|
|
Navigate to: chrome://tracing
|
|
Load the generated JSON file: custom_output.json |