Giter VIP home page Giter VIP logo

profileml's Introduction

ProfileML

This repository contains the code for the talk "Profiling GPU-driven machine learning code" presented at the Best Practices in AI Afternoon hosted by the Research Software Engineering group and Centre of Machine Intelligence (CMI) at the University of Sheffield.

Links to the slides can be found here.

Installation

To replicate the exact environment I used, then follow these instructions:

  1. Install Conda and create a new environment:
    • conda create -n profileml_env python=3.10
    • conda activate profileml_env
  2. conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=11.8 -c pytorch -c nvidia
  3. pip install tensorboard==2.17.0 torch-tb-profiler==0.4.3

Alternatively, simple installing the latest versions of the packages should work fine.

pip install -r requirements.txt

Data

The data used in this repository is from the TGS Salt Identification Competition from Kaggle. The data is not included in this repository, but can be downloaded from the link. Simply unzip it into the top level of this repository and no further changes should be needed to the code.

Running the Code

Simple run the following command to train the model:

python train.py or python train-ddp.py for single gpu and distributed training respectively.

Note: This code is not optimized for training but rather a toy example to demonstrate profiling. Beware when copying for your own use.

Profiling

Logs will be created in a logs directory. To view the logs, run the following command:

tensorboard --logdir logs

This will start a tensorboard server that you can view in your browser. The default port is 6006.

Alternatively, you can get a trace viewer by dragging the logs into a browser window at chrome://tracing or edge://tracing.

profileml's People

Contributors

edwinb12 avatar

Stargazers

Neil Shephard avatar

Watchers

Kostas Georgiou avatar  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.