-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into prometheus-metrics-update
- Loading branch information
Showing
17 changed files
with
1,868 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Integrating Zeus with HuggingFace 🤗 | ||
|
||
This example will demonstrate how to integrate Zeus's `CarbonEmissionMonitor` with HuggingFace Transformers: | ||
|
||
`run_clm.py`: Transformers [`Trainer`](https://huggingface.co/docs/transformers/main_classes/trainer) for **causal langauge modeling** (i.e., pre-training) | ||
|
||
## Dependencies | ||
|
||
To run the `Trainer` integration script (`run_clm.py`): | ||
```sh | ||
pip install -r requirements.txt | ||
|
||
## `CarbonEmissionMonitor` | ||
|
||
[`CarbonEmissionMonitor`](https://ml.energy/zeus/reference/monitor/carbon/#zeus.monitor.carbon.CarbonEmissionMonitor): Measures the GPU time, energy consumption, and carbon emission of arbitrary code blocks. | ||
|
||
## Running the Example | ||
|
||
By default, `Trainer` will make use of all available GPUs. If you would like to use only a subset of the GPUs, specify the `CUDA_VISIBLE_DEVICES` environment variable, which Zeus will also automatically respect. | ||
|
||
```bash | ||
python run_clm.py \ | ||
--model_name_or_path gpt2 \ | ||
--dataset_name wikitext \ | ||
--dataset_config_name wikitext-2-raw-v1 \ | ||
--per_device_train_batch_size 8 \ | ||
--per_device_eval_batch_size 8 \ | ||
--do_train \ | ||
--do_eval \ | ||
--output_dir /tmp/test-clm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
zeus-ml | ||
accelerate >= 0.12.0 | ||
torch >= 1.3 | ||
datasets >= 1.8.0 | ||
sentencepiece != 0.1.92 | ||
protobuf | ||
evaluate | ||
scikit-learn | ||
transformers>=4.37.2 |
Oops, something went wrong.