Performance degradation in `mps` after `einsum` replacement
See original GitHub issueBefore #445 was merged I was getting ~31s inference time in mps
. After the change, time goes up to 42s. I verified again in main
@ b2b3b1a
, and time is again 31s.
I haven’t checked other platforms yet.
Any ideas, @patil-suraj?
Issue Analytics
- State:
- Created a year ago
- Comments:15 (13 by maintainers)
Top Results From Across the Web
[MPS] einsum returns incorrect matmul result on first ... - GitHub
Performance degradation in mps after einsum replacement huggingface/diffusers#452. Closed. Textual Inversion Training on M1 (works!)
Read more >MPSGraph adamUpdateWithLearningRa… - Apple Developer
I am running tensorflow-macos and tensorflow-metal version 2.6 on Monterey Beta (21A5543b) on an iMac 27" 2021 with an AMD Radeon GPU. I...
Read more >torch.einsum — PyTorch 1.13 documentation
Einsum allows computing many common multi-dimensional linear algebraic array operations by representing them in a short-hand format based on the Einstein ...
Read more >AutoHOOT: Automatic High-Order Optimization for Tensors
Moreover, two nodes in an Einsum graph may be trans- positions of each other. After detecting such conditions, we replace one of the...
Read more >np.einsum performance of 4 matrix multiplications
Looks like you stumbled onto a case where the greedy path gives a non-optimal scaling. >>> path, desc = np.einsum_path('xyf,xtf,ytpf ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Addressed in #926.
how are you using the seeds ?
diffusers
pipelines uses thetorch.Generator
objects for seeds. To get reproducible results we need to reinit thetorch.Generator
with the same seed as using the same generator multiple times advances the rng state.The correct way to check this would be running this same block multiple times.