Files
TorchNPU/docs/zh/api/environment_variable/synchronization_timeout
chenrayray 92532471f6 【docs】整合环境变量文档更新并重构分类导航
Co-authored-by: Xinrui Chen<chenxinrui11@huawei.com>



# message auto-generated for no-merge-commit merge:
!46030 merge codex/integrate-env-docs-master into master

【docs】整合环境变量文档更新并重构分类导航

Created-by: chenrayray
Commit-by: Xinrui Chen
Merged-by: ascend-robot
Description: # 【合入来源】

- [x] issue/工单
- [x] 重构优化
- [x] 资料更新

关联Issue:https://gitcode.com/Ascend/pytorch/issues/4691

整合来源:[PR #45521](https://gitcode.com/Ascend/pytorch/pull/45521)、[PR #45307](https://gitcode.com/Ascend/pytorch/pull/45307)、[PR #45973](https://gitcode.com/Ascend/pytorch/pull/45973)及环境变量梳理结果。

# 【修改方案】

补齐分散的环境变量文档及导航入口,使100项环境变量能在总列表、总目录和分类目录中一致检索。

1. 在master基线上三方整合两个PR,纳入Inductor、分布式通信、启动和对称内存配置,保留master较新的说明,按#45521移除MFusion、AKG旧详情页。
2. 新增PYTORCH_HAL_BASED_NPU_CHECK和PYTORCH_ALLOC_CONF独立详情;补充溢出检测的版本不足告警行为,保留来源中的HAL失败回退Runtime及分配器配置互斥约束。
3. 导航按使用场景整理为设备初始化与管理、算子执行与兼容性、单算子编译与缓存、内存管理、分布式启动与建链、分布式通信与诊断、日志与告警、特征值检测、性能优化与采集、图编译共10类。
4. 分布式通信细分为通信执行与同步、超时监控与故障记录、状态与性能采集、DDP与RPC四组;图编译细分为编译模式与回退、缓存与编译并发、算子融合与自动调优、图优化与调度、调试日志与精度检查五组。
5. 将60个详情页的PyTorch对照说明融入功能描述,存在实际差异时通过提示块突出默认值或实现差异;新增统一的PyTorch环境变量对照表,按同名变量、异名或相关变量、配置项对照三组集中展示38项已有对照说明,并接入总目录和变量列表。
6. 补入PR #45973的HAL检测细节:解析ASCEND_RT_VISIBLE_DEVICES、动态加载libascend_hal.so,以及Runtime首次非零设备数缓存行为。该变量详情页、总列表和两级目录入口已包含,保留上游对应关系说明。

分类设计:`TORCH_LOGS`归入“日志与告警”,详情文件位于`alarm_message_printing/TORCH_LOGS.md`,与分类对应;图编译分类仅保留交叉引用。“特征值检测”保留标准名称及原有NPU_ASD变量范围,Inf/NaN模式和FORCE_OVERFLOW_CHECK归入算子执行与兼容性。每项变量只有一个主分类,领域专用的诊断配置保留在通信或图编译分类。`TORCH_LOGS`详情页移至日志目录,并同步总列表、总目录、分类目录和对照表链接;旧同步超时目录保留兼容入口。PYTORCH_ALLOC_CONF链接到原分配器参数页,避免维护两份参数说明。

事实内容以三个来源PR和环境变量梳理表为准,保留master已有的较新说明,统一分类、导航及上游对比的展示方式。

# 【资料变更】

按环境变量梳理:文档新增收录54项、更新已有7项、移除旧项2项,整合后共收录100项。各变量的用途和本次修改内容如下。

## 新增收录的环境变量(54项)

### 分布式通信与诊断(19项)

| 环境变量 | 用途 |
| --- | --- |
| [DDP_SET_LAST_BUCKET_CAP](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/DDP_SET_LAST_BUCKET_CAP.md) | 通过此环境变量可控制DDP的bucket重建顺序。 |
| [NSLB_CP](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/NSLB_CP.md) | 通过此环境变量可配置HCCL NSLB采样记录的目录路径。 |
| [NSLB_MAX_RECORD_NUM](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/NSLB_MAX_RECORD_NUM.md) | 通过此环境变量可配置每个PG的最大NSLB采样记录数量。 |
| [PERF_DUMP_CONFIG](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/PERF_DUMP_CONFIG.md) | 通过此环境变量可配置HCCL操作的性能数据记录功能。 |
| [PERF_DUMP_PATH](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/PERF_DUMP_PATH.md) | 通过此环境变量可配置HCCL性能dump文件的输出目录。 |
| [TORCH_HCCL_COORD_CHECK_MILSEC](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_COORD_CHECK_MILSEC.md) | 当使用HCCL作为通信后端时,通过此环境变量可设置WatchDog轮询检查Store dump signal的间隔时间。 |
| [TORCH_HCCL_DEBUG_INFO_PIPE_FILE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_DEBUG_INFO_PIPE_FILE.md) | 当使用HCCL作为通信后端时,通过此环境变量可配置命名管道文件,用于外部触发Flight Recorder dump。 |
| [TORCH_HCCL_DEBUG_INFO_TEMP_FILE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_DEBUG_INFO_TEMP_FILE.md) | 通过此环境变量可配置HCCL dump文件的名称前缀。 |
| [TORCH_HCCL_DUMP_ON_TIMEOUT](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_DUMP_ON_TIMEOUT.md) | 当使用HCCL作为通信后端时,通过此环境变量可控制超时或错误时是否自动触发Flight Recorder dump。 |
| [TORCH_HCCL_ENABLE_MONITORING](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_ENABLE_MONITORING.md) | 当使用HCCL作为通信后端时,通过此环境变量可控制是否启动heartbeat monitor线程。 |
| [TORCH_HCCL_HEARTBEAT_TIMEOUT_SEC](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_HEARTBEAT_TIMEOUT_SEC.md) | 当使用HCCL作为通信后端时,通过此环境变量可设置heartbeat monitor判定WatchDog卡死的超时时间。 |
| [TORCH_HCCL_HIGH_PRIORITY](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_HIGH_PRIORITY.md) | 当使用HCCL作为通信后端时,通过此环境变量可控制是否强制使用高优先级NPU stream。 |
| [TORCH_HCCL_STATUS_SAVE_ENABLE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_STATUS_SAVE_ENABLE.md) | 通过此环境变量可控制HCCL进程组状态信息的周期性保存。 |
| [TORCH_HCCL_STATUS_SAVE_INTERVAL](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_STATUS_SAVE_INTERVAL.md) | 通过此环境变量可配置HCCL状态保存的间隔时间。 |
| [TORCH_HCCL_STATUS_SAVE_PATH](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_STATUS_SAVE_PATH.md) | 通过此环境变量可配置HCCL状态文件的保存目录。 |
| [TORCH_HCCL_TRACE_BUFFER_SIZE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_TRACE_BUFFER_SIZE.md) | 当使用HCCL作为通信后端时,通过此环境变量可配置Flight Recorder环形缓冲区最大事件数,默认关闭。 |
| [TORCH_HCCL_TRACE_CPP_STACK](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_TRACE_CPP_STACK.md) | 当使用HCCL作为通信后端时,通过此环境变量可控制在记录事件时是否采集C++调用栈。 |
| [TORCH_HCCL_WAIT_TIMEOUT_DUMP_MILSEC](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TORCH_HCCL_WAIT_TIMEOUT_DUMP_MILSEC.md) | 当使用HCCL作为通信后端时,通过此环境变量可设置monitor等待异步dump完成的最大时间。 |
| [TP_SOCKET_IFNAME](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/collective_communication/TP_SOCKET_IFNAME.md) | 通过此环境变量可指定TensorPipe RPC传输层使用的网络接口名称。 |

### 设备初始化与管理(1项)

| 环境变量 | 用途 |
| --- | --- |
| [PYTORCH_HAL_BASED_NPU_CHECK](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/device_management/PYTORCH_HAL_BASED_NPU_CHECK.md) | 选择NPU可用性检测路径,配置为1时优先通过Ascend HAL查询设备数量,失败时回退到Runtime。 |

### 分布式启动与建链(4项)

| 环境变量 | 用途 |
| --- | --- |
| [ENABLE_TIERED_PARALLEL_TCPSTORE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/distributed_startup/ENABLE_TIERED_PARALLEL_TCPSTORE.md) | 通过此环境变量可控制ParallelStore是否启用分层建链优化模式。 |
| [PROXY_AGENT_PID_USE_LOCAL_SOCKET_PATH](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/distributed_startup/PROXY_AGENT_PID_USE_LOCAL_SOCKET_PATH.md) | 通过此环境变量可将agent PID传递给ParallelStore,用于本地socket路径生成。 |
| [TORCH_NPU_ELASTIC_USE_AGENT_STORE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/distributed_startup/TORCH_NPU_ELASTIC_USE_AGENT_STORE.md) | 通过此环境变量可控制是否使用agent已启动的ParallelStore。 |
| [TORCH_NPU_USE_PARALLEL_TCPSTORE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/distributed_startup/TORCH_NPU_USE_PARALLEL_TCPSTORE.md) | 通过此环境变量可控制是否启用ParallelStore作为分布式存储后端,提升建链性能。 |

### 日志与告警(1项)

| 环境变量 | 用途 |
| --- | --- |
| [TORCH_LOGS](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/alarm_message_printing/TORCH_LOGS.md) | 通过此环境变量可控制PyTorch各模块的日志输出级别,与PyTorch上游行为一致。 |

### 图编译(27项)

| 环境变量 | 用途 |
| --- | --- |
| [CATLASS_EPILOGUE_FUSION](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/CATLASS_EPILOGUE_FUSION.md) | 通过此环境变量可控制是否开启Catlass epilogue融合功能,与PyTorch上游的`CUTLASS_EPILOGUE_FUSION`对应。 |
| [ENABLE_INPLACE_BUFFERS](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/ENABLE_INPLACE_BUFFERS.md) | 通过此环境变量可控制是否启用原地缓冲区优化。 |
| [ENABLE_PARALLEL_SCHEDULER](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/ENABLE_PARALLEL_SCHEDULER.md) | 通过此环境变量可控制是否启用并行调度器FX pass。 |
| [FX_SUBGRAPH_DUMP_PATH](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/FX_SUBGRAPH_DUMP_PATH.md) | 通过此环境变量可配置DVM模式下FX子图的dump路径。 |
| [INDUCTOR_ASCEND_DEBUG](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/INDUCTOR_ASCEND_DEBUG.md) | 通过此环境变量可控制Triton编译时是否启用调试模式。 |
| [INDUCTOR_ASCEND_DUMP_FX_GRAPH](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/INDUCTOR_ASCEND_DUMP_FX_GRAPH.md) | 通过此环境变量可控制在Inductor降层时是否导出FX图。 |
| [INDUCTOR_ASCEND_FX_GRAPH_CACHE](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/INDUCTOR_ASCEND_FX_GRAPH_CACHE.md) | 通过此环境变量可配置Inductor降层时FX图缓存的目录路径。 |
| [INDUCTOR_ASCEND_LOG_LEVEL](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/INDUCTOR_ASCEND_LOG_LEVEL.md) | 通过此环境变量可配置Inductor模块的日志级别。 |
| [INDUCTOR_DVM_ENABLE_MATMUL_FUSION](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/INDUCTOR_DVM_ENABLE_MATMUL_FUSION.md) | 通过此环境变量可开启DVM MatMul template融合,将矩阵乘算子融合为DVM template kernel。 |
| [NPU_INDUCTOR_DYNAMIC_FX_PASS](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/inductor/NPU_INDUCTOR_DYNAMIC_FX_PASS.md) | 通过此环境变量可控制图优化FX pass是否使用动态shape模式。 |
| [PARALLEL_SCHEDULER_NODES_MIN](https://gitcode.com/chenrayray/pytorch/blob/codex/integrate-env-docs-master/docs/zh/api/environment_variable/in

See merge request: Ascend/pytorch!46030
2026-09-10 11:32:35 +08:00
..