huggingface / huggingface/accelerate
Feature Request: Context manager for downcasting on TPUs
Open
feature request
TPU
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 1.5k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Since downcasting on TPUs is better for calculating metrics and logging values, it might be nice to have an API that lets you toggle downcasting via a context manager.
Under the hood this should use `patch_environment` to patch the right environmental variable.
Proposed API design:
```python
with accelerator.tpu_downcast():
# Run through evaluation loop
```
Contributor guide
Assessment
This issue has not been assessed yet.