This guide covers running and extending the NeoBERT regression suite.
conda run --name neobert pytest -qOr via helper:
conda run --name neobert python tests/run_tests.py# One file
conda run --name neobert pytest tests/kernels/test_attention.py -q
# One directory
conda run --name neobert pytest tests/training -q
# Verbose investigation
conda run --name neobert pytest tests/test_model_forward.py -vv --showlocalsconda run --name neobert python tests/run_tests.py --test-dir training
conda run --name neobert python tests/run_tests.py --pattern "test_*compile*.py"
conda run --name neobert python tests/run_tests.py --no-pytesttests/manual/ contains opt-in validation/benchmark scripts and is excluded from
default pytest -q discovery.
Manual script commands are in tests/manual/README.md.
- Prefer tiny configs in
tests/configs/. - Keep tests deterministic and local (avoid network where possible).
- Disable external logging for training tests (
wandb.mode: disabled). - Guard GPU-only assertions with
torch.cuda.is_available(). - For performance-sensitive paths (packing/compile), include regression tests for both correctness and expected control-flow behavior.
- Import errors
- install editable package (
pip install -e .[dev]).
- Device mismatches
- ensure tensors and models are on the same device in assertions.
- Slow tests
- lower steps/batch sizes and use tiny configs.