New android app "BadukAI"

For discussing go computing, software announcements, etc.
And
Gosei
Posts: 1464
Joined: Tue Sep 25, 2018 10:28 am
GD Posts: 0
Has thanked: 212 times
Been thanked: 215 times

Re: New android app "BadukAI"

Post by And »

suppose the two networks are equal in strength. then the six game match will end
with a score of 0:6 with a probability of 0.015625 (1/64)
with a score of 1:5 with a probability of 0.09375 (6/64)
with a score of 2:4 with a probability of 0.234375 (15/64)
with a score of 3:3 with a probability of 0.3125 (20/64)
with a score of 4:2 with a probability of 0.234375 (15/64)
with a score of 5:1 with a probability of 0.09375 (6/64)
with a score of 6:0 with a probability of 0.015625 (1/64)

six games is not enough to say anything with certainty. maybe analyze these games and see how does the optimized network perform compared to the original one? Are there any weak or weird moves? can you upload sgf?
I think the difference is negligible, BadukAI and optimized networks are amazing!!! thanks akigo!!!
go4thewin
Lives with ko
Posts: 150
Joined: Thu Jan 23, 2020 6:09 am
Rank: 25 kyu
GD Posts: 0
Has thanked: 200 times
Been thanked: 30 times

Re: New android app "BadukAI"

Post by go4thewin »

I was getting this same feeling using the snapdragon optimized network against golaxy. it definitely felt at least as strong as the s509 network. What an achievement by all of you to create such a strong, small and fast network. You have made katago play at a professional level even on cheap mobile devices. The kyu mode works well too with the opening book turned on. Even at 10 kyu, the optimized network does not make egregious errors. I am just in awe of how well these projects went and the immense power of modern computing to solve problems that humans cannot.
lovego
Dies in gote
Posts: 61
Joined: Thu Jan 21, 2021 6:17 pm
Rank: KGS 1 dan
GD Posts: 0

Re: New android app "BadukAI"

Post by lovego »

I have two mobile phones, one of which is Huawei mate30 and its processor is kirin990. But its speed is much slower than that of mobile phones using Qualcomm chips. Can it be optimized?
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: New android app "BadukAI"

Post by akigo »

