Skip to content

Testing and Validation

Sudhanshu edited this page Nov 11, 2026 · 1 revision

Testing and Validation

1. Syntax and data integrity

python -m py_compile parallel_llm_inference.py
python scripts/validate-package.py

The validation helper verifies required assets, notebook JSON structure, source compilation, JSONL records, Mermaid fences and local Markdown wiki links.

2. Offline functional smoke test

python parallel_llm_inference.py --mock --devices cpu cpu --input reviews.jsonl --output results_mock.jsonl --batch-size 4 --worker-timeout 120

This checks worker lifecycle, batch queueing, stable ordering and file writing, but not actual Qwen behavior. Separate real GPU tests require installed Transformers, network/cached model and supported CUDA hardware.

3. Failure-mode tests to consider

  • Invalid JSON line and missing text field
  • Empty input file
  • Unavailable/duplicate CUDA device assignment
  • Worker timeout and out-of-memory failure
  • Unexpected model output containing a sentence instead of a label
  • Repeated invocation with outputs sent to separate paths

Avoid treating synthetic data or keyword mock output as model evaluation evidence.

Clone this wiki locally