huggingface / huggingface/accelerate

Feature Request: Context manager for downcasting on TPUs

Open
#587 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.