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

Profile AutoDiffCostFunction and refactor the homography example #296

Merged
merged 17 commits into from
Sep 21, 2022

Conversation

fantaosha
Copy link
Contributor

@fantaosha fantaosha commented Sep 14, 2022

Motivation and Context

Profile AutoDiffCostFunction with different AutogradMode on the homography example.

profilie_homography

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.

@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 Sep 14, 2022
@fantaosha fantaosha self-assigned this Sep 14, 2022
@fantaosha fantaosha added the enhancement New feature or request label Sep 14, 2022
@ddetone
Copy link
Contributor

ddetone commented Sep 16, 2022

Can you post the timing info with and without functorch?

Copy link
Contributor

@ddetone ddetone left a comment

Choose a reason for hiding this comment

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

LGTM. In a future PR we can make those parameters

examples/homography_estimation.py Outdated Show resolved Hide resolved
Copy link
Contributor

@joeaortiz joeaortiz left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Member

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

Looks great, nice work on speeding this up Taosha!

TODOs flagged so far before merging

  • Add the perf results to the PR description (can you also include relative improvement here in addition to the absolute numbers you have).
  • Consolidate the original example and profiling files into a single one that can take --profile flag.

Finally, in another PR setup enum for AutoDiffCostFunction grad options: {autograd, loop_batch, vectorize}

@fantaosha fantaosha changed the title Add functorch support and logging info to the homography example Profile AutoDiffCostFunction and refactor the homography example Sep 16, 2022
Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

LGTM!

examples/configs/homography_estimation.yaml Show resolved Hide resolved
examples/homography_estimation.py Outdated Show resolved Hide resolved
examples/homography_estimation.py Outdated Show resolved Hide resolved
@luisenp
Copy link
Contributor

luisenp commented Sep 16, 2022

Ah sorry, we should also add the script for running the benchmarks: evaluations/profile_auto_diff_cost_function.sh, which outputs the 3 runs with the comparison.

@fantaosha fantaosha changed the base branch from main to taoshaf.add_autograd_mode September 19, 2022 22:22
evaluations/README.md Outdated Show resolved Hide resolved
Copy link
Member

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few minor comments before we can merge.

Comment on lines +45 to +46


Copy link
Member

@mhmukadam mhmukadam Sep 21, 2022

Choose a reason for hiding this comment

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

Remove extra lines?

Base automatically changed from taoshaf.add_autograd_mode to main September 21, 2022 19:46
@fantaosha fantaosha merged commit 98df1c5 into main Sep 21, 2022
@fantaosha fantaosha deleted the taoshaf.profile_homography branch September 21, 2022 20:26
suddhu pushed a commit to suddhu/theseus that referenced this pull request Jan 21, 2023
…ebookresearch#296)

* add logging and functorch to homography example

* add homography profiling script

* backup

* import cast from typing

* add hydra for homography

* update homography example

* update homography_estimation.py with AutogradMode

* update homography example

* add profile_auto_diff_cost_function.sh

* move profile_auto_diff_cost_function.sh to evaluations

* add "time/per peoch" to homography_estimation

* update evaluations/README.md

* 1025->1024

* refactor readme

* move comments

* add a new line

* add a condition to ignore warning for the homography example
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. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants