Pyro: Perf bug in multivariate normal due to inefficient .expand

Created on 29 Nov 2018  路  4Comments  路  Source: pyro-ppl/pyro

Ref. https://github.com/uber/pyro/pull/1582.

There is a perf bug in MVN, and lowrank MVN log_prob methods on expanded instances (i.e. instances coming from mvn.expand()). @fehiepsi already has a patch for it. I am running our test suite to see if this might also affect other distributions.

bug high priority profiling

All 4 comments

1588 should fix some slowness. Another thing related to mvn (but I guess it also happens for other distributions too) which is not relevant to this bug, but I want to put here for record:

  • With event_shape < 50, pytorch 0.4 is faster than pytorch 1.0
  • With event_shape > 50, pytorch 1.0 is starting outperforming pytorch 0.4

With event_shape < 50, pytorch 0.4 is faster than pytorch 1.0

The pytorch devs did mention that there is some tensor overhead that was added after 0.4 due to which small models are likely to be slower. https://github.com/pytorch/pytorch/pull/9320 was an attempt to rectify that.

Following your link, I can see there are many interesting stories about the performance of 0.4 vs 1.0. Thanks @neerajprad !

This is already fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmadsalim picture ahmadsalim  路  3Comments

fehiepsi picture fehiepsi  路  3Comments

tristandeleu picture tristandeleu  路  3Comments

neerajprad picture neerajprad  路  5Comments

jpchen picture jpchen  路  5Comments