mlcommons / mlcommons/algorithmic-efficiency

Wrong return type in librispeech model_fn

Open
#762 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
425
Forks
78
PR merge metrics
No merged PRs in 30d

Description

In librispeech_conformer the model_fn returns logits_batch as a Tuple of tensors, not a tensor.

The return type is hence wrong:
https://github.com/mlcommons/algorithmic-efficiency/blob/ddf5efc4e13a9a4e620ad719e9bf42303f064fac/algorithmic_efficiency/workloads/librispeech_conformer/librispeech_pytorch/workload.py#L119

It should be:

  def model_fn(...) -> Tuple[Tuple[spec.Tensor, spec.Tensor], spec.ModelAuxiliaryState]:

As insignificant as it seems, this caused me quite some trouble debugging an OOM issue. Might be useful for other ppl too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open algorithmic_efficiency/workloads/librispeech_conformer/librispeech_pytorch/workload.py around line 119 and inspect model_fn alongside the construction of logits_batch. Confirm the runtime return shape and update the annotation to match it; done means the declared return type represents the tuple and related checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.