View Single Post
Old 2022-04-04, 19:55   #122
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·13·257 Posts
Default

Now that I finally have an Apple M1, I am starting the process of getting mtsieve to build on it. So far I have only worked on mfsieve, the CPU-only multi-factorial siever.

For a range that I have been sieving, a single core on my 10-core i9 iMac is less than half as fast as a single core on the 8 core M1 MacBook Pro. I was not expecting it to be that much faster.

On the downside the GPU code in mfsievecl on that i9 is at least 50x faster than the CPU code on that same i9.

In order to compare "apples to apples" in the GPU I will need to use Metal instead of OpenCL for the GPU kernel. That will be a bit more work since I have not worked with Metal. I don't think that Metal will be too terrible to work with, but to have it build with Metal on OS X and OpenCL on other platforms could require a lot of effort and it adds yet another code path to support.

If anyone has an M1 and wants to do some sieving (CPU only), send me a PM and I will make it a priority to get that program running on OS X.

My first focus will probably be to get as many running on the CPU as I can before tackling Metal as that is mostly busy work. I think that some of the sieving programs require AVX or x86 ASM for the main loop, so those are going to have lower priority.

My goal is "no ARM ASM" for the M1 ports. I see nothing which makes that impossible.

Of course if anyone wants to pitch in with the effort, send me a PM.

There appears to be a bug in Apple's OpenCL driver. The multi-sequence kernel used by srsieve2cl crashes immediately. Works fine on other platforms. Apply won't fix it since they want everyone to use Metal. I haven't had issues with any other kernels on OS X, so the problem could reside between the keyboard and the chair. I have no idea how easy or difficult it could be to fix that issue if I wanted to get it to work.
rogue is offline   Reply With Quote