Skip to content

feat: add examples/dp_sgd_transformer.py for DP training of a transformer. #514

feat: add examples/dp_sgd_transformer.py for DP training of a transformer.

feat: add examples/dp_sgd_transformer.py for DP training of a transformer. #514

Workflow file for this run

name: ci
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-test:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
steps:
- uses: "actions/checkout@v6"
- uses: "actions/setup-python@v6"
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
pip install pylint pytype flake8 pylint-exit pydocstyle
pip install -e .[dev]
pip install -r docs/requirements.txt
pip install crc32c
- name: Run flake8
run: flake8 jax_privacy tests examples
- name: Run pydocstyle
run: |
pydocstyle --convention=google --add-ignore=D101,D102,D103,D105,D202,D402 jax_privacy/
- name: Run pylint
run: |
pylint jax_privacy || pylint-exit -efail -wfail -cfail -rfail $?
pylint examples || pylint-exit -efail -wfail -cfail -rfail $?
pylint tests -d W0101,W0212,C0114 || pylint-exit -efail -wfail -cfail -rfail $?
shell: bash
- name: Run pytype
run: |
pytype jax_privacy -k
pytype tests -k
pytype examples -k
- name: Run doctests
run: |
pytest --doctest-modules jax_privacy/
- name: Run tests
run: |
pytest -n auto tests/ -k "not matrix_factorization and not distributed_noise_generation_test and not sharding_utils_test"
pytest -n auto tests/ -k "distributed_noise_generation_test"
pytest -n auto tests/ -k "sharding_utils_test"
export HYPOTHESIS_PROFILE=dpftrl_default
pytest -n auto tests/ -k "matrix_factorization" --ignore=tests/matrix_factorization/buffered_toeplitz_test.py
shell: bash
- name: Build docs
run: |
cd docs
sphinx-build -W -b html . _build/html
cd ..