Trabajando con Leela y Fat Fritz en el ordenador portátil (1)

por Evelyn Zhu
15/06/2020 – Los módulos que funcionan por redes neuronales artificiales (NN), Leela Chess Zero y Fat Fritz se han convertido en unos monstruos de ajedrez extraordinariamente fuertes. Sin embargo, para ser capaz de descorchar toda su fuerza es necesario trabajar con una unidad GPU acelerada. El problema con los ordenadores portátiles muchas veces es que no son lo suficientemente fuertes como para mantener los módulos de tan alto rendimiento y se suele quedar colgados. Evelyn Zhu ha encontrado una solución muy elegante al respecto. He aquí su artículo en inglés.

Fritz 17 Incluye el módulo FAT FRITZ Fritz 17 Incluye el módulo FAT FRITZ

Fritz 17 es la nueva edición de aquel mismo programa de ajedrez Fritz que ha fascinado al mundo del ajedrez desde hace unos 25 años (¡!): las victorias de Garry Kasparov y de Vladimir Kramnik; los métodos innovadores y modernos de entrenamiento para jugadores aficionados y profesionales; ajedrez cibernético en el servidor de Fritz, etc. Fritz es “el programa de ajedrez más popular de Alemania” (Der Spiegel) y ofrece todo lo que necesita el ajedrecista. La novedad más espectacular: Fritz 17 incluye el módulo basado en una red neuronal de inteligencia artificial, "Fat Fritz".

Más...

El artículo por Evelyn Zhu en inglés:

Jetson Lc0: Leela and Fat Fritz on a portable GPU device

I am 15-year-old WIM Evelyn Zhu. The beautiful game of chess has and continues to be a huge part of my life. At the age of seven, I started playing chess competitively. Since then, I’ve worked my way up to being one of the top players of my age in the USA.

For the past two years, I’ve been more or less settled with the neural network (NN) based Leela Chess Zero (aka Lc0) engine, the open-source implementation of Google DeepMind’s Alpha Zero. It has consistently beaten other engines, most recently winning the 17th season of the TCEC against Stockfish with a score of 52.5 – 47.5. Lc0 is quite fascinating as is seems to show evaluations in a more positional manner, without searching very deep as other non-NN engines do.

The same applies to the NN engine Fat Fritz (FF), which is part of the Fritz 17 package and with which I intend to experiment with in the future. I am in touch with ChessBase, who will be providing me with betas of the upcoming version. They say it is already now a great leap forward in playing strength.

In order to unleash the power of its NN algorithms, we must use some kind of GPU accelerator device, such as Nvidia’s modern GPU GTX 10 or RTX 20 series.

Modern laptops are, in fact, often equipped with the aforementioned devices. The problem is that the compact profile of a laptop often can’t sustain the running of lc0. When it comes to running an engine for purposes such as opening preparation and game analysis, my laptop (with GTX 1650) tends to crash from overheat.

Because of this issue, I started to wonder if there was a way for laptops to connect to an external, portable Nvidia GPU device and, at the same time, still be able to launch the lc0 engine with ChessBase.

I raised this question to my dad, who is familiar with computer peripheral devices, and he told me there is probably a solution. He mentioned that Nvidia recently released a considerably powerful GPU device, the Jetson Xavier NX module, which is intended for IoT purposes such as AI-powered robotics and autonomous vehicles. This new device has 384 NVIDIA CUDA® Cores and 48 Tensor Cores and claims to reach 21 TOPS AI performance. In essence, it is an excellent candidate for running lc0.

He advised me to figure out the following three points to make this work:

  1. Launch lc0/FF engine inside the Xavier NX device: The lc0 source code is mainly Intel x86/amd64 architecture for both Windows and Linux. Even though Jetson Xavier NX is based on ARM64 architecture, it comes with Ubuntu Linux 18.04, so it is possible to recompile the source code.

  2. Launch UCI engine in ChessBase on Windows laptop: Since I still want to use ChessBase on my Windows laptop the same way I did before, I have to create a UCI engine program that can process ChessBase-issued UCI commands. This does not seem very difficult since I can simply borrow the main program from the lc0 source code and only keep the part with UCI loop logics.

  3. Communications between frontend UCI and backend lc0/FF: For this point, I need to create a data communication channel to transmit the UCI commands to the backend lc0/FF engine. Then, I have to return the results back to the frontend UCI engine. This can be done via network programming or serial port programming since Jetson Xavier NX supports both.

After an intensive few weeks of work, I managed to come up with a simple Windows UCI engine program (point 2) as well as the communication mechanism between UCI and lc0 backend (point 3). My dad helped me crack point 1 as it took some effort to tweak and recompile the lc0 source code for ARM64 and CUDA/CUDNN libraries to successfully load it in the Xavier NX device.

With everything in place, I’m able to simply connect the Xavier NX device with a MicroUSB-to-USB cable to my Windows laptop, launch the lc0 engine from the Xavier NX device (via PuTTY, a secure remote login tool), and then load the UCI engine from ChessBase. And that’s it! The performance is great using the popular network 256x20-t40-1541.pb.gz.

Here is a demo video showing how to run the Jetson Lc0 engine.

The Jetson Xavier NX device is small and very convenient to carry. I also managed to put it inside a case that is dedicated to the Jetson Nano development board.

The Jetson Xavier NX Device connectd to my laptop without a case...

... and in the elegant little case built for it.

Whether or not your laptop comes with Nvidia GPU, you can still run Jetson Lc0 to achieve the high performance of lc0 because you are running on an external GPU device.

This portable Leela Chess Zero and Fat Fritz device really solves my laptop crash issue! I am now using this device for any chess analysis that needs an engine’s help. I’m hoping my work will help many other chess enthusiasts who face a similar issue.

Besides Jetson Xavier NX, the same programs can be used on a more powerful Jetson AGX Xavier, which doubles the performance of lc0.

Fritz 17 Incluye el módulo FAT FRITZ

Fritz 17 es la nueva edición de aquel mismo programa de ajedrez Fritz que ha fascinado al mundo del ajedrez desde hace unos 25 años (¡!): las victorias de Garry Kasparov y de Vladimir Kramnik; los métodos innovadores y modernos de entrenamiento para jugadores aficionados y profesionales; ajedrez cibernético en el servidor de Fritz, etc. Fritz es “el programa de ajedrez más popular de Alemania” (Der Spiegel) y ofrece todo lo que necesita el ajedrecista. La novedad más espectacular: Fritz 17 incluye el módulo basado en una red neuronal de inteligencia artificial, "Fat Fritz".

Más...

Enlaces

 




Evelyn Zhu es maestra interancional femenina y maestra nacional de EE. UU: Vive en Long Island, Nueva York, Estados Unidos de América. Trabaja como organizadora de torneos y entrenadora. Aparte del ajedrez el interesa la ciencia informática y la programación informática y la inteligencia artifical.
Discussion and Feedback Join the public discussion or submit your feedback to the editors