Fork
0
代码
介绍
代码
Issues
Pull Requests
流水线
Actions
讨论
Wiki
项目成员
分析
项目设置
Fork
0
master
pytorch
/
codegen
/
templates
下载当前目录
ascend-robot
Support registering functions on AutogradPrivateUse1 via YAML dispatch configuration
26653507
创建于
2025年9月19日
历史提交
文件
最后提交记录
最后更新时间
CustomFunctions.cpp
Auto genarate custom functions
2 年前
CustomFunctions.h
Auto genarate custom functions
2 年前
CustomRedispatch.cpp
Add redispatch feature
2 年前
CustomRedispatch.h
Add redispatch feature
2 年前
CustomRegisterSchema.cpp
Support registering functions on AutogradPrivateUse1 via YAML dispatch configuration Co-authored-by: shaoyf02<shaoyifan1@huawei.com> # message auto-generated for no-merge-commit merge: merge master_autograd into master Support registering functions on AutogradPrivateUse1 via YAML dispatch configuration Created-by: shaoyf Commit-by: shaoyf02 Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one
/kind <>
line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: 背景:解决高版本下默认针对没有注册autograd相关key但进行反向的api的告警 方案:通过提供支持添加dispatch字段注册到autogradprivateuse1上,避免出现告警: 例如: ``` - func: npu_moe_token_unpermute_with_routing_map(Tensor permuted_tokens, Tensor sorted_indices, int[] restore_shape, *, Tensor? probs=None, Tensor? routing_map=None, bool drop_and_pad=False) -> Tensor op_api: [v2.1, newest] dispatch: AutogradPrivateUse1: npu_moe_token_unpermute_with_routing_map ``` 具体样例: 添加dispatch前存在告警,添加后无 ``` [W919 12:36:08.793215810 compiler_depend.ts:67] Warning: npu::npu_moe_token_unpermute_with_routing_map: an autograd kernel was not registered to the Autograd key(s) but we are trying to backprop through it. This may lead to silently incorrect behavior. This behavior is deprecated and will be removed in a future version of PyTorch. If your operator is differentiable, please ensure you have registered an autograd kernel to the correct Autograd key (e.g. DispatchKey::Autograd, DispatchKey::CompositeImplicitAutograd). If your operator is not differentiable, or to squash this warning and use the previous behavior, please register torch::CppFunction::makeFallthrough() to DispatchKey::Autograd. (function operator()) ``` **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage:
Fixes #<issue number>
, or
Fixes (paste link of issue)
. --> Fixes # **Special notes for your reviewers**: See merge request: Ascend/pytorch
!25035
8 个月前
ForeachRegister.cpp
!6768
codecheck for not test. Merge pull request
!6768
from 王夏夏/master
2 年前
RegisterFunctionalization.cpp
!10962
Add functionalize codegen feature Merge pull request
!10962
from 王广斌/bugfix_master
2 年前
custom_ops.py
adapt schema for multi_out custom ops to support jit.script and compatible with old usage
2 年前
npu_testing_utils.py
!6402
refactor test_ops Merge pull request
!6402
from Leon/master
2 年前