-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add --noinline startup option #9354
Conversation
I like @jakebolewski's approach in #9294 somewhat better, because he provides a general |
This is only a thought - just thinking about the way we specify arguments to the compiler, instead of For example, |
Even though I had briefly reviewed Jake's PR (excellent as always), I had forgotten about it again by the time I wrote this. I agree that just making the whole struct available to julia is cleaner. I can rebase this on his PR when it gets merged. @ViralBShah, that would be fine with me. Can you more precisely clarify the benefit, though? |
@ivarne, I forgot to address your question about performance. This conditional is much faster to evaluate than anything else in When I've profiled, |
@timholy The thing I like about We only have a couple of these things right now, but they are likely to proliferate. In any case, this should not matter in this particular PR, and is perhaps a separate bikeshed issue. |
I was trying to imagine what aspect of the code would be simplified, and couldn't come up with one. But if it's really to help users organize these options in their heads, that makes a certain amount of sense. |
Yeah, all we need now is a debugger 😄. But thanks, I do hope these will make it much more pleasant. |
Small bikeshead, rename to I don't think we have enough command line flags to warrant categorizing them (yet). I think we should actually try to avoid that. |
Currently I agree that we don't yet have to categorize them, and like you I hope we never get there. With regards to the naming of this option, I'd be happy to rename it. I chose a single word simply to make it similar to |
I don't really care about the name, maybe I should change |
Wow, tough. I agree |
@@ -1931,6 +1931,11 @@ jl_value_t *jl_matching_methods(jl_function_t *gf, jl_value_t *type, int lim) | |||
return ml_matches(mt->defs, type, jl_gf_name(gf), lim); | |||
} | |||
|
|||
DLLEXPORT int can_inline(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exported functions should have the jl_
prefix.
Great suggestions, thanks everyone! I'll address all of these once @jakebolewski's #9294 gets merged. |
As this is a debug tool, I think it would be fine to just print pick a new name and issue a warning for the old option with directions for the new one. It's not like we want people to write scripts that require |
It does also solve the naming problem, though. I worry that Maybe I'm just being pedantic, though. It is an attractive suggestion. |
We could also use on/off to make it more obvious that it is an heuristic. |
How about "inlining-pass" or "pass-inlining". That way you could eventually toggle the different optimization passes on and off from the command line. I actually have a branch that enables you to selectively turn on/off all optimization passes from type inference to the very last llvm pass but I don't think that is generally useful. |
Does it pass (i.e. skip) the inlining, or does it enable the inlining optimization pass? |
Not entirely sure how feasible it is, but couldn't this be used to make the code coverage statistics more accurate? (#7541) |
Definitely. This won't change the inlining of anything precompiled into the system, so it's not great for measuring coverage of base; but for packages, it should do exactly as you say. |
f3b0882
to
d63f37a
Compare
OK, new version pushed. I went with the One slight oddity: I moved the |
Should we make a new file |
@tkelman, I wondered about that too, but it seems strange at this point. It's also a bit in the double-black-diamond territory to be monkeying directly with the compiler options, which leads me to think that perhaps The AppVeyor failure seems unrelated. For the record, one of the failures is very strange (see also #6109 (comment)):
at a point in the testing where I rather doubt the profiler is even active. The other platform seemed to complete all of its tests successfully, but did emit the message
and I wonder if that's the reason it declared the test a failure. |
d63f37a
to
e5d3a5f
Compare
OK, I moved the whole compiler options to Once our tests turn green I'll merge this, barring other concerns. |
@tkelman, any idea what's up with the AppVeyor builds? |
@ArchRobison, any idea why this warning pops up (only with
It pops up during compilation of the methods to display the value of |
I'll try to build this branch locally and see if I can reproduce the issues. The warning from
Well by modifying compiler options what I meant was things we're currently doing via command-line switches. I'd personally love to see those all go away and be replaced by in-Julia API's. |
Thanks, @tkelman. Regarding Julia APIs, I worry that modifying |
Yeah, some are obviously more suited for tinkering by the user than others. And there's the race condition concern, especially when we start getting multiple Julia threads. I don't know if or when I'll be the one to get to that kind of thing, but this and the various other PR's that add or modify any command-line flags (#9482 and others) pretty much all conflict with one another. Maybe it's not such a big deal, but a little coordination of the changes might be worthwhile. |
@ArchRobison, I think I figured this out: by uncommenting these lines, I found that the warning is being produced during compilation of |
Also speaking of conflicts I'm not sure what the conflict here is (looks like you last rebased just a few hours ago?), so it might be that AppVeyor is merging something funky or old when it does
For instance I don't see it executing the line from 592f3d5, and the headline for which commit it's building says 5a677d5 which doesn't look right. edit: also this branch passes tests fine locally on both win32 and win64 when I check out e5d3a5f |
Yes, I've amended-and-forced-pushed this several times now. Maybe AppVeyor has trouble with forced pushes? Anyway, it sounds like this can be merged. That will let Jake get on with #9482, so I'll do it now. @jakebolewski, if as part of your changes, you want to move the compiler options material I moved from |
Not usually. But it might be getting wacky information from GitHub right now for some reason, are you seeing the "We can't automatically merge this pull request" status like I am? We could ping Feodor and let him know something strange is happening here if we feel the need to. |
Turning off inlining improves the quality of backtraces for debugging
e5d3a5f
to
89b3ce9
Compare
I just did a rebase. Will wait again to see what happens with testing. |
Worked this time (bit of a queue). Should we merge? |
Thanks @timholy for the note about the |
Inlining (one of my favorite performance features of julia) can make debugging harder. This adds a
--noinline
startup option so you can turn it off. This was inspired by JuliaImages/Images.jl#232 (comment).Demo (I temporarily commented out the line that fixed that issue): with regular startup,
With
--noinline
:See how much easier it is debugging it this way? I especially like the fact that I wouldn't have had to use the "add @show statements"/"restart"/"reload Images (10s)" so many times.