Skip to content

tests: add dtype, golden output comparison and metrics to audio, embedding and diffuser nightly pipeline tests - #1258

Draft
quic-vishali wants to merge 2 commits into
quic:mainfrom
quic-vishali:ci/audio-embedding-diffuser-test-refactor
Draft

tests: add dtype, golden output comparison and metrics to audio, embedding and diffuser nightly pipeline tests#1258
quic-vishali wants to merge 2 commits into
quic:mainfrom
quic-vishali:ci/audio-embedding-diffuser-test-refactor

Conversation

@quic-vishali

Copy link
Copy Markdown
Contributor

Summary

Refactors the nightly pipeline test infrastructure for audio, audio-embedding,
embedding and diffuser models

  • Add FP16 test configurations alongside existing FP32
  • Introduce golden output comparison (PyTorch reference vs QPC output)
  • Fix dtype handling bugs that caused FP16 export failures
  • Add per-run metrics (onnx_size, qpc_size, peak_ram_mb,...)

…ith dtype, golden output, and metrics

  - Add FP16 export + compile tests for audio models (Whisper) and
    audio-embedding models (Wav2Vec2) alongside existing FP32 configs
  - Add golden output comparison: run PyTorch reference once, save to
    golden_outputs/{category}.json; subsequent runs load and compare
    QPC output against stored golden using MAD with tolerance
  - Use nested artifact structure {model → dtype_key} to avoid key
    collisions between FP32 and FP16 runs
  - Fix pre_generate_utils to accept dtype_key and check nested artifact
    structure correctly
  - Add peak_ram_mb tracking via measure_peak_ram context manager for
    entire export+compile run
  - Fix whisper get_dummy_inputs to respect model torch_dtype instead of
    hardcoding float32

  Tests added per model type:
  - test_export_compile / test_generate (FP32)
  - test_export_compile_fp16 / test_generate_fp16 (FP16)

  Golden output file structure (tests/nightly_pipeline/golden_outputs/):
    audio_models.json:
      {
        "audio_models": {
          "openai/whisper-tiny": {
            "fp32_ctx_len32_<digest>": {
              "pytorch_hf_tokens": [[...]],
              "transcription": "Mr. Quilter is the apostle...",
              "gen_len": 25,
              "config_fp": "...pipeline_configs.json",
              "timestamp": "2026-08-06T10:23:45"
            }
          }
        }
      }

Signed-off-by: Vishali Senthilkumar <vishsent@qti.qualcomm.com>
…pooling, golden output and metrics

  Artifact structure (avoids key collisions across dtype × pooling):
      {model_name → dtype_key → pooling_key → {onnx_path, qpc_path, ...}}

  dtype_keys: fp32 | fp32_multiseqlen | fp16 | fp16_multiseqlen
  pooling_keys: mean | max | cls | avg | None

  Golden output file (golden_outputs/embedding_models.json):
    {
      "embedding_models": {
        "BAAI/bge-base-en-v1.5": {
          "fp32_poolingmean_seq_len32_<digest>": {
            "pytorch_embeddings": [[...]],
            "config_fp": "...pipeline_configs.json",
            "timestamp": "2026-08-06T10:23:45"
          }
        }
      }
    }

  Tests added (nightly, per model):
  - test_export_compile / test_generate (FP32, seq_len=32)
  - test_export_compile_multiseqlen / test_generate_multiseqlen (FP32, seq_len=[32,20])
  - test_export_compile_fp16 / test_generate_fp16 (FP16, seq_len=32)
  - test_export_compile_fp16_multiseqlen / test_generate_fp16_multiseqlen (FP16, seq_len=[32,20])

Signed-off-by: Vishali Senthilkumar <vishsent@qti.qualcomm.com>
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