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

Temporarily fixed a bug for vmap #562

Merged
merged 3 commits into from
Jul 6, 2023
Merged

Temporarily fixed a bug for vmap #562

merged 3 commits into from
Jul 6, 2023

Conversation

fantaosha
Copy link
Contributor

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@fantaosha fantaosha requested a review from luisenp June 28, 2023 01:52
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 28, 2023
@fantaosha fantaosha requested a review from mhmukadam June 28, 2023 01:53
@fantaosha fantaosha self-assigned this Jun 28, 2023
@fantaosha fantaosha changed the base branch from main to taoshaf.fix_pgo_noise June 28, 2023 01:54
@fantaosha fantaosha changed the title Temporarily fixed a bug for map Temporarily fixed a bug for vmap Jun 29, 2023
@luisenp
Copy link
Contributor

luisenp commented Jul 5, 2023

It does seem that there is some bug in torch when autograd generates a zero gradient for an operation. I passed a simple repro to @zou3519 to double check this.

That being said, it seems that the reason we get a zero gradient is because the jacobian autograd functions return poses for selected links + ancestors (see here and here), but only the poses of links with parents are used (all but poses[0], if I understand correctly).

Is there a reason why we can't make selected_links only contain the links whose poses will be used by jacobian computation? (in line 138). As far as I can tell, the first element of selected_poses will never be used (it's not used by the backward_helper and it's not used by the loop in line 155). Is this correct?

Base automatically changed from taoshaf.fix_pgo_noise to main July 6, 2023 14:45
@fantaosha fantaosha closed this Jul 6, 2023
@fantaosha fantaosha reopened this Jul 6, 2023
@fantaosha fantaosha merged commit 52851f2 into main Jul 6, 2023
15 checks passed
@fantaosha fantaosha deleted the taoshaf.torchkin_vmap branch July 6, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants