Message Boards Message Boards

0
|
4108 Views
|
8 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Using Mosek on 13.0.1 and MacOS ARM

Posted 2 years ago

Is there any special setup steps for running the optimization library Mosek with version 13.0.1 on Mac OS X ARM 64-bit ?

I got the trial license after that I get an error message saying I do not have one:

enter image description here

The same code :

SetEnvironment[ "MOSEKLM_LICENSE_FILE" ->  FileNameJoin[{$HomeDirectory, "mosek", "mosek.lic"}]]
$Version
ConvexOptimization[x + 2 y, {x^2 + y^2 <= 1}, {x, y},  Method -> "MOSEK"]

runs fine with version 13.0.0 on Mac OS x86 (64-bit).


I got an ARM (64-bit) of Mosek version from here: https://www.mosek.com/downloads/10.0.15/

Then made the corresponding installations in R (using the package Rmosek) and got Mosek working on macOS ARM laptop.

POSTED BY: Anton Antonov
8 Replies

Now that Mosek 10 is in stable release, are there any timelines to update MOSEKLink with the new M architecture version? I have been running in Rosetta--works great, but the speed increase for native binaries (and speed increases from Mosek 10!) would be nice.

Posted 1 year ago

How would you be able to make MOSEKLink work with Rosetta? Do you install a intel version of Mathematica?

POSTED BY: Sizhuo Yu

I am using wolfram desktop, but I assume it’s the the same for Mathematica. It’s a universal binary, so if you right click on the bundle in your applications folder and select “Get Info” there is a little check box to run it using Rosetta. It will run the whole thing using the Intel code path.

You also might be able to launch a single kernel using Rosetta with custom kernel configs and then connect to it from your main kernel to run just your optimization routine, but I have not tried that.

The other option you have is to download the arm Mac version of mosek directly. The new compilers functionality provides ways to access the C library functions directly without having to write your own LibraryLink c code. I was able to get a toy linear optimization problem running like this, but it was a lot of work, but you lose the (in my opinion, immense) benefit of being able to model your problem symbolically and leverage Wolfram’s automatic DCP support, and my problem is conic and would require bridging a bunch more mosek library commands so I gave up on this route. If you were to reimplement the external solver interface like this you’d basically have a version of MosekLink with drop-in library support.

Currently, MosekLink looks like it relies on a precompiled LibraryLink bridge to Mosek, so you can’t just update the mosek c library. I think your best bet is to use Rosetta for now and hope that they update MosekLink soon. The interface is the same, and it’s pretty simple, so presumably they just need to recompile the library link shared object and distribute an arm version of that and mosek in the paclet and it should “just work” (assuming no library link weirdness on Mac arm.)

Hope that helps.

Posted 1 year ago

Thanks for the help!

Finally I go with your second suggestion to configure a separate Rosetta kernel following the instructions from https://mathematica.stackexchange.com/questions/282745/how-do-i-launch-a-kernel-under-rosetta-when-im-running-the-frontend-natively-on. I haven't test its performance but at least it works.

POSTED BY: Sizhuo Yu

We are aware of this issue. Mosek 10 which natively supports MacOSX-ARM64 is still in Beta. We expect to update MOSEKLink when it comes out. Meanwhile, you can run the shipping version by starting Mathematica under Rosetta emulation.

POSTED BY: Moderation Team

Thank you for your prompt reply!

POSTED BY: Anton Antonov
Posted 1 year ago

Hello, I am wondering if there is a schedule to fix this issue given that now the Mosek 10 natively support arm64 architecture?

POSTED BY: Sizhuo Yu

This is already implemented and should become available in the next WL release (version 13.3).

POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract