Skip to content

Conversation

@gchanan
Copy link
Contributor

@gchanan gchanan commented Aug 1, 2017

This adds two tests for gradchecks:

  1. That backward is reentrant

  2. That input grad sizes match input sizez.

  3. Uncovers an issue with BatchNorm which is now fixed

  4. Uncovers an issue with advanced indexing which is also now fixed.

gchanan added 3 commits August 1, 2017 15:31
…t needed.

These could cause a problem with double backwards because they were std::move'd in
Backward.
@gchanan
Copy link
Contributor Author

gchanan commented Aug 1, 2017

@killeent for simplicity I fixed the advanced indexing case in python because it's easier, but it should probably be fixed in C++ in case we ever call advanced_indexing_select in other places. Let's do that in the master version; I'd like to keep this v.0.2.0 version as light as possible.

@gchanan gchanan changed the title Fix gradgrad issues with BatchNorm and Advanced Indexing Fix gradgrad issues with BatchNorm and Advanced Indexing (v.0.2.0) Aug 1, 2017
@soumith soumith merged commit daf5b20 into pytorch:v0.2.0 Aug 2, 2017
std::move(grad_bias));
return wrap_outputs(all_inputs, std::move(outputs), [&](FunctionFlags f) {
return std::make_shared<BatchNormBackwardBackward>(
f, *this, std::move(save_mean), std::move(save_std),

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

jacobian_x[:, i].zero_()
else:
jacobian_x[:, i] = d_x.to_dense() if d_x.is_sparse else d_x
for jacobian_c in (jacobian, jacobian_reentrant):

This comment was marked as off-topic.

This comment was marked as off-topic.

IvanYashchuk pushed a commit to IvanYashchuk/pytorch that referenced this pull request Jan 5, 2023
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request Jul 9, 2025
This PR is to fix https://ontrack-internal.amd.com/browse/SWDEV-534855:
test_cuda.py::TestCuda::test_hip_device_count fails on one gpu machine.

Needs to cherry-pick it to upstream as well once this PR is merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants