Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Reuse params from cached_op_args #20221

Merged
merged 3 commits into from
Apr 28, 2021
Merged

Conversation

samskalicky
Copy link
Contributor

@samskalicky samskalicky commented Apr 26, 2021

Description

Reuse the params in cached_op_args for subsequent calls to optimize_for. Currently, if a new param is added during one call to optimize_for it is not available for subsequent calls. For example, if you run multiple graph passes then you would need to export/import to get the param. This PR checks if cached_op_args is set and reuses those, otherwise it just calls collect_params like normal.

Also added a check for backend argument in optimize_for and cleaned up logic to call hybridize now that we're using a clear argument to control clearing the cached_graph (whereas before we werent calling hybridize in order to not clear the cached_graph).

FYI @Kh4L

Checklist

Essentials

  • PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@samskalicky samskalicky requested a review from leezu April 26, 2021 17:26
@samskalicky samskalicky requested a review from szha as a code owner April 26, 2021 17:26
@mxnet-bot
Copy link

Hey @samskalicky , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [unix-gpu, centos-cpu, windows-cpu, unix-cpu, centos-gpu, edge, miscellaneous, website, clang, windows-gpu, sanity]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@mseth10 mseth10 added the pr-work-in-progress PR is still work in progress label Apr 26, 2021
Copy link
Contributor

@Kh4L Kh4L left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the PR

Copy link
Contributor

@waytrue17 waytrue17 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

@mseth10 mseth10 left a comment

Choose a reason for hiding this comment

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

LGTM

@samskalicky samskalicky changed the title [WIP] Reuse params from cached_op_args Reuse params from cached_op_args Apr 28, 2021
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress pr-awaiting-review PR is waiting for code review and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 28, 2021
Copy link
Contributor

@mseth10 mseth10 left a comment

Choose a reason for hiding this comment

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

LGTM

@mseth10 mseth10 merged commit 0f57c64 into apache:v1.x Apr 28, 2021
samskalicky added a commit to samskalicky/incubator-mxnet that referenced this pull request Apr 28, 2021
* initial commit

* fixed handling

* fixed formatting

Co-authored-by: Ubuntu <ubuntu@ip-172-31-6-220.us-west-2.compute.internal>
@samskalicky samskalicky mentioned this pull request Apr 29, 2021
6 tasks
mseth10 pushed a commit that referenced this pull request Apr 29, 2021
* initial commit

* fixed handling

* fixed formatting

Co-authored-by: Ubuntu <ubuntu@ip-172-31-6-220.us-west-2.compute.internal>

Co-authored-by: Ubuntu <ubuntu@ip-172-31-6-220.us-west-2.compute.internal>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants