CANN: Multi-Stream Support #23
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

描述 (Description)
本次 PR 针对 CANN 后端实现了多流并行执行支持和计算图优化,主要包括:
1. 多流并行执行支持
GGML_CANN_MULTI_STREAM环境变量,用于启用多流并行执行模式GGML_CANN_NUM_STREAMS环境变量,用于配置并行流的数量(默认为 4,最大为GGML_CANN_MAX_STREAMS)2. 计算图节点重排优化
ggml_cann_optimize_graph函数,对计算图节点进行重排以提高并行度测试 (Testing)
使用 Llama-3.1-8B-Instruct-Q4_K_M 模型在 Ascend 910B3 上进行性能测试,每种配置运行 10 次取平均值:
示例命令