Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check require grad before generating gradient output #21229

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pengwa
Copy link
Contributor

@pengwa pengwa commented Jul 2, 2024

Description

Motivation and Context

@pengwa pengwa added the training issues related to ONNX Runtime training; typically submitted using template label Jul 2, 2024
@pengwa pengwa requested a review from prathikr July 2, 2024 05:45
@@ -1794,7 +1794,18 @@ IMPLEMENT_GRADIENT_BUILDER(GetExternalGradient) {
}

std::vector<ArgDef> output_args;
for (const auto& output : node_def.outputs) {
for (size_t output_index = 0; output_index < node_def.outputs.size(); ++output_index) {
if (output_index >= GetSrcNodeInputSize()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is worth adding a comment about a case it where this condition is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
training issues related to ONNX Runtime training; typically submitted using template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants