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

Some more fixes for Julia 1.0 #150

Merged
merged 6 commits into from
Aug 28, 2018
Merged

Some more fixes for Julia 1.0 #150

merged 6 commits into from
Aug 28, 2018

Conversation

daschw
Copy link
Contributor

@daschw daschw commented Aug 22, 2018

No description provided.

deps/build.jl Outdated
@@ -1,4 +1,7 @@
using Compat
@static if VERSION >= v"0.7"
using Libdl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need 4-spaces indent

@odow
Copy link
Member

odow commented Aug 23, 2018

Can you confirm that the tests pass, and that these are the only imports required from MathProgBase?

@daschw
Copy link
Contributor Author

daschw commented Aug 23, 2018

No, I have to update and add some more MathProgBase imports. Thanks for the hint and sorry for my sloppiness! I can update the PR later today.

@daschw daschw changed the title Some more fixes for Julia 1.0 WIP: Some more fixes for Julia 1.0 Aug 23, 2018
@blegat
Copy link
Member

blegat commented Aug 23, 2018

@daschw The cleanest way is to do what is done in jump-dev/Ipopt.jl#127, i.e. defining an MPB constant and explicitely prefixing with MPB.

@daschw
Copy link
Contributor Author

daschw commented Aug 27, 2018

Here's the output of running the tests locally with this branch:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> cd(joinpath(homedir(), ".julia", "dev", "Gurobi"))

shell> git branch
* fix1.0
  master

