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

Support PyTorch JIT compilation #1063

Closed
8 tasks done
fritzo opened this issue Apr 23, 2018 · 2 comments
Closed
8 tasks done

Support PyTorch JIT compilation #1063

fritzo opened this issue Apr 23, 2018 · 2 comments

Comments

@fritzo
Copy link
Member

fritzo commented Apr 23, 2018

What would it take to support JIT-compilation of an entire SVI.step()?

For motivation, consider a beta bernoulli model which is 10x slower in Pyro than Edward.

Feasibility

PyTorch @jit.compile appears to be functional input->output. Therefore we would need to at least

  1. run a warm-up iteration to populate the param store
  2. expose the Pyro param store to the jit compiler
  3. expose a helper .differentiable_loss() inside loss_and_grads (everything up to .backward())

Tasks

Remaining PyTorch issues

To see remaining PyTorch jit issues:

  1. Install PyTorch master
    cd ~/github/pytorch/pytorch  # or wherever your clone lives
    git checkout master
    git pull
    python setup.py build develop
  2. Run Pyro's jit tests with the pytorch-0.4.1 branch of Pyro
    cd ~/github/uber/pyro  # or wherever your clone lives
    git checkout pytorch-0.4.1
    git pull
    make install
    make test-jit  # saves results to jit.log

Here is an example jit.log.

@eb8680
Copy link
Member

eb8680 commented Apr 23, 2018

Are any torch.distributions samplers or log-probabilities supported by the JIT at all? Does the JIT have the same broadcasting semantics?

@fritzo
Copy link
Member Author

fritzo commented Nov 28, 2018

I believe this is closed by #1431

@fritzo fritzo closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants