pytorch / pytorch/benchmark

[Roadmap WIP] Standardize and increase coverage for TorchBench

Open
#1,293 11 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

roadmap
Dominant language
Python
Stars
1k
Forks
346
PR merge metrics
No merged PRs in 30d

Description

Motivation

TorchBench is a collection of open-source benchmarks used to evaluate PyTorch performance. It provides a standardized API for benchmark drivers, both for evaluation (eager/jit) and training. Plenty of popular models are involved in TorchBench. Users are convenient to debug and profile.

In order to standardize the performance evluation and increase coverage, TorchBench can be enhanced in the following 3 aspects in CPU:

  • Fit for typical user scenarios
  • Well integrate new features of PyTorch
  • Increase benchmark coverage

Detailed proposal

Fit for typical user scenarios (especially in userbenchmark)

add a new userbenchmark with CPU runtime configuration options, enable those configurations into test.py/run.py also for sanity check or debugging

  • Add core binding option, may leverage torch launcher
  • Add gomp/iomp option
  • Add memory allocator option

support performance metrics in the new CPU userbenchmark

  • Add throughput: Samples / Total time
  • Add latency: Total time / samples
  • Add fps-like report
Well integrate new features of PyTorch
  • Enable bf16 datatype support both for inference and training
  • Fully support channels_last both for inference and training
  • Extend a complier option to support Dynamo
  • Support JIT tracing and cover more models with JIT support
  • Enable quantization support
Increase benchmark coverage

Increase model coverage

  • Add models from community with popularity (e.g, RNN-T)
  • Add models from real customers (Multi-Band MelGAN, ViT and Wav2vec)
  • Fix some models not implemented in CPU (e.g, DALLE2_pytorch, moco, pytorch_struct, tacotron2, timm_efficientdet, vision_maskrcnn)
  • Add typical GNN workloads

Port OpBench to TorchBench

  • Increase OpBench coverage
  • Complete support of dtypes, memory-format and inplace version for ops

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

Start by reviewing the unchecked TorchBench coverage items and the existing test.py/run.py workflow, then choose one narrowly scoped model or OpBench task. Check how the relevant benchmark is currently represented and define done as the selected workload or operation being supported and covered by the stated CPU configuration or coverage requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.