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

%bench 1+1 takes several minutes on macOS #359

Open
oxinabox opened this issue Dec 19, 2020 · 4 comments
Open

%bench 1+1 takes several minutes on macOS #359

oxinabox opened this issue Dec 19, 2020 · 4 comments
Labels
bug Something isn't working language / compiler Compiler maintenance and lowering pipeline

Comments

@oxinabox
Copy link
Contributor

When i use %bench it sits there using 100% CPU for like 10 minutes.
and reports timing to match.
Outside of %bench it doesn't seem to take a noticable amount of time.
This seems to happen on even if i have called the function before doing %bench and also occurs when i %bench it again.

>=> %bench "demo"
... 1+1
2

demo
Compile time: 611.293 s
Run time:     609.396 us        (based on 1000000 runs)

Runtime also seems pretty high.

This is with a fresh build of dex on commit 8646638.
Running on Mac.
This wasn't the case a week ago.

@oxinabox oxinabox mentioned this issue Dec 19, 2020
7 tasks
@dan-zheng dan-zheng added the bug Something isn't working label Dec 20, 2020
@apaszke
Copy link
Collaborator

apaszke commented Dec 23, 2020

I can't really reproduce the same thing locally. Note that "Compile time" as it was in the commit you've seen is really compile time + benchmark time, so it's really the later that dominates it. I've made some improvements to the benchmark suite in #372 and hopefully that will be enough to resolve your issue? If not, feel free to reopen.

@apaszke apaszke closed this as completed Dec 23, 2020
@oxinabox
Copy link
Contributor Author

oxinabox commented Dec 23, 2020

I've made some improvements to the benchmark suite in #372 and hopefully that will be enough to resolve your issue? If not, feel free to reopen.

Tried a fresh build of main just now.
Seems not to be fixed.

>=> %bench "demo"
... 1+1
2

demo
Compile time: 25.439 ms
Run time:     505.765 us 	(based on 400000 runs)

it still took like several minutes wall time, and the runtime is still unreasonably high given @apaszke reported 150ns for 1+1 in #372

@apaszke apaszke reopened this Dec 23, 2020
@oxinabox oxinabox changed the title 10 minute compile-time with %bench %bench 1+1 takes several minutes Dec 23, 2020
@duvenaud
Copy link
Contributor

I also find that %bench takes at least a few minutes to run. I think me and @oxinabox are both using Macs.

@apaszke
Copy link
Collaborator

apaszke commented Dec 23, 2020

Hah, mac is a good pointer! I've been trying to reproduce on Linux, but couldn't!

@apaszke apaszke changed the title %bench 1+1 takes several minutes %bench 1+1 takes several minutes on macOS Dec 23, 2020
@apaszke apaszke added the language / compiler Compiler maintenance and lowering pipeline label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working language / compiler Compiler maintenance and lowering pipeline
Projects
None yet
Development

No branches or pull requests

4 participants