Repository navigation
fix(models): make the MLperf Tiny exporters match the reference models - #24
Merged
Merged
Conversation
Three of the five benchmark exporters did not produce the MLperf Tiny reference model. Checked against the int8 reference graphs the repos already ship in TrainDeeploy (Tests/Models/MLPerf/). DS-CNN. The KWS export defaulted to the "xs" PULP variant (16 channels, 25x10 MFCC, 2,732 params) where the reference is DS-CNN-S (64 channels, 49x10, ~24.9K). The registry already had a DSCNN-S entry, but its stem used valid padding and emitted a 20x4 map against the reference's 25x5, because the reference stem is Conv2D(64,(10,4),strides=2,padding='same'). Adds stem_padding="same" (symmetric padding computed to reproduce Keras' output size, so no separate Pad node): 23,180 params, 2.657M MACs, which is the published figure. Autoencoder. The AD export was a 128-dim toy (128->64->32->64->..., 29,120 params). The reference is 640 -> 128x4 -> 8 -> 128x4 -> 640 with BatchNorm on every hidden layer, ~268K params; the pre-existing "mlperf" variant (128->[128,128,128]->128) was not it either. Adds MLPerfADAutoencoder behind variant "mlperf_ad" and an Autoencoder-AD registry entry: 267,928 params, 264,192 MACs, 10 Gemm. BatchNorm1d over an (N,C) tensor is undefined at N=1 -- zero variance, and PyTorch refuses outright -- but on-device training runs at batch 1. FrozenStatsBatchNorm1d keeps the layers and their learnable affine parameters and normalizes with randomized running statistics instead, so the training graph carries the reference's 9 BatchNormInternal and 9 BatchNormalizationGrad nodes and its parameter count. MobileNetV1. The MLperf Tiny VWW reference is MobileNetV1-0.25, not the MobileNetV2-0.35 the registry described as such. There was no V1 exporter at all, so the mobilenetv1_train fixture deployed in TrainDeeploy could not be regenerated from this repo, although README.md and scripts/make_single_step.py both use "--model MobileNetV1" as an example. Adds the model and its exporter, with module names matching that fixture's parameters so regenerated graphs stay drop-in: 213,586 params, 7.490M MACs. Also corrects two registry descriptions that misstated what the entry builds: DSCNN-S claimed ~270K params (it is ~23K), and MobileNetV2-VWW claimed to be the MLperf VWW reference. Verified with onnxruntime-training 1.19.2 under the pinned versions; regenerating ResNet-8 reproduces the committed fixture node for node. tests/: 154 passed, 4 skipped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vb2GVs3qbiyLV1KkV2baN
This was referenced Sep 10, 2026
fix(training): deploy the MLperf-compliant DS-CNN and autoencoder fixtures
runwangdl/TrainDeeploy#70
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three of the five MLperf Tiny benchmark exporters did not build the reference model. Checked against the int8 reference graphs already shipped in TrainDeeploy (
Tests/Models/MLPerf/):1x49x13→12, 22,160 par1x25x10, 2,732 par1x49x10, 23,180 par, 2.657M MACs640→640, 10 Gemm, 265,106 par128→128, 29,120 par640→640, 267,928 par, 0.264M MACs3x96x96→2, 209,126 parDetails
DS-CNN. The KWS export defaulted to the
xsPULP variant. The registry already had aDSCNN-Sentry, but its stem used valid padding and emitted a 20x4 map against the reference's 25x5 — the reference stem isConv2D(64,(10,4),strides=2,padding='same'). Addsstem_padding="same", computed as the smallest symmetric padding reproducing Keras' output size so no separatePadnode appears. MACs go 1.701M → 2.657M, the published figure. The legacyxsdefault is untouched.Autoencoder. The AD export was a 128-dim toy; the pre-existing
mlperfvariant (128→[128,128,128]→128) was not the reference either. AddsMLPerfADAutoencoderbehindvariant="mlperf_ad"and anAutoencoder-ADregistry entry.BatchNorm1dover an(N,C)tensor is undefined atN=1— zero variance, and PyTorch refuses outright — but on-device training runs at batch 1.FrozenStatsBatchNorm1dkeeps the layers and their learnable affine parameters and normalizes with randomized running statistics instead, so the training graph carries the reference's 9BatchNormInternal+ 9BatchNormalizationGradnodes and its parameter count.MobileNetV1. The MLperf Tiny VWW reference is MobileNetV1-0.25, not the MobileNetV2-0.35 the registry described as such. There was no V1 exporter, so the
mobilenetv1_trainfixture deployed in TrainDeeploy could not be regenerated from this repo — even thoughREADME.md:185andscripts/make_single_step.py:42both use--model MobileNetV1as an example. Module names match that fixture's parameters (stem_*,blocks_N_{dw,bn_dw,pw,bn_pw}_*,fc_*) so regenerated graphs stay drop-in.Registry descriptions.
DSCNN-Sclaimed ~270K params (it is ~23K);MobileNetV2-VWWclaimed to be the MLperf VWW reference.Testing
pytest tests/→ 154 passed, 4 skippedonnxruntime-training==1.19.2under the pinned versions.Follow-up (not in this PR)
The regenerated DS-CNN and Autoencoder fixtures still have to land in TrainDeeploy, where the DS-CNN graph is ~8x and the AE ~9x their previous size —
test_gap9_tiled_config.pyL1/L2 budgets will need re-tuning.🤖 Generated with Claude Code
https://claude.ai/code/session_012vb2GVs3qbiyLV1KkV2baN