lovego wrote:I have two mobile phones, one of which is Huawei mate30 and its processor is kirin990. But its speed is much slower than that of mobile phones using Qualcomm chips. Can it be optimized?
Unfortunately not, since the optimized networks use per-channel quantization (otherwise it's impossible to achieve the accuracy that is needed). And the NPU on Kirin 990 doesn't support this according to https://github.com/tensorflow/tensorflow/issues/43128
lovego
Dies in gote
Posts: 61
Joined: Thu Jan 21, 2021 6:17 pm
Rank: KGS 1 dan
GD Posts: 0

Re: New android app "BadukAI"

Post by lovego »

What a pity, but can you provide a low precision but faster weight for huawei phones? I can test it
And
Gosei
Posts: 1464
Joined: Tue Sep 25, 2018 10:28 am
GD Posts: 0
Has thanked: 212 times
Been thanked: 215 times

Re: New android app "BadukAI"

Post by And »

lovego wrote:What a pity, but can you provide a low precision but faster weight for huawei phones? I can test it
then what's the point? the network will be weak. try 20 or 15 block network
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: New android app "BadukAI"

Post by akigo »

And is right: With other quantization methods the error will be larger than the difference between best and worst move, so the network will produce pretty random results (I tried this some time ago for a different purpose). Such a network would be useless, no matter how fast it is.
floating
Dies in gote
Posts: 42
Joined: Wed Dec 11, 2013 8:45 am
Rank: 2k
GD Posts: 0
Has thanked: 13 times
Been thanked: 9 times

Re: New android app "BadukAI"

Post by floating »

I decided to retry badukAI (last time I couldn't get it to work). I downloaded the apk 1.13 from https://aki65.github.io/ and also downloaded the bin.gz and .tflite from the assets (1.13.2) at github releases page.

The 20b and 10b internal networks seem to work now which is great! Though once I load network from storage and choose those files I downloaded it says AI engine crashed or such when I turn the play B or Play W button blue as in instructing it to play it. I tried to go to the phone's settings page for the badukai and there it says the app has requested no permissions, was just wondering if it lacked some permissions but it seems to not ask any. I haven't changed any config settings in badukAI if that could make the downloaded networks work. No idea what settings I should try there if that's the case.

By the way how much stronger this 1.13.2 network is compared to the 20b and 10b internal networks? I guess if I go through this thread there is info of the strength of the internal 20b and 10b
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: New android app "BadukAI"

Post by akigo »

floating wrote: By the way how much stronger this 1.13.2 network is compared to the 20b and 10b internal networks ?
According to https://github.com/breakwa11/GoAIRatings the 20b network has around 5050 Elo at 1200 visits on the human scale (so already far stronger than the best humans). According to https://katagotraining.org/networks/ the 1.13.2 network is around 500 Elo stronger at equal playouts, so around 300 Elo stronger at equal time. Therefore the 20b network should be ok for most use cases.

Both networks have the same structure, just different size, so if the smaller one runs and the bigger one does not, it could be a memory problem (especially if there is a lot of background activity on the phone).
floating
Dies in gote
Posts: 42
Joined: Wed Dec 11, 2013 8:45 am
Rank: 2k
GD Posts: 0
Has thanked: 13 times
Been thanked: 9 times

Re: New android app "BadukAI"

Post by floating »

Cool I see thanks! The 20b will be just fine for me then.

Anyway I still tried a bit. Adding here notes. This is a redmi note 7 with 6GB ram version. I'm running Lineage OS 17. I closed all other apps and from developer options closed couple running services that used over 300MB ram so it shows now system 2G, Apps ~400M and free 3.6G. Then started badukAI, it initialized the 40b from the assets/releases I had downloaded but still crash after playing a move.
go4thewin
Lives with ko
Posts: 150
Joined: Thu Jan 23, 2020 6:09 am
Rank: 25 kyu
GD Posts: 0
Has thanked: 200 times
Been thanked: 30 times

Re: New android app "BadukAI"

Post by go4thewin »

if you want the strongest net, the 60b net in this link should work fine for you
https://media.katagotraining.org/upload ... 017.bin.gz
floating
Dies in gote
Posts: 42
Joined: Wed Dec 11, 2013 8:45 am
Rank: 2k
GD Posts: 0
Has thanked: 13 times
Been thanked: 9 times

Re: New android app "BadukAI"

Post by floating »

That one crashes already while loading. Once I press "load" I get KG is dead/crashed. In case it worked, I guess that one wouldn't require an additional .tflite file?
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: New android app "BadukAI"

Post by akigo »

@floating

To sum up, you get

20b optimized (file size 25 MB): works fine
40b optimized (file size 50 MB): initializes, but crashes when it starts "thinking"
60b original (file size 400 MB): doesn't even initialize

This series strongly suggests memory problems. 3.6 GB may sound a lot, but in the area of neural networks, it's really not that much.

You could try reducing the cache that KataGo uses: Change "nnCacheSizePowerOfTwo" from 20 to 10 in settings. I don't know which percentage of KataGo's total memory usage is caused by the cache, but it's worth a try ...
lovego
Dies in gote
Posts: 61
Joined: Thu Jan 21, 2021 6:17 pm
Rank: KGS 1 dan
GD Posts: 0

Re: New android app "BadukAI"

Post by lovego »

Graph search is merged to katago, it can lead +100 Elo improvement, can you update the engine soon? :clap:
akigo
Lives with ko
Posts: 186
Joined: Sun Jun 28, 2020 11:20 am
GD Posts: 0
Has thanked: 13 times
Been thanked: 154 times

Re: New android app "BadukAI"

Post by akigo »

I made a new version (1.14) available on play store https://play.google.com/store/apps/deta ... r.baduk_ai and github https://github.com/aki65/aki65.github.i ... ag/v1.14.0 with the following changes:

- support NPU on recent Mediatek devices
- upgrade KataGo (including graphsearch)
- load sgf from clipboard
- load sgf with arbitrary encoding
Post Reply