Skip to main content

No project description provided

Project description

dlcalc

PyPI version checks

random command line tools for deep learning

Installation

pip install dlcalc

or

git clone https://github.com/jfc4050/dlcalc
cd dlcalc
pip install -e .

After this you should have access to the command line tools described below. Some people may need to add --user to their pip install command for them to properly go under $PATH.

Tools

Performance Modeling

3D Training Calculator

Calculator for estimating various performance characteristics of 3D parallel transformer model training:

  • memory consumption
  • pipeline bubble
  • communication overhead
  • compute intensity
  • etc..

This calculator is focused primarily on pretraining, so you won't find calculations for things like LoRA or RLHF/DPO/etc.

For more details run:

3dtrn -h

We've include a sample config you can use to see what the output looks like:

3dtrn examples/llama3_70b.yaml

We recommend pairing this with a profiler of your choice (NVIDIA Nsight Systems and PyTorch Profiler Traces are two good ones), and checking that what you see in the profiler is in the same ballpark as the theoretical values estimated by the calculator. If they are way off, you now know where to spend your investigation/debugging time.

NOTE: If you look at the sample config, you'll see that it takes an instance type which is used to derive various hardware specifications like intra/inter node bandwidth, theoretical FLOPS per device, number of accelerators per node, etc. You can check hardware.py to see what instance types are supported, you'll have to add it there if the instance type you're interested in isn't represented.

Topology

Topology Visualizer

Given a kubernetes pod name prefix for some compute cluster, retrieve AWS network topology info and plot. For more details run:

topoviz -h

Topology Evaluator

Evaluates how optimal a given training job's physical topology is (in terms of network hops in each DP ring). For more details run:

topoeval -h

Topology-Aware Scheduler

Topology-aware instance selection and rank assignment for maximally efficient DP communication. For more details run:

topoassign -h

KPIs

Samples/Sec -> Tokens/Day Converter

Pretty self explanatory, for more details run:

sps2tpd -h

Samples/Sec -> MFU Converter

If you're not familiar with what Model Flops Utilization (MFU) means, refer to Google's PaLM paper. Otherwise pretty self explanatory, for more details run:

sps2mfu -h

Misc.

Checkpoint Summarizer

Gives a human-readable summarization of keys, values, and tensor shapes in a given (PyTorch) model checkpoint. For more details run:

ckpt-summarize -h

Development

install development dependencies

pip install -e .[dev]

static checks can be run with

bash checks

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dlcalc-0.1.9.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dlcalc-0.1.9-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file dlcalc-0.1.9.tar.gz.

File metadata

  • Download URL: dlcalc-0.1.9.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dlcalc-0.1.9.tar.gz
Algorithm Hash digest
SHA256 5088ef864d7c5d57da145162391141c944f43fb1166505358e021c662fd5ce6c
MD5 744aa9805395d4c6863ea4b61f30ffc3
BLAKE2b-256 6e754022f8cf0397fb7d4938c48c12eca4d986597b2e5b8d15a83e139d8e1cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlcalc-0.1.9.tar.gz:

Publisher: pypi-publish.yml on jfc4050/dlcalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dlcalc-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: dlcalc-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dlcalc-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c88d4fb52377de76496fdb975718b76920c4a14ed72042e2c1f4dbf17677a0a9
MD5 a6a5a0bb897f1978581468189304589c
BLAKE2b-256 094f8155692db023c460354bbd2422788c718e95a0994700245cc04accaa1d07

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlcalc-0.1.9-py3-none-any.whl:

Publisher: pypi-publish.yml on jfc4050/dlcalc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page