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

Inference problems #7

Closed
ericphanson opened this issue Sep 6, 2019 · 4 comments
Closed

Inference problems #7

ericphanson opened this issue Sep 6, 2019 · 4 comments

Comments

@ericphanson
Copy link
Owner

The tests don't finish on Julia 1.2+. Even locally with MOI v0.8 it seems slow, so it could be different than JuliaLang/julia#32167. I will try all platforms on Travis with compat set to MOI v0.8 to see if that helps.

@ericphanson
Copy link
Owner Author

CI: https://travis-ci.com/ericphanson/TravelingSalesmanExact.jl/builds/126257518

Stalls out on the big problem on 1.2+ even with MOI v0.8. It’s a bit weird because it can solve the smaller problems ok (I moved the big problem to the end to check).

@ericphanson
Copy link
Owner Author

One thing special about the problem that gets stuck is that verbose=true. So it could be a problem with unicode plots, for example. I set verbose=true for an earlier problem that was solved on all versions, so when CI finishes, that could show if it's a problem with verbose=true or with something else.

CI: https://travis-ci.com/ericphanson/TravelingSalesmanExact.jl/builds/126275354

@ericphanson
Copy link
Owner Author

I turned on verbose=true on a small problem also specified by cities so that plots are generated. That works fine (CI: https://travis-ci.com/ericphanson/TravelingSalesmanExact.jl/builds/126635605). It's weird because I don't see why it should be doing more type inference at this point-- it should've run basically the same code already, just on a smaller problem. (And JuMP converts everything to Float64, so the fact that the file uses integers shouldn't matter). I'll need to do some profiling / put in debug logging etc and figure out exactly where it gets stuck and what it's doing, but I don't have time right now.

@ericphanson
Copy link
Owner Author

ericphanson commented Sep 20, 2019

Locally 6f6150a fixes the inference problems (CI in progress here. edit: passes). I really don't understand why, but it seems like the inference hang is deciding in the case of cities::Vector{Any} whether to call the method with signature

get_optimal_tour(cost::AbstractMatrix, with_optimizer =  get_default_optimizer(); verbose = false, symmetric = issymmetric(cost))

or the method with signature

get_optimal_tour(cities::AbstractVector, with_optimizer = get_default_optimizer(); verbose = false, distance = euclidean_distance, symmetric = true)

and it can't figure out which. Adding the type information for cities to be Vector{Vector{Int}} instead of Vector{Any} somehow lets it figure out which one to call much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant