[HN Gopher] Decompiling x86 Deep Neural Network Executables ___________________________________________________________________ Decompiling x86 Deep Neural Network Executables Author : matt_d Score : 27 points Date : 2022-10-09 18:18 UTC (4 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | 37ef_ced3 wrote: | This will not be able to reverse engineer fully-customized, | fully-fused neural networks generated by NN-512: | | https://NN-512.com | | NN-512 generates custom code for all the operations, custom units | of work for the threads, custom code around tensor edges, | everything is fused and unrolled and customized. If they can | deduce the network graph specification from the AVX-512 code, I | will be astonished. | | If you can do it, show me. But I know you can't. | | Anyone who cares about model privacy will use their own variant | of a tool like NN-512. It's security through obscurity, but | that's the best you can hope for if you are distributing an | executable. | bertr4nd wrote: | By "fully fused" do you mean no function call boundaries? | ("Fused" is such an overloaded term) | 37ef_ced3 wrote: | Convolutions are fused into convolutions, elementwise | operations are fused into convolutions, everything is inlined | except where function calls are needed for pthread work units | (and those work units are all custom/arbitrary). | rootw0rm wrote: | exe sample? | c0balt wrote: | I don't have a ms windows pc available nor the time to setup | cross compilation for one rn. (Assuming you meant an | executable file for one of those with 'exe'). | | However you ahould be able be able to compile one for | yourself by downloading, from e.g. | https://nn-512.com/browse/DenseNet121, one of the generated C | files and compiling it with GCC[0]. It shouldn't require any | special dependencies beside AVX support on your CPU. | | Edit: Regarding general decompilation for neural networks | this project might be interesting[1] | | [0]: https://gcc.gnu.org/ [1]: | https://github.com/monkbai/DNN-decompiler | rootw0rm wrote: | OS isn't terribly important, but thanks for the reply. i | only have AVX2 on this system tho | 37ef_ced3 wrote: | So... | | ...you were unable to decipher this Hacker News comment | thread... | | ...unable find some C code and build it with GCC and make an | executable for yourself... | | ...but you think you can reverse engineer the executable? | [deleted] | rootw0rm wrote: | there's a million crackmes i can download right now, i | don't really feel like chasing dependencies and building it | myself. also, no AVX-512 | userbinator wrote: | _If you can do it, show me. But I know you can 't_ | | I've been out of the cracking scene for over a decade now, but | I expect that to be none other than a challenge, having seen | how far publicly available decompilers have progressed. | 37ef_ced3 wrote: | Here is the C code for a DenseNet-121 generated by NN-512: | | https://nn-512.com/browse/DenseNet121 | | Even if you had the C code available to you, you would have a | hard time producing the input graph. | | Good luck reverse engineering it after GCC has compiled it! | | NN-512 has an incredibly flexible code generator. It can | easily be tweaked to produce completely different code for | the same convolution, so everyone can apply their own twist | to defeat the reverse engineers ("the intellectual property | thieves"). | sudosysgen wrote: | You're describing every single obfuscation scheme, they all | get defeated. And you don't need to find the original graph | either, they may be equivalent ones and that could work | too. | WanderPanda wrote: | Oh looks like something AMD might want to upstream :p ___________________________________________________________________ (page generated 2022-10-09 23:00 UTC)