Skip to content

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Sep 4, 2019

Description

Resolves #539

Instead of adding conditional control flows through PR #535 and PR #537 in support of PR #534 , PR #534 will be delayed in favor of migrating to TensorFlow v2.0, where eager evaluation will avoid the issues that PR #535 and PR #537 addressed.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Migrate the TensorFlow backend and optimizer to TensorFlow v2.0 / deprecate TensorFlow v1.0 behavior
   - Changes evaluation from lazy (v1.0) to eager (v2.0 default)
* Require TensorFlow and TensorFlow Probability releases compatible with TensorFlow v2.0
* Simplify test configuration with deprecation of TensorFlow v1.0 Sessions

@matthewfeickert matthewfeickert added the feat/enhancement New feature or request label Sep 4, 2019
@matthewfeickert matthewfeickert self-assigned this Sep 4, 2019
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Sep 4, 2019

TODO:

References:

@matthewfeickert
Copy link
Member Author

Until tf.hessians gets updated in TF 2.0 this PR is blocked as a results of gradients. So this will need to wait for a new release candidate.

@matthewfeickert matthewfeickert force-pushed the revise/migrate-to-TF-2.0 branch from b15ec30 to 5fef166 Compare October 1, 2019 07:48
@matthewfeickert matthewfeickert changed the title Migrate to TensorFlow v2.0 improvement: Migrate to TensorFlow v2.0 Oct 1, 2019
@matthewfeickert matthewfeickert force-pushed the revise/migrate-to-TF-2.0 branch from cfca435 to f753c27 Compare October 2, 2019 07:54
@matthewfeickert matthewfeickert changed the title improvement: Migrate to TensorFlow v2.0 feat: Migrate to TensorFlow v2.0 Nov 4, 2019
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Nov 4, 2019

Given the decision to revert the addition of "improvement" in commitizen/conventional-commit-types this was renamed to a feature.

@codecov
Copy link

codecov bot commented Jan 11, 2020

Codecov Report

Merging #541 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #541     +/-   ##
=========================================
+ Coverage   94.86%   94.96%   +0.1%     
=========================================
  Files          52       52             
  Lines        2763     2742     -21     
  Branches      392      385      -7     
=========================================
- Hits         2621     2604     -17     
+ Misses         97       95      -2     
+ Partials       45       43      -2
Flag Coverage Δ
#unittests 94.96% <100%> (+0.1%) ⬆️
Impacted Files Coverage Δ
src/pyhf/optimize/opt_tflow.py 100% <100%> (ø) ⬆️
src/pyhf/tensor/tensorflow_backend.py 96.39% <100%> (+2.95%) ⬆️
src/pyhf/cli/infer.py 97.67% <100%> (-0.06%) ⬇️
src/pyhf/__init__.py 97.72% <100%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3dc4d36...e670e01. Read the comment docs.

@matthewfeickert
Copy link
Member Author

The coverage needs to get fixed here

https://codecov.io/gh/scikit-hep/pyhf/pull/541/diff?src=pr&el=tree#D3-102

but other than that this looks like it is almost ready for review.

@matthewfeickert matthewfeickert added bumpversion/patch Create a patch version release API Changes the public API docs Documentation related labels Jan 11, 2020
@github-actions
Copy link

I've queued this up. When it gets merged, I'll create a patch release from v0.3.2 → v0.3.3 which includes the following 5 change(s) [including this PR]:

  • feat: Migrate to TensorFlow v2.0
  • refactor: Use multistage Docker build to include only built libraries in Docker image
  • fix: Update nbformat to v4.4 for all tested notebooks
  • docs: Directly link to GitHub project page from docs website
  • docs: Apply pydocstyle to Workspace

  • If you make any more changes, you probably want to re-trigger me again by removing the bumpversion/patch label and then adding it back again.

    @scikit-hep scikit-hep deleted a comment from github-actions bot Jan 12, 2020
    @scikit-hep scikit-hep deleted a comment from github-actions bot Jan 12, 2020
    @matthewfeickert matthewfeickert marked this pull request as ready for review January 12, 2020 00:47
    @matthewfeickert matthewfeickert added the tests pytest label Jan 12, 2020
    @matthewfeickert matthewfeickert force-pushed the revise/migrate-to-TF-2.0 branch from fc1fcb5 to ad5ba15 Compare January 12, 2020 19:04
    @matthewfeickert
    Copy link
    Member Author

    matthewfeickert commented Jan 12, 2020

    just to understand better: this does not enable eager execution, but just removes all the session stuff and handles gradients differently?

    No this does enable eager execution. If you check out the docstrings that I added that's what we'll be getting from now on.

    If we want to move to lazy eval then we'll need to revise this.

    @lukasheinrich
    Copy link
    Contributor

    ah right, sorry I overlooked this

    @matthewfeickert
    Copy link
    Member Author

    ah right, sorry I overlooked this

    No I should have mentioned this in the PR body. I've now updated the commit history message for it.

    setup.py Outdated
    'tensorflow': [
    'tensorflow~=2.0',
    'tensorflow-probability~=0.8',
    'numpy<2.0,>=1.16.0',
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Copy link
    Member Author

    @matthewfeickert matthewfeickert Jan 12, 2020

    Choose a reason for hiding this comment

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

    Yeah, we can simplify that to just numpy~=1.16 drop that totally. Good point!

    @matthewfeickert matthewfeickert merged commit ebf7ece into master Jan 12, 2020
    @matthewfeickert matthewfeickert deleted the revise/migrate-to-TF-2.0 branch January 12, 2020 20:34
    kratsg pushed a commit that referenced this pull request Jan 12, 2020
    Triggered by #541 via GitHub Actions.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    API Changes the public API bumpversion/patch Create a patch version release docs Documentation related feat/enhancement New feature or request tests pytest

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Migrate to TensorFlow 2.0

    3 participants