Skip to content

Record LavaSR torch.compile measurements - #67

Merged
Tinnci merged 1 commit into
mainfrom
agent/lavasr-torch-compile-evidence
Jul 12, 2026
Merged

Record LavaSR torch.compile measurements#67
Tinnci merged 1 commit into
mainfrom
agent/lavasr-torch-compile-evidence

Conversation

@Tinnci

@Tinnci Tinnci commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a Colab-only T4 eager/torch.compile benchmark
  • record cold/warm latency, peak CUDA allocation, determinism, and numerical drift
  • keep torch-eager as the only selectable provider based on measured evidence
  • complete P4 without adding an unsupported optimization surface

Colab evidence

Two fresh Tesla T4 sessions, torch 2.11.0+cu128, identical one-second fixture:

  • warm speedup contradicted across sessions: 0.96x and 1.82x
  • eager first inference: about 2.3-2.4 s
  • compile first inference: about 34-35 s
  • peak CUDA allocation: 72,180,224 vs 80,844,288 bytes
  • compiled repeats were not bit-exact
  • eager/compile max absolute drift: about 5.2e-8 to 6.1e-8
  • TorchInductor warned that complex operators lack code generation support

Decision: no public torch-compile provider. Require repeatable representative-length benefit before reopening. All real-weight, compile, GPU, and audio computation ran through Colab CLI.

Local verification

  • git diff --check
  • pixi run lint
  • pixi run format-check
  • pixi run typecheck
  • pixi run test (163 passed, 6 skipped)

@Tinnci
Tinnci marked this pull request as ready for review July 12, 2026 10:23
Copilot AI review requested due to automatic review settings July 12, 2026 10:23
@Tinnci
Tinnci merged commit b8cb5f3 into main Jul 12, 2026
3 checks passed
@Tinnci
Tinnci deleted the agent/lavasr-torch-compile-evidence branch July 12, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds recorded evidence around a Colab T4 torch.compile experiment for LavaSR and documents the resulting decision to keep torch-eager as the only selectable runtime provider.

Changes:

  • Add a Colab-only benchmark script that measures eager vs torch.compile latency, peak CUDA allocation, determinism, and numerical drift.
  • Document the T4 measurement results and the evidence-based decision not to expose torch-compile as a provider.
  • Minor formatting tweak in a LavaSR compatibility test.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_lavasr_compat.py Reformats a monkeypatch call for readability.
ROADMAP.md Marks the “Optimize Only After Measurement” priority as completed and records the compile findings.
examples/colab_lavasr_compile_benchmark.py Adds a Colab T4 benchmark runner that records eager vs torch.compile evidence.
docs/ACCELERATORS.md Updates accelerator guidance with the compile trial results and reproduction steps.
CHANGELOG.md Notes the addition of the compile benchmark and the decision to keep eager as the only provider.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +18
REPO_URL = os.environ.get("ASR_REPO_URL", "https://github.com/Tinnci/python-audio-super-resolution.git")
GIT_REF = os.environ.get("ASR_GIT_REF", "agent/lavasr-torch-compile-evidence")
WORK_ROOT = Path(os.environ.get("ASR_COLAB_WORK_ROOT", "/content/lavasr-compile-benchmark"))
Comment on lines +49 to +51
torch.manual_seed(0)
torch.cuda.empty_cache()
torch.cuda.reset_peak_memory_stats()
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.

2 participants