Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C covid19uk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Chris Jewell
  • covid19uk
  • Merge requests
  • !8

Switch tf.while_loop based Multinomial after all.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Chris Jewell requested to merge github/fork/csuter/stochastic into stochastic Apr 01, 2020
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: csuter

The for loop based approach, for reasons I don't yet understand, incurs XLA compilation times that scale poorly with inference period (at least linearly, maybe as much as quadratically; haven't measured). We are working on incorporating the Multinomial code I added here into TFP's Multinomial distribution, but until that is checked in (should be soon), I wanted to get this in here.

We do take a hit here on the post-compilation iteration times, but I suspect we can improve further. I'm seeing the following numbers; this is for an inference period of length 132 (sorry for the weird number...)

For-loop method:

Run 1: 165.3 seconds Run 2: 1.796 seconds ~= 0.0136 per iter

tf.while_loop method:

Run 1: 18.224 seconds Run 2: 6.886 seconds ~= 0.052 per iter

If the long compile and faster iteration time is preferable, feel free not to merge this PR!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/csuter/stochastic