From 12218f687dc3c6a286d48ae05d9c3d9c0688408f Mon Sep 17 00:00:00 2001 From: huangyunlong Date: Fri, 27 Jun 2025 15:47:51 +0800 Subject: [PATCH] add warn for npugraph --- torch_npu/npu/graphs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch_npu/npu/graphs.py b/torch_npu/npu/graphs.py index 7e21ce5ed9..31826ba70e 100644 --- a/torch_npu/npu/graphs.py +++ b/torch_npu/npu/graphs.py @@ -8,6 +8,7 @@ import typing from copy import deepcopy from dataclasses import dataclass, field from typing import List, Dict, Any, Optional, Tuple +import warnings import torch import torch_npu._C @@ -207,6 +208,7 @@ class NPUGraph(torch_npu._C._NPUGraph): actions in the current thread, and "relaxed" will not error on these actions. Do NOT change this setting unless you're familiar with `aclmdlRICaptureMode`_ """ # noqa: B950 + warnings.warn("Currently, NPUGraph only supports inference scenarios, not training scenarios.") super().capture_begin(pool=pool, capture_error_mode=capture_error_mode) def capture_end(self): -- Gitee