Skip to content

Support slimmable (SlimmableContainer) files in bench_a2_fast#286

Open
jfsantos wants to merge 1 commit into
sdatkinson:mainfrom
jfsantos:bench-a2-fast-slimmable
Open

Support slimmable (SlimmableContainer) files in bench_a2_fast#286
jfsantos wants to merge 1 commit into
sdatkinson:mainfrom
jfsantos:bench-a2-fast-slimmable

Conversation

@jfsantos

Copy link
Copy Markdown
Contributor

What

bench_a2_fast previously only accepted plain WaveNet .nam files and bailed on slimmable files. A2 models are shipped as SlimmableContainer models that bundle multiple standalone submodels (e.g. A2-Full at 8 channels and A2-Lite at 3 channels), so they couldn't be benchmarked with this tool.

This adds a --slim V (0.0–1.0) option that resolves a SlimmableContainer to a single submodel using the same rule as ContainerModel::SetSlimmableSize (first submodel whose max_value exceeds V, else the last), then runs the existing fast-vs-generic comparison on that submodel's config + weights.

Notes

  • Plain WaveNet files are unaffected — passing --slim there just prints a note and benches normally.
  • Omitting --slim on a container defaults to full size (last submodel).
  • No library changes: each container submodel is already a standalone a2-shaped WaveNet spec, so it flows through the existing fast/generic paths directly.

Testing

Ran against a real A2 SlimmableContainer file:

  • --slim 1.0 → submodel 1, A2 standard (8 ch), ~1.6× fast-vs-generic speedup
  • --slim 0.2 → submodel 0, A2 nano (3 ch), ~6.5× fast-vs-generic speedup

A2 files are shipped as SlimmableContainer models bundling multiple
standalone submodels (e.g. A2-Full at 8 channels and A2-Lite at 3).
bench_a2_fast previously only accepted plain WaveNet files and bailed
on these.

Add a --slim V (0.0-1.0) option that resolves a SlimmableContainer to a
single submodel using the same rule as ContainerModel::SetSlimmableSize
(first submodel whose max_value exceeds V, else the last), then runs the
existing fast-vs-generic comparison on that submodel's config + weights.
Plain WaveNet files are unaffected (a --slim there just prints a note);
omitting --slim on a container defaults to full size.

No library changes: each container submodel is already a standalone
a2-shaped WaveNet spec.
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.

1 participant