mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2019-06-19, 23:22   #1
neomacdev
 
Apr 2019

1616 Posts
Default Interest in partnering on an appleTV / iOS / macOS factoring / prime project?

Hi,

I've had a growing interest in all things factoring & primality testing for the last six+ months, in which time I've been reading a multitude of articles and some books on the topic. Along the way it occurred to me that most appleTV devices sit unused ~22+ hours a day, and that is a LOT of idle computing power. It'd be nice have an appleTV app for Mersenne trial factoring, or other prime search computation tasks, to tap all that unused computation power.

My background is as a Mac Software Engineer (mostly automation & app-level UI type coding, not deep scientific computing / or low-level GPU stuff) and used to work at Apple on their AVFoundation video capture/editing/export framework for macOS/iOS/appleTV. My primary development language for the last 15+ years has been Objective-C, and I pretty much never touch Windows/Linux boxes, and rarely venture outside the niceties and convenience of Xcode, Objective-C, Apple application frameworks.

I've noticed of the various prime related software projects out there (gpuOwl, mfakto, mfactc, clLucas, llrCUDA, CUDALucas, Prime95, etc) most are Linux/Windows targeted, but may run on Macs as an afterthought. Where inline assembly is used it always seems to only be available as x86/x64, and not ARM, leaving iOS/appleTV unavailable as targets. And all the GPU accelerated stuff is CUDA or OpenCL. While Apple was the original developer of OpenCL, they have since abandoned it on the Mac, with their proprietary Metal framework replacing it and providing seamless GPU access across the Mac, iOS, and appleTV devices. (Yes, you can still compile & run OpenCL for now.)

At any rate, I'd be interested in working on a project to re-implement / migrate some of the existing prime search tools out there to the macOS/iOS/appleTV platforms including use of Apple's modern Metal framework for GPU based computation. (That might also require ARM assembly development for the inlined manual assembly optimizations.) I've got a full-time job, so this would just be a part-time project, but I could see devoting 10-15 hours per week on it. Ideally, I'd love to find one or two other people interested in working on this also.

If there is anyone else out there that also has some interest in working on a project like this please respond below or PM me. It'd be great to partner with someone with some GPU experience or ARM assembly experience as I'm lacking in those areas, but really the primary thing is just someone to bounce ideas off of, plan out the development, and collaborate with along the way to building out some tools/apps for prime searching on appleTV/iOS devices.

Looking forward to talking to you soon! :-)
neomacdev is offline   Reply With Quote
Old 2019-06-19, 23:43   #2
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
Rep├║blica de California

2×13×443 Posts
Default

FYI, Mlucas - see separate subforum under 'Software' - runs on Mac and has ARMv8 assembly, but no GPU support.
ewmayer is offline   Reply With Quote
Old 2019-06-20, 00:48   #3
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

24×32×41 Posts
Default

As the write of the mtsieve framework, I would love to have ARM assembly functions to correspond to the x86 ones. It is written in C++ and some of the sieves can use OpenCL. It compiles on Windows, OS X, and Linux, so it is designed to be portable. I can attest to the OS X part as I have used Macs since the original 128. I just don't integrate with Xcode as I use the command line tools for portability. Most of the x86 functions are fairly short and describe what they do (although the how is not always as obvious).

mtsieve isn't used to do primality tests, but most people use the various programs built upon the framework for their own pet projects.
rogue is online now   Reply With Quote
Old 2019-06-20, 00:57   #4
neomacdev
 
Apr 2019

2×11 Posts
Default

Quote:
Originally Posted by ewmayer View Post
FYI, Mlucas - see separate subforum under 'Software' - runs on Mac and has ARMv8 assembly, but no GPU support.
Awesome. I just grabbed the source, and it looks like I have something fun to dig into studying soon!

Also, just realized/remembered that inline assembly code may be forbidden for appleTV apps to be distributed via the AppStore. I know they need to be in LLVM Bitcode, and I think that means no raw inline assembly can be used, or maybe just another hoop to jump though to be complaint. I'll have to look into that.
neomacdev is offline   Reply With Quote
Old 2019-06-20, 01:08   #5
neomacdev
 
Apr 2019

2·11 Posts
Default

Quote:
Originally Posted by rogue View Post
mtsieve framework ... is written in C++ and some of the sieves can use OpenCL. It compiles on Windows, OS X, and Linux ...
I've been looking at the code of a lot of different prime-related software projects lately, and hadn't gotten to mtsieve yet, but it was on my radar. As I map-out the work I want to accomplish for getting something running on appleTVs, if I think you can make use of anything I do back in mtsieve I'll be sure to let you know.
neomacdev is offline   Reply With Quote
Old 2019-06-20, 01:41   #6
ixfd64
Bemusing Prompter
 
ixfd64's Avatar
 
"Danny"
Dec 2002
California

72·47 Posts
Default

I recently added macOS support to mfakto. It's not in the official repository yet as the author isn't very active these days, but you can check out one of the forks:

https://github.com/preda/mfakto
https://github.com/ixfd64/mfakto

Last fiddled with by ixfd64 on 2019-06-20 at 16:26
ixfd64 is offline   Reply With Quote
Old 2019-06-20, 12:30   #7
neomacdev
 
Apr 2019

2·11 Posts
Default

Quote:
Originally Posted by ixfd64 View Post
I recently added macOS support to mfakto. It's not in the official repository yet as the author isn't very active these days, but you can get check out one of the forks:

https://github.com/preda/mfakto
https://github.com/ixfd64/mfakto
Great! I just grabbed the source from GitHub, and will add it to the list of projects I am reviewing as I chart out a path to building a solution to run on appleTVs.
neomacdev is offline   Reply With Quote
Old 2019-06-21, 22:16   #8
neomacdev
 
Apr 2019

2×11 Posts
Default

After doing some research it turns out if I want to distribute the appleTV app via the Apple AppStore, then I can't use any ARM assembly directly. A few years back they started requiring bitcode for all appleTV app submissions -- basically LLVM IR (intermediate representation), which Apple then compiles down to the real app they distribute via the AppStore. And you can't have any assembly in the LLVM IR. But I can still do an appleTV app that uses the Metal framework for GPU acceleration. And could conceivably do an appleTV app with ARM assembly that could only be used on jailbroken appleTVs (which may be worth toying with for a small appleTV compute cluster, but I probably don't want to get into distributing it.)
neomacdev is offline   Reply With Quote
Old 2019-06-22, 08:04   #9
M344587487
 
M344587487's Avatar
 
"Composite as Heck"
Oct 2017

3·11·19 Posts
Default

I applaud your willingness to try and navigate all the roadblocks that Apple has introduced to block people from using the hardware as they wish. It's all a big bag of awful that most can't justify touching no matter how long the pole. Good luck.
M344587487 is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trial Factoring Elimination up to 2^64 Project tapion64 PrimeNet 31 2014-04-12 02:42
NOT the official forum factoring project thread jyb Factoring 2 2013-09-03 16:11
Any interest in some low n ECM factoring? ltd Prime Sierpinski Project 19 2005-08-12 06:24
New k*2^n+-1 factoring project mklasson Factoring 2 2004-03-06 15:07

All times are UTC. The time now is 12:54.

Wed Sep 23 12:54:00 UTC 2020 up 13 days, 10:04, 1 user, load averages: 1.71, 1.62, 1.72

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.