facebookresearch / facebookresearch/fairseq2

Add a default CPU stat tracker

Open
#1,391 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.1k
Forks
144
Avg merge
4d 1h
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe:**

Right now, running a recipe on CPU (e.g. for debugging its initial setup) throws this error from "fairseq2/recipe/internal/device_stat.py":

> fairseq2.recipe.error.DeviceTypeNotSupportedError: Only `cpu` and `cuda` devices are supported, but the device of the process is `cpu`.

Because no CPU DeviceStatTracker is registered here: "fairseq2/recipe/composition/device_stat.py".

**Describe the solution you would like:**

Possible solutions:
* Amend the error message to be consistent.
* Register the no-op tracker for the "cpu" type.
* Provide an actual default CPU stat tracker.

With a preference for the last one (which I think still lets recipe users override to implement their own CPU tracker).

**Describe the alternatives you have considered:**
As a simple bypass on the recipe implementer side, I simply registered the no-op stat tracker for the "cpu". Recipes are quite convenient!

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.