(v1.0) pkg> test Gurobi
   Testing Gurobi
 Resolving package versions...
    Status `C:\Users\Daniel\AppData\Local\Temp\jl_6905.tmp\Manifest.toml`
  [34da2185] Compat v1.1.0
  [2e9cd046] Gurobi v0.5.0+ [`C:\Users\Daniel\.julia\dev\Gurobi`]
  [f8899e07] LinQuadOptInterface v0.3.0
  [b8f27783] MathOptInterface v0.5.1
  [fdba3010] MathProgBase v0.7.3
  [2a0f44e3] Base64  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Base64`]
  [ade2ca70] Dates  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Dates`]
  [8bb1440f] DelimitedFiles  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\DelimitedFiles`]
  [8ba89e20] Distributed  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Distributed`]
  [b77e0a4c] InteractiveUtils  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\InteractiveUtils`]
  [76f85450] LibGit2  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\LibGit2`]
  [8f399da3] Libdl  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Libdl`]
  [37e2e46d] LinearAlgebra  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\LinearAlgebra`]
  [56ddb016] Logging  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Logging`]
  [d6f4376e] Markdown  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Markdown`]
  [a63ad114] Mmap  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Mmap`]
  [44cfe95a] Pkg  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Pkg`]
  [de0858da] Printf  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Printf`]
  [3fa0cd96] REPL  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\REPL`]
  [9a3f8284] Random  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Random`]
  [ea8e919c] SHA  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\SHA`]
  [9e88b42a] Serialization  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Serialization`]
  [1a1011a3] SharedArrays  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\SharedArrays`]
  [6462fe0b] Sockets  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Sockets`]
  [2f01184e] SparseArrays  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\SparseArrays`]
  [10745b16] Statistics  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Statistics`]
  [8dfed614] Test  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Test`]
  [cf7118a7] UUIDs  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\UUIDs`]
  [4ec0a83e] Unicode  [`C:\Users\Daniel\AppData\Local\Julia-1.0.0\bin\..\share\julia\stdlib\v1.0\Unicode`]
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Test Summary: | Pass  Total
C API         |   19     19
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\Daniel\.julia\packages\MathProgBase\gj15W\src\HighLevelInterface\HighLevelInterface.jl:9
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
┌ Warning: Julia Gurobi interface doesn't properly support range (two-sided) constraints. See Gurobi.jl issue #14
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\MPBWrapper.jl:146
Academic license - for non-commercial use only
Read MPS format model from file C:\Users\Daniel\.julia\dev\Gurobi\test\MathProgBase\test_get_strarray.mps
Reading time = 0.00 seconds
TESTPROB: 3 rows, 3 columns, 6 nonzeros
Academic license - for non-commercial use only
┌ Warning: Gurobi will silently silently truncate objective coefficients >1.0e100 or <-1.0e100. Current objective coefficient extrema: (1.1e100, 1.1e100)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:84
Academic license - for non-commercial use only
┌ Warning: Gurobi will silently silently truncate objective coefficients >1.0e100 or <-1.0e100. Current objective coefficient extrema: (-1.1e100, -1.1e100)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:84
Academic license - for non-commercial use only
┌ Warning: Gurobi has implicit variable bounds of [-1e30, 1e30]. Settings variable bounds outside this can cause infeasibility or unboundedness. Current lower bound extrema: (1.1e30, 1.1e30). Current upper bound extrema: (Inf, Inf)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:88
Academic license - for non-commercial use only
┌ Warning: Gurobi has implicit variable bounds of [-1e30, 1e30]. Settings variable bounds outside this can cause infeasibility or unboundedness. Current lower bound extrema: (-Inf, -Inf). Current upper bound extrema: (-1.1e30, -1.1e30)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:88
Academic license - for non-commercial use only
┌ Warning: Gurobi has implicit variable bounds of [-1e30, 1e30]. Settings variable bounds outside this can cause infeasibility or unboundedness. Current lower bound extrema: (-1.1e30, -1.1e30). Current upper bound extrema: (Inf, Inf)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:88
Academic license - for non-commercial use only
┌ Warning: Gurobi has implicit variable bounds of [-1e30, 1e30]. Settings variable bounds outside this can cause infeasibility or unboundedness. Current lower bound extrema: (-Inf, -Inf). Current upper bound extrema: (1.1e30, 1.1e30)
└ @ Gurobi C:\Users\Daniel\.julia\dev\Gurobi\src\grb_common.jl:88
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Test Summary:      | Pass  Total
MathProgBase Tests |  240    240
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
┌ Warning: Constant in scalar function moved into set.
└ @ LinQuadOptInterface C:\Users\Daniel\.julia\packages\LinQuadOptInterface\u4wTU\src\constraints\scalaraffine.jl:44
┌ Warning: Constant in scalar function moved into set.
└ @ LinQuadOptInterface C:\Users\Daniel\.julia\packages\LinQuadOptInterface\u4wTU\src\constraints\scalaraffine.jl:44
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Academic license - for non-commercial use only
Test Summary:          | Pass  Total
MathOptInterface Tests | 2117   2117
   Testing Gurobi tests passed

@daschw daschw changed the title WIP: Some more fixes for Julia 1.0 Some more fixes for Julia 1.0 Aug 27, 2018
@ExpandingMan
Copy link
Contributor

For me (old version of Gurobi) on line 351 you need to qualify getobj as MPB.getobj or else it throws an undefined error.

@daschw
Copy link
Contributor Author

daschw commented Aug 28, 2018

Thanks a lot @ExpandingMan, I missed that on 1.0.
Now the tests pass locally on 0.6.4 and on 1.0.

@ExpandingMan
Copy link
Contributor

Note also that on Julia 1.0 and JuMP 0.18 (yes, it works now if you check out release-0.18) I'm getting an enormous regression in the time it takes to call build on the Gurobi model (from a few seconds on 0.6 to almost 2 minutes in my case). I don't suppose you have any ideas what might be causing this? It's just as likely that the problem is in JuMP as it is here in the solver. Regardless I don't think you should hesitate to merge this based on that, I'm going to look into the regression when I have time.

@blegat
Copy link
Member

blegat commented Aug 28, 2018

@ExpandingMan is it compile time or run time ? What happens in the second run ? We have similar issues with JuliaPolyhedra/Polyhedra.jl#110

@ExpandingMan
Copy link
Contributor

It definitely appears to be run-time as it happens in the middle of the execution of a function, though of course in Julia I'm never 100% certain that nothing is compiling.

@blegat
Copy link
Member

blegat commented Aug 28, 2018

If you execute this function twice with the same arguments, you know that the second time, nothing is compiling.

@ExpandingMan
Copy link
Contributor

Nope, it's definitely all run-time, compile time seems just fine.

That's actually a huge relief because that means it fixable.

@rdeits
Copy link
Collaborator

rdeits commented Aug 28, 2018

Can you run the profiler and get a sense of what part is slow?

@ExpandingMan
Copy link
Contributor

What profiler do you use? I'm not aware of any good ones. I do know the slowness occurs in build.

@blegat
Copy link
Member

blegat commented Aug 28, 2018

You can use https://github.com/timholy/ProfileView.jl

@ExpandingMan
Copy link
Contributor

That package doesn't look maintained and surely will not work on 1.0.

The regression only seems to be on 1.0, and probably only with MathProgBase, and before this PR Gurobi was not working on 1.0 at all. Therefore I suggest that you merge this PR now and we can look into the regressions. This will definitely be a priority for me at some point, so I'll look into it as soon as I can, but please don't let that stop you from merging this.

@blegat
Copy link
Member

blegat commented Aug 28, 2018

Yes, the issue should be moved to another thread. Note that ProfileView is maintainted and is being update to Julia v1.0: timholy/ProfileView.jl#96

@blegat blegat merged commit 3ab5d4e into jump-dev:master Aug 28, 2018
@rdeits
Copy link
Collaborator

rdeits commented Aug 28, 2018

@ExpandingMan you can also store a profile using the built-in Profile and then load it with ProfileView on 0.6: https://github.com/timholy/ProfileView.jl#saving-profile-data-manually

Juno also has a built-in profile viewer: http://docs.junolab.org/latest/man/juno_frontend.html#Profiler-1

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

Successfully merging this pull request may close these issues.

5 participants