Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile so tests run on Raspberry Pi don't fail due to resource constraints. #755

Open
dave-ct opened this issue Mar 19, 2024 · 1 comment
Assignees

Comments

@dave-ct
Copy link

dave-ct commented Mar 19, 2024

Summary

When running pytest on a raspberry PI after creating the python-bindings, using all the threads causes the workers to crash and for some tests to fail.

Problem to solve

Change the number of threads to 1 when running tests on raspberry pi

Proposals

Update the frontends/concrete-python/Makefile and change pytest-default to detect if it is running on a raspberry pi. Example of update to pytest-default could be:

pytest-default:
        export LD_PRELOAD=$(RUNTIME_LIBRARY)
        export PYTHONPATH=$(BINDINGS_DIRECTORY)
        @# Check if running on Raspberry Pi
        @if grep -q 'Raspberry Pi' /proc/cpuinfo; then \
                echo "Running on Raspberry Pi, setting pytest threads to 1."; \
                PYTEST_THREADS=1; \
        else \
                PYTEST_THREADS=auto; \
        fi; \
        pytest tests -svv -n $$PYTEST_THREADS \
                --cov=concrete.fhe \
                --cov-fail-under=95 \
                --cov-report=term-missing:skip-covered \
                --key-cache "${KEY_CACHE_DIRECTORY}" \
                -m "${PYTEST_MARKERS}"
@BourgerieQuentin
Copy link
Member

That's a bit invasive that put that in the makefile of the project. You can directly use the pytests command that you want outside of the makefile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants