Skip to content

Commit

Permalink
Apparently powers of 2 are better. 10^6 also somehow gives incorrect …
Browse files Browse the repository at this point in the history
…results.
  • Loading branch information
zfnmxt committed Feb 20, 2024
1 parent 870f97f commit 87da34a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Futhark/Solve/LP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ linearProgToPulp prog =
rm_subscript x = fromMaybe x $ lookup x $ zip "₀₁₂₃₄₅₆₇₈₉" "0123456789"

bigM :: (Num a) => a
bigM = 10 ^ 6
bigM = 2 ^ 10

oneIsZero :: (Eq a, Num a, Ord v) => (v, v) -> (v, v) -> [Constraint v a]
oneIsZero (b1, x1) (b2, x2) =
Expand Down

2 comments on commit 87da34a

@athas
Copy link
Member

@athas athas commented on 87da34a Feb 20, 2024

Choose a reason for hiding this comment

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

This commit message is not worrying at all!

@zfnmxt
Copy link
Collaborator Author

@zfnmxt zfnmxt commented on 87da34a Feb 20, 2024

Choose a reason for hiding this comment

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

When bigM is too big, the constraint M <= bigM * b_M isn't respected, where b_M is the binary variable associated with the (auto)map variable M; b_M = 1 <===> |M| >= 1. I guess b_M attains very small but non-zero values in the LP relaxation and so the constraint ends up satisfied for large bigM. But I'm surprised it happens even at "modest" values of bigM. This issue is also briefly mentioned here.

I'm worried that even 1000ish is too big; they say a problem is "well-scaled" only at much smaller coefficients.

At any rate, bigM represents the maximum AUTOMAP rank we expect to ever see; more modest values of 100 or something are also probably fine...right? (And failure here is somewhat "graceful" in the sense that if a rank above that was encountered, the ILP would just be overly constrained and you wouldn't get a solution (rather than a wrong solution)).

Please sign in to comment.