No project description provided
Project description
🚀 dlcalc
📋 Overview
dlcalc is a collection of tools for deep learning practitioners, providing calculators and tools for:
- 🧮 Performance Modeling - Estimate training throughput, memory usage, and MFU
- 🌐 Topology Analysis - Analyze and optimize network topology for distributed training
- 📊 Metrics Conversion - Convert between different performance metrics
- 🔍 Checkpoint Analysis - Inspect and summarize model checkpoints
🔧 Installation
Via pip (recommended)
pip install dlcalc
or
From source
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 (3dtrn)
Calculator for estimating performance characteristics of ND parallel transformer training:
3dtrn examples/llama3_70b.yaml
We recommend to use this with profilers like NVIDIA Nsight Systems or PyTorch Profiler to give theoretical grounding to your performance profiling.
🌐 Topology Optimization
| Tool | Command | Purpose |
|---|---|---|
| Visualizer | topoviz |
Generate network topology graphs from Kubernetes clusters |
| Evaluator | topoeval |
Analyze topology optimality for DP rings |
| Scheduler | topoassign |
Compute topology-aware rank assignments |
# Visualize cluster topology
topoviz -h
# Evaluate training job topology
topoeval -h
# Generate optimal rank assignments
topoassign -h
📊 Metrics & KPIs
Samples/Sec → MFU Converter (sps2mfu)
Convert training throughput to Model FLOPs Utilization (MFU):
sps2mfu --samples-per-sec 100 --seqlen 2048 --model-size 70b \
--n-accelerators 512 --tflops-per-accelerator 312
Samples/Sec → Tokens/Day Converter (sps2tpd)
Calculate daily token throughput:
sps2tpd --samples-per-sec 100 --seqlen 2048
🔍 Utilities
Checkpoint Summarizer (ckpt-summarize)
Analyze PyTorch checkpoint contents:
ckpt-summarize model.pt
🧑💻 Development
Setup Development Environment
# Install with development dependencies
pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
Run Quality Checks
# Run all checks (formatting, linting, type checking, tests)
bash checks
Testing
# Run full test suite
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=dlcalc --cov-report=term-missing
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📮 Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dlcalc-0.2.0.tar.gz.
File metadata
- Download URL: dlcalc-0.2.0.tar.gz
- Upload date:
- Size: 46.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ed599a12458b9217b31b4ccef05dfbc23972a427299961ed60db444fa8dee6e
|
|
| MD5 |
95d905ecb6c1d3432cd34af1cdf28243
|
|
| BLAKE2b-256 |
761f977635b00cf2ea0ec44037c8e49227a962be4a69f0c1eddf9fe3862b2f32
|
Provenance
The following attestation bundles were made for dlcalc-0.2.0.tar.gz:
Publisher:
pypi-publish.yml on jfc4050/dlcalc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dlcalc-0.2.0.tar.gz -
Subject digest:
0ed599a12458b9217b31b4ccef05dfbc23972a427299961ed60db444fa8dee6e - Sigstore transparency entry: 374443200
- Sigstore integration time:
-
Permalink:
jfc4050/dlcalc@2b9ae5050bc1206c7cb03f5fdae2b314490a61f4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jfc4050
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2b9ae5050bc1206c7cb03f5fdae2b314490a61f4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dlcalc-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dlcalc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0656fc8f0cd02fab60eaa0cf7733d7ea923d7ded00c769f664a0f9d1f698f5
|
|
| MD5 |
e0088beef1c92f1e16ed63529b7f22bb
|
|
| BLAKE2b-256 |
eeac53aaaceac645a87b54cc838a92eae6026a7c452bc00bb24f5de4a7803a28
|
Provenance
The following attestation bundles were made for dlcalc-0.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on jfc4050/dlcalc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dlcalc-0.2.0-py3-none-any.whl -
Subject digest:
1e0656fc8f0cd02fab60eaa0cf7733d7ea923d7ded00c769f664a0f9d1f698f5 - Sigstore transparency entry: 374443217
- Sigstore integration time:
-
Permalink:
jfc4050/dlcalc@2b9ae5050bc1206c7cb03f5fdae2b314490a61f4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jfc4050
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2b9ae5050bc1206c7cb03f5fdae2b314490a61f4 -
Trigger Event:
release
-
Statement type: