I'm less than impressed after following the link to the Nature article.
A figure box showss some code improvements that the AI was able to
discover, claiming they are algorithmic improvements.
What's in the figure is pedestrian algebraic reductions that are par for
the course for compilers:
Original AlphaDev
Memory[0] = A Memory[0] = A
Memory[1] = B Memory[1] = B
Memory[2] = C Memory[2] = C
mov Memory[0] P // P=A mov Memory[0] P // P=A
mov Memory[1] Q // Q=B mov Memory[1] Q // Q=B
mov Memory[2] R // R=C mov Memory[2] R // R=C
mov R S mov R S
cmp P R cmp P R
cmovg P R // R = max(A, C) cmovg P R // R = max(A, C)
cmovl P S // S = min(A, C) cmovl P S // S = min(A, C)
mov S P // P = min(A, C) ****
cmp S Q cmp S Q
cmovg Q P // P = min(A, B, C) cmovg Q P // P = min(A, B)
cmovg S Q // Q = max(min(A, C), B) cmovg S Q // Q = max(min(A, C), B)
mov P Memory[0] // = min(A, B, C) mov P Memory[0] // = min(A, B)
mov Q Memory[1] // = max(min(A, C), B) mov Q Memory[1] // = max(min(A, C), B)
mov R Memory[2] // = max(A, C) mov R Memory[2] // = max(A, C)
The big deal here is that AlphaDev removed a wasteful mov S -> P instruction that
I marked ***, based on the algebraic properties of the min and max
calculations.
I'm sorry, this peephole/algebraic optimizing triviality for putting three
items in order does not amount to inventing a new sorting algorithm.
You may fool the simpletons at Nature and Wired, but ...
--
TXR Programming Language:
http://nongnu.org/txr
Cygnal: Cygwin Native Application Library:
http://kylheku.com/cygnal
Mastodon: @
Kazi...@mstdn.ca