Model Parallelism
This package is a simple wrapper around DeepSpeed to make it as easy as possible to implement model parallelism in your PyTorch models.
Example Usage
# Your training script
+ import model_parallelism
# All your data preparation, logging, etc.
model = create_model(...)
- model = model.to(device)
- optimizer = torch.optim.Adam(model.parameters(), lr=1e-4)
+ model = model_parallelism.initialize(
+ model, learning_rate=1e-4, optimizer="Adam", batch_size=batch_size
+ )
for batch in dataloader:
loss = model(batch)
- loss.backward
+ model.backward(loss)
- optimizer.step()
+ model.step()
Metadata
Release files for model-parallelism 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| model_parallelism-0.1.0.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| model_parallelism-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / model_parallelism-0.1.0.tar.gz
| Download URL | model_parallelism-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8b0e0a17d367882b18e741627ac1111569959335da794092a6a20701562551a
|
|
BLAKE2b-256 checksum How to use checksums |
50f6a6c229c9464c277c454664bf8d5c9985375d662a8137d9647e919b4565c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / model_parallelism-0.1.0-py3-none-any.whl
| Download URL | model_parallelism-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
880dd831f4f643de34d3aa45a4443a52d4c27adb6bad6634c99a06ecd4340b9f
|
|
BLAKE2b-256 checksum How to use checksums |
fc87744e42608fe0e4abdfe7feccadd42c36f40f23a68bf208cb5970aa0f65d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|