Skip to content

[espnet3-14] Add integration test#6331

Open
Masao-Someki wants to merge 87 commits intoespnet:masterfrom
Masao-Someki:espnet3/integration_test
Open

[espnet3-14] Add integration test#6331
Masao-Someki wants to merge 87 commits intoespnet:masterfrom
Masao-Someki:espnet3/integration_test

Conversation

@Masao-Someki
Copy link
Copy Markdown
Contributor

What did you change?

  • Added an espnet3 integration test in CI and introduced TEMPLATE/mini_an4 ASR example configs, scripts, and dataset
    generation code.
  • Added jiwer as a dependency for the scoring stage.
  • Moved the mini_an4 dataset archive to egs2 to avoid using egs.

Why did you make this change?

  • To validate espnet3 end‑to‑end behavior via a reproducible CI integration test.
  • To declare the dependency required for scoring.
  • To align with the policy of using egs2 instead of egs.

Is your PR small enough?

no
(more than 20 files changed, because it includes TEMPLATE directory.)

Additional Context

  • egs2/mini_an4/asr1/downloads.tar.gz is a binary update.

This PR should be merged after #6329.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. CI Travis, Circle CI, etc ESPnet3 labels Dec 26, 2025
@mergify mergify Bot added the ESPnet2 label Dec 26, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant amount of new code for espnet3 integration tests, including a new mini_an4 example and a TEMPLATE for recipes. The changes are extensive and set up a new structure for experiments. My review focuses on the new espnet3 components and recipes. I've found a few high-severity issues: a bug in the TEMPLATE run script, a bug in the mini_an4 dataset creation script where a configured path is ignored, and a design issue in the base inference system that hardcodes a dependency on ASR components. These issues should be addressed to ensure the new espnet3 framework is robust and extensible.

Comment thread egs3/TEMPLATE/asr/run.py
main(
args=args,
system_cls=ASRSystem,
stages=DEFAULT_STAGES,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The stages_to_run variable, which holds the resolved list of stages to execute, is calculated but then ignored. Instead, DEFAULT_STAGES is passed to the main function. This is a bug in the template that can lead to incorrect behavior if a recipe defines custom stages. The resolved stages_to_run should be passed to main.

Suggested change
stages=DEFAULT_STAGES,
stages=stages_to_run,

Comment thread egs3/mini_an4/asr/src/create_dataset.py Outdated
f.write(f"{e.utt_id}\t{e.wav_path}\t{e.text}\n")


def create_dataset(dataset_dir: Path, *, archive_path: Path | None = None) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The archive_path parameter is ignored. The function uses a hardcoded path to the archive, which makes it less flexible and ignores the configuration provided in train.yaml. The archive_path passed to the function should be used.

Suggested change
def create_dataset(dataset_dir: Path, *, archive_path: Path | None = None) -> None:
archive = Path(archive_path) if archive_path is not None else Path("../../../egs2/mini_an4/asr1/downloads.tar.gz")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reflect on this comment.

Comment thread espnet3/systems/base/inference.py Outdated
from omegaconf import DictConfig

from espnet3.parallel.parallel import set_parallel
from espnet3.systems.asr.inference import InferenceProvider, InferenceRunner
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The inference function in this base module has a hardcoded dependency on the ASR-specific InferenceProvider and InferenceRunner. This breaks the abstraction of a base system and prevents it from being used with other tasks (e.g., TTS, SLU) without modification. The provider and runner classes should be made configurable, for example by instantiating them from the configuration file.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 83.29114% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.05%. Comparing base (88ef225) to head (8d2a79c).
⚠️ Report is 80 commits behind head on master.

Files with missing lines Patch % Lines
espnet3/utils/config_utils.py 77.77% 24 Missing ⚠️
espnet3/systems/asr/transducer_task.py 91.86% 10 Missing ⚠️
espnet3/systems/base/inference.py 68.42% 6 Missing ⚠️
espnet3/utils/stages_utils.py 50.00% 6 Missing ⚠️
espnet3/components/modeling/lightning_module.py 80.00% 4 Missing ⚠️
espnet3/components/data/data_organizer.py 62.50% 3 Missing ⚠️
espnet3/systems/base/inference_provider.py 66.66% 3 Missing ⚠️
espnet3/utils/logging_utils.py 80.00% 3 Missing ⚠️
espnet3/components/trainers/trainer.py 81.81% 2 Missing ⚠️
espnet3/utils/task_utils.py 83.33% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6331      +/-   ##
==========================================
+ Coverage   70.02%   70.05%   +0.03%     
==========================================
  Files         787      788       +1     
  Lines       73075    73430     +355     
==========================================
+ Hits        51171    51444     +273     
- Misses      21904    21986      +82     
Flag Coverage Δ
test_integration_espnet2 46.85% <ø> (-0.04%) ⬇️
test_python_espnet2 61.34% <0.00%> (-0.29%) ⬇️
test_python_espnet3 17.71% <83.29%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Masao-Someki and others added 15 commits January 7, 2026 17:35
- Assume hypothesis to be "" when hypothesis is blank
- Previously we asked developer to create a user-defined modle, but I supported as a default.
- Userd can set `val_scheduler_criterion` as espnet2 to use this function.
- supported train/valid switching for preprocessor
- Add new default resolver to load external config file
@LiChenda
Copy link
Copy Markdown
Contributor

LiChenda commented Jan 9, 2026

I can review this PR. Thanks @Masao-Someki.

Comment thread espnet3/systems/base/metric.py Outdated
logger = logging.getLogger(__name__)


def _resolve_test_sets(measure_config: DictConfig) -> list[str]:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is to allow users to drop dataset config from metrics.yaml.

_LOG_STAGE.reset(token)


def log_stage_metadata(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is moved from run.py for refactoring.

return [s for s in stages if s in requested_set]


def parse_cli_and_stage_args(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is moved from run.py for refactoring.

@@ -0,0 +1,80 @@
from pathlib import Path
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file tests functions in the run.py, and not running the integration test.

@Masao-Someki
Copy link
Copy Markdown
Contributor Author

I think this PR becomes too large. I will split this into 2 PRs.

@sw005320
Copy link
Copy Markdown
Contributor

We want to keep the history of the interactions here.
So, please keep this as it is
Also, please make an addtional PR instead of splitting this

@Masao-Someki
Copy link
Copy Markdown
Contributor Author

@sw005320 Thank you. I will keep this PR as it is and create a new PR with the limited changes!

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 20, 2026

This pull request is now in conflict :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Travis, Circle CI, etc conflicts ESPnet2 ESPnet3 Installation size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants