Giter Site home page Giter Site logo

workloadgenerator's Introduction

Workload Generator

Overview

The Workload Generator is a project that accepts a PyTorch model and a test input set. It generates an ONNX file and analyzes the types of operators inside the ONNX. It also provides approximations for MAC counts, the number of parameters, input/output sizes, and more in a report object.

Installation

  1. Clone the repository:

    git clone https://github.com/idslab-skku/WorkloadGenerator.git
  2. Create a new conda environment and activate it:

    conda env create -f environment.yml
    conda activate workload-generator

Usage

  1. Import the necessary modules:

    import torch
    import onnx
    from WOrkloadGenerator import WorkloadGenerator
  2. Load your PyTorch model and test input set:

    model = torch.load('path/to/your/model.pth')
    test_input = torch.load('path/to/your/test_input.pth')
  3. Generate the ONNX file:

    generator = WorkloadGenerator(model)
    onnx_file = generator.generate_onnx('path/to/save/onnx/model.onnx')
  4. Analyze the ONNX file and generate the report:

    report = generator.analyze_onnx(onnx_file)
  5. Access the information in the report object:

    mac_counts = report.mac_counts
    num_parameters = report.num_parameters
    input_size = report.input_size
    output_size = report.output_size
    # ... and more

License

This project is licensed under the MIT License.

workloadgenerator's People

Contributors

ids-jwpark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.