Skip to content

Add support for parallel scoring with --num_workers option#85

Open
RogerTzeng wants to merge 1 commit into
wavlab-speech:mainfrom
RogerTzeng:main
Open

Add support for parallel scoring with --num_workers option#85
RogerTzeng wants to merge 1 commit into
wavlab-speech:mainfrom
RogerTzeng:main

Conversation

@RogerTzeng

Copy link
Copy Markdown
  • Introduced --num_workers argument in scorer.py for CPU-based parallel processing.
  • Implemented parallel scoring logic in scorer_shared.py to enhance performance.
  • Added tests to validate functionality of parallel scoring and ensure input order preservation.

- Introduced --num_workers argument in scorer.py for CPU-based parallel processing.
- Implemented parallel scoring logic in scorer_shared.py to enhance performance.
- Added tests to validate functionality of parallel scoring and ensure input order preservation.
@ftshijt

ftshijt commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution! There are some issues I would like to point:

  • versa/scorer_shared.py:554: the parallel resume path rewrites the whole JSONL file with _write_jsonl_scores(..., "w").

    This changes --resume from append-safe to rewrite-at-end. If the process is interrupted during the final write, or the write fails, previously completed resume results can be lost or truncated. It also means newly completed parallel work is not checkpointed until all jobs finish.

    I’d suggest either appending safely like the serial path, or writing to a temp file and atomically replacing the output only after a successful full write.

  • --num_workers > 1 with --scoring_mode metric or corpus-only configs is accepted but ignored.

    A warning or parser error would make that clearer, since the README says those modes remain serial.

After the above issues are addressed, please also make sure you pass the CI.

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

Successfully merging this pull request may close these issues.

2 participants