-
Notifications
You must be signed in to change notification settings - Fork 94
Add Julia v1.2 to Travis #834
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
Conversation
The failure appears to be due to JuliaLang/julia#32167 |
Codecov Report
@@ Coverage Diff @@
## master #834 +/- ##
==========================================
- Coverage 94.95% 94.93% -0.03%
==========================================
Files 72 72
Lines 7910 7912 +2
==========================================
Hits 7511 7511
- Misses 399 401 +2
Continue to review full report at Codecov.
|
Hmm. @blegat still no luck. Are there other occurrences where this would be needed? |
Progress. We're now failing the tests rather than timing out: https://travis-ci.org/JuliaOpt/MathOptInterface.jl/jobs/575006947 |
@noinline function _no_inlined_bridge_constrained_variable(b, set)
BridgeType = Variable.concrete_bridge_type(b, typeof(set))
bridge = Variable.bridge_constrained_variable(BridgeType, b, set)
return Variable.add_key_for_bridge(Variable.bridges(b), bridge, set)
end
function MOI.add_constrained_variable(
b::AbstractBridgeOptimizer, set::MOI.AbstractScalarSet
)
if is_bridged(b, typeof(set)) ||
is_bridged(b, MOI.SingleVariable, typeof(set))
if B.supports_bridging_constrained_variable(b, typeof(set))
return _no_inlined_bridge_constrained_variable(b, set)
else
variable = MOI.add_variable(b)
constraint = MOI.add_constraint(b, MOI.SingleVariable(variable), set)
return variable, constraint
end
else
return MOI.add_constrained_variable(b.model, set)
end
end The problem is that the compiler can't infer The current fix works around this by defining a fallback to
|
Here's a puzzle on the latest MOI master, not this branch, but on Julia 1.2. using MathOptInterface
const MOI = MathOptInterface
@generated function MOI.Bridges.Constraint.bridge_constraint(BridgeType, b, f, s)
Core.println("Constraint: ") #, BridgeType, b, f, s)
return :(error("Generated Constraint"))
end
@generated function MOI.Bridges.Variable.bridge_constrained_variable(BridgeType, b, s)
Core.println("Variable: ") #, BridgeType, b, s)
return :(error("Generated Variable"))
end
MOI.Utilities.@model(Model, (), (), (MOI.Nonnegatives,), (), (), (), (MOI.VectorOfVariables,), ())
MOI.supports_constraint(::Model{T}, ::Type{MOI.SingleVariable}, ::Type{MOI.GreaterThan{T}}) where {T} = false
const b = MOI.Bridges.full_bridge_optimizer(Model{Float64}(), Float64);
@time MOI.add_constrained_variable(b, MOI.GreaterThan(0.0)) yields Variable:
Variable:
Variable:
Variable:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Variable:
Variable:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Constraint:
Variable:
Constraint:
Variable:
Constraint:
Constraint:
Variable:
3.272182 seconds (15.30 M allocations: 822.902 MiB, 8.54% gc time)
(MathOptInterface.VariableIndex(-1), MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}(-1)) But, if I try using MathOptInterface
const MOI = MathOptInterface
@generated function MOI.Bridges.Constraint.bridge_constraint(BridgeType, b, f, s)
Core.println("Constraint: ", BridgeType, b, f, s)
return :(error("Generated Constraint"))
end
@generated function MOI.Bridges.Variable.bridge_constrained_variable(BridgeType, b, s)
Core.println("Variable: ", BridgeType, b, s)
return :(error("Generated Variable"))
end
MOI.Utilities.@model(Model, (), (), (MOI.Nonnegatives,), (), (), (), (MOI.VectorOfVariables,), ())
MOI.supports_constraint(::Model{T}, ::Type{MOI.SingleVariable}, ::Type{MOI.GreaterThan{T}}) where {T} = false
const b = MOI.Bridges.full_bridge_optimizer(Model{Float64}(), Float64);
@time MOI.add_constrained_variable(b, MOI.GreaterThan(0.0)) I get (note: no prints) 3.194577 seconds (15.28 M allocations: 821.955 MiB, 8.54% gc time)
(MathOptInterface.VariableIndex(-1), MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}(-1)) Why are the generated methods not being called if they print the argument types? Edit: they can print |
No description provided.