8000 DOC add section on debugging ARM64 problems (#18033) · scikit-learn/scikit-learn@863b5ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 863b5ba

Browse files
authored
DOC add section on debugging ARM64 problems (#18033)
1 parent e2c80b8 commit 863b5ba

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

doc/developers/tips.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,59 @@ give you clues as to the source of your memory error.
260260

261261
For more information on valgrind and the array of options it has, see the
262262
tutorials and documentation on the `valgrind web site <http://valgrind.org>`_.
263+
264+
.. _arm64_dev_env:
265+
266+
Building and testing for the ARM64 platform on a x86_64 machine
267+
===============================================================
268+
269+
ARM-based machines are a popular target for mobile, edge or other low-energy
270+
deployments (including in the cloud, for instance on Scaleway or AWS Graviton).
271+
272+
Here are instructions to setup a local dev environment to reproduce
273+
ARM-specific bugs or test failures on a x86_64 host laptop or workstation. This
274+
is based on QEMU user mode emulation using docker for convenience (see
275+
https://github.com/multiarch/qemu-user-static).
276+
277+
.. note::
278+
279+
The following instructions are illustrated for ARM64 but they also apply to
280+
ppc64le, after changing the Docker image and Miniforge paths appropriately.
281+
282+
Prepare a folder on the host filesystem and download the necessary tools and
283+
source code::
284+
285+
mkdir arm64
286+
pushd arm64
287+
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
288+
git clone https://github.com/scikit-learn/scikit-learn.git
289+
290+
Use docker to install QEMU user mode and run an ARM64v8 container with access
291+
to your shared folder under the `/io` mount point::
292+
293+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
294+
docker run -v`pwd`:/io --rm -it arm64v8/ubuntu /bin/bash
295+
296+
In the container, install miniforge3 for the ARM64 (a.k.a. aarch64)
297+
architecture::
298+
299+
bash Miniforge3-Linux-aarch64.sh
300+
# Choose to install miniforge3 under: `/io/miniforge3`
301+
302+
Whenever you restart a new container, you will need to reinit the conda env
303+
previously installed under `/io/miniforge3`::
304+
305+
/io/miniforge3/bin/conda init
306+
source /root/.bashrc
307+
308+
as the `/root` home folder is part of the ephemeral docker container. Every
309+
file or directory stored under `/io` is persistent on the other hand.
310+
311+
You can then build scikit-learn as usual (you will need to install compiler
312+
tools and dependencies using apt or conda as usual). Building scikit-learn
313+
takes a lot of time because of the emulation layer, however it needs to be
314+
done only once if you put the scikit-learn folder under the `/io` mount
315+
point.
316+
317+
Then use pytest to run only the tests of the module you are interested in
318+
debugging.

0 commit comments

Comments
 (0)